documentation updates
This commit is contained in:
parent
41b51f7aa9
commit
c0074e62b7
|
@ -237,11 +237,11 @@ void BasicDevice::actionGetDeviceInfo(MsgPair msg)
|
|||
response->appendParameterData(deviceModelID);
|
||||
response->appendParameterData(deviceProductCategory);
|
||||
response->appendParameterData(LIB_VERSION);
|
||||
response->appendParameterData((uint16_t)0);
|
||||
response->appendParameterData((uint16_t)0);
|
||||
response->appendParameterData((uint16_t)0);
|
||||
response->appendParameterData((uint16_t)0);
|
||||
response->appendParameterData((uint16_t)0);
|
||||
response->appendParameterData((uint16_t)0); // DMX512 Footprint
|
||||
response->appendParameterData((uint16_t)0); // DMX512 Personality
|
||||
response->appendParameterData((uint16_t)0); // DMX512 START address 1
|
||||
response->appendParameterData((uint16_t)0); // DMX512 START address 2
|
||||
response->appendParameterData((uint16_t)0); // Sub-Device count
|
||||
response->appendParameterData<uint8_t>(sensors_.size());
|
||||
}
|
||||
|
||||
|
|
|
@ -169,21 +169,21 @@ uint16_t Device::subDeviceCount() const
|
|||
*/
|
||||
void Device::dispatch(MsgPair msg)
|
||||
{
|
||||
auto [call, response] = msg;
|
||||
auto [command, response] = msg;
|
||||
|
||||
if (call->subDevice == 0)
|
||||
if (command->subDevice == 0)
|
||||
return BasicDevice::dispatch(msg);
|
||||
else if (call->mdb.cc == DISCOVERY_COMMAND)
|
||||
else if (command->mdb.cc == DISCOVERY_COMMAND)
|
||||
return response->nak(NR_SUB_DEVICE_OUT_OF_RANGE);
|
||||
|
||||
if (call->subDevice == SUB_DEVICE_ALL_CALL)
|
||||
if (command->subDevice == SUB_DEVICE_ALL_CALL)
|
||||
{
|
||||
/// \cite RDM 9.2.2 Using Sub-Devices
|
||||
/// Broadcast GET commands sent to the SUB_DEVICE_ALL_CALL Sub-Device ID are
|
||||
/// not allowed. Any responder receiving a GET command sent to this Sub-Device
|
||||
/// ID shall respond with a NACK with a NACK Reason Code of
|
||||
/// NR_SUB_DEVICE_OUT_OF_RANGE.
|
||||
if (call->mdb.cc == GET_COMMAND)
|
||||
if (command->mdb.cc == GET_COMMAND)
|
||||
return response->nak(NR_SUB_DEVICE_OUT_OF_RANGE);
|
||||
|
||||
response->do_not_send = true;
|
||||
|
@ -192,8 +192,8 @@ void Device::dispatch(MsgPair msg)
|
|||
return;
|
||||
}
|
||||
|
||||
if (sub_devices_.count(call->subDevice))
|
||||
return sub_devices_.at(call->subDevice)->dispatch(msg);
|
||||
if (sub_devices_.count(command->subDevice))
|
||||
return sub_devices_.at(command->subDevice)->dispatch(msg);
|
||||
|
||||
response->nak(NR_SUB_DEVICE_OUT_OF_RANGE);
|
||||
}
|
||||
|
|
|
@ -36,27 +36,18 @@ namespace RDM {
|
|||
/// The version of this standard is 1.0
|
||||
static const uint16_t RDM_PROTOCOL_VERSION = 0x0100;
|
||||
|
||||
const size_t MESSAGE_MINIMUM_LENGTH = 24; //!< 6.2.3 Message Length, 0 PDL
|
||||
|
||||
// Appendix A: Defined Parameters (Normative)
|
||||
|
||||
// START Codes (Slot 0)
|
||||
|
||||
static const uint8_t SC_RDM = 0xCC;
|
||||
|
||||
|
||||
// RDM Protocol Data Structure ID’s (Slot 1)
|
||||
|
||||
static const uint8_t SC_SUB_MESSAGE = 0x01;
|
||||
|
||||
|
||||
static const uint8_t SC_RDM = 0xCC; //!< START Codes (Slot 0)
|
||||
static const uint8_t SC_SUB_MESSAGE = 0x01; //!< RDM Protocol Data Structure ID’s (Slot 1)
|
||||
// Broadcast Device UID’s
|
||||
|
||||
static const uint64_t BROADCAST_ALL_DEVICES_ID = 0xFFFFFFFFFFFF; //!< Broadcast all Manufacturers
|
||||
static const uint64_t ALL_DEVICE_ID_MASK = 0x0000FFFFFFFF; //!< Specific Manufacturer ID in hight 2 bytes
|
||||
static const uint16_t SUB_DEVICE_ALL_CALL = 0xFFFF;
|
||||
static const uint64_t ALL_DEVICE_ID_MASK = 0x0000FFFFFFFF; //!< Specific Manufacturer ID in high 2 bytes
|
||||
static const uint16_t SUB_DEVICE_ALL_CALL = 0xFFFF; //!< all sub-devices
|
||||
|
||||
|
||||
// Table A-1: Command Class Defines (Slot 20)
|
||||
|
||||
static const uint8_t DISCOVERY_COMMAND = 0x10;
|
||||
static const uint8_t DISCOVERY_COMMAND_RESPONSE = 0x11;
|
||||
static const uint8_t GET_COMMAND = 0x20;
|
||||
|
@ -66,7 +57,6 @@ namespace RDM {
|
|||
|
||||
|
||||
// Table A-2: Response Type Defines (Slot 16)
|
||||
|
||||
static const uint8_t RESPONSE_TYPE_ACK = 0x00;
|
||||
static const uint8_t RESPONSE_TYPE_ACK_TIMER = 0x01;
|
||||
static const uint8_t RESPONSE_TYPE_NACK_REASON = 0x02; //!< See Table A-17
|
||||
|
|
Loading…
Reference in New Issue