Add enum for NM_Read_SerialNumber_By_*

This commit is contained in:
nanosonde 2019-10-28 11:01:01 +01:00
parent e77f61d249
commit 93a92228b8

View File

@ -3,6 +3,14 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
enum NmReadSerialNumberType
{
NM_Read_SerialNumber_By_ProgrammingMode = 0x01,
NM_Read_SerialNumber_By_ExFactoryState = 0x02,
NM_Read_SerialNumber_By_PowerReset = 0x03,
NM_Read_SerialNumber_By_ManufacturerSpecific = 0xFE,
};
BauSystemB::BauSystemB(Platform& platform): _memory(platform), _addrTable(platform), BauSystemB::BauSystemB(Platform& platform): _memory(platform), _addrTable(platform),
_assocTable(platform), _groupObjTable(platform), _appProgram(platform), _assocTable(platform), _groupObjTable(platform), _appProgram(platform),
_platform(platform), _appLayer(_assocTable, *this), _platform(platform), _appLayer(_assocTable, *this),
@ -359,9 +367,9 @@ void BauSystemB::systemNetworkParameterReadIndication(Priority priority, HopCoun
popByte(operand, testInfo + 1); // First byte (+ 0) contains only 4 reserved bits (0) popByte(operand, testInfo + 1); // First byte (+ 0) contains only 4 reserved bits (0)
// See KNX spec. 3.5.2 p.33 (Management Procedures: Procedures with A_SystemNetworkParameter_Read) // See KNX spec. 3.5.2 p.33 (Management Procedures: Procedures with A_SystemNetworkParameter_Read)
switch(operand) switch((NmReadSerialNumberType)operand)
{ {
case 0x01: // NM_Read_SerialNumber_By_ProgrammingMode case NM_Read_SerialNumber_By_ProgrammingMode: // NM_Read_SerialNumber_By_ProgrammingMode
// Only send a reply if programming mode is on // Only send a reply if programming mode is on
if (_deviceObj.progMode() && (objectType == OT_DEVICE) && (propertyId == PID_SERIAL_NUMBER)) if (_deviceObj.progMode() && (objectType == OT_DEVICE) && (propertyId == PID_SERIAL_NUMBER))
{ {
@ -373,13 +381,13 @@ void BauSystemB::systemNetworkParameterReadIndication(Priority priority, HopCoun
} }
break; break;
case 0x02: // NM_Read_SerialNumber_By_ExFactoryState case NM_Read_SerialNumber_By_ExFactoryState: // NM_Read_SerialNumber_By_ExFactoryState
break; break;
case 0x03: // NM_Read_SerialNumber_By_PowerReset case NM_Read_SerialNumber_By_PowerReset: // NM_Read_SerialNumber_By_PowerReset
break; break;
case 0xFE: // Manufacturer specific use of A_SystemNetworkParameter_Read case NM_Read_SerialNumber_By_ManufacturerSpecific: // Manufacturer specific use of A_SystemNetworkParameter_Read
break; break;
} }
} }