23 #ifndef RDMNET_CPP_MESSAGE_TYPES_RDM_COMMAND_H_
24 #define RDMNET_CPP_MESSAGE_TYPES_RDM_COMMAND_H_
27 #include "etcpal/common.h"
28 #include "rdm/cpp/message.h"
29 #include "rdm/cpp/uid.h"
30 #include "rdmnet/defs.h"
35 class SavedRdmCommand;
56 constexpr uint32_t
seq_num() const noexcept;
60 constexpr uint16_t
subdevice() const noexcept;
62 constexpr uint16_t
param_id() const noexcept;
64 constexpr rdm::CommandHeader
rdm_header() const noexcept;
66 constexpr const uint8_t*
data() const noexcept;
67 constexpr uint8_t
data_len() const noexcept;
69 constexpr
bool HasData() const noexcept;
72 constexpr
bool IsGet() const noexcept;
73 constexpr
bool IsSet() const noexcept;
77 rdm::Command
ToRdm() const;
98 constexpr uint32_t
seq_num() const noexcept;
102 constexpr uint16_t
subdevice() const noexcept;
103 constexpr rdm_command_class_t
command_class() const noexcept;
104 constexpr uint16_t
param_id() const noexcept;
106 constexpr rdm::CommandHeader
rdm_header() const noexcept;
108 constexpr const uint8_t*
data() const noexcept;
109 constexpr uint8_t
data_len() const noexcept;
111 bool IsValid() const noexcept;
112 constexpr
bool HasData() const noexcept;
115 constexpr
bool IsGet() const noexcept;
116 constexpr
bool IsSet() const noexcept;
121 rdm::Command
ToRdm() const;
211 return (cmd_.
rdm_header.command_class == kRdmCCGetCommand);
217 return (cmd_.
rdm_header.command_class == kRdmCCSetCommand);
345 return rdm_command_header_is_valid(&cmd_.
rdm_header);
364 return (cmd_.
rdm_header.command_class == kRdmCCGetCommand);
370 return (cmd_.
rdm_header.command_class == kRdmCCSetCommand);
An RDM command received over RDMnet and delivered to an RDMnet callback function.
Definition: rdm_command.h:43
constexpr bool IsGet() const noexcept
Whether this command is an RDM GET command.
Definition: rdm_command.h:209
RdmCommand()=delete
Not default-constructible.
constexpr const uint8_t * data() const noexcept
Get a pointer to the RDM parameter data buffer contained within this command.
Definition: rdm_command.h:191
constexpr bool HasData() const noexcept
Whether this command has any associated RDM parameter data.
Definition: rdm_command.h:203
constexpr rdm_command_class_t command_class() const noexcept
Get the RDM command class of this command.
Definition: rdm_command.h:173
constexpr bool IsToDefaultResponder() const noexcept
Whether this command is addressed to the RDMnet default responder.
Definition: rdm_command.h:222
RdmCommand & operator=(const RdmCommand &other)=delete
Not copyable - use Save() to create a copyable version.
rdm::Command ToRdm() const
Convert the RDM data in this command to an RDM command type.
Definition: rdm_command.h:234
constexpr uint16_t dest_endpoint() const noexcept
Get the endpoint to which this command is addressed.
Definition: rdm_command.h:143
constexpr rdm::Uid rdm_dest_uid() const noexcept
Get the UID of the RDM responder to which this command is addressed.
Definition: rdm_command.h:161
SavedRdmCommand Save() const
Save the data in this command for later use with API functions from a different context.
Definition: rdm_command.h:241
constexpr uint8_t data_len() const noexcept
Get the length of the RDM parameter data contained within this command.
Definition: rdm_command.h:197
constexpr uint32_t seq_num() const noexcept
Get the RDMnet sequence number of this command.
Definition: rdm_command.h:149
constexpr rdm::Uid rdmnet_source_uid() const noexcept
Get the UID of the RDMnet controller that sent this command.
Definition: rdm_command.h:137
constexpr bool IsSet() const noexcept
Whether this command is an RDM SET command.
Definition: rdm_command.h:215
RdmCommand(const RdmCommand &other)=delete
Not copyable - use Save() to create a copyable version.
constexpr uint16_t subdevice() const noexcept
Get the RDM subdevice to which this command is addressed (0 means the root device).
Definition: rdm_command.h:167
constexpr const RdmnetRdmCommand & get() const noexcept
Get a const reference to the underlying C type.
Definition: rdm_command.h:228
constexpr uint16_t param_id() const noexcept
Get the RDM parameter ID (PID) of this command.
Definition: rdm_command.h:179
constexpr rdm::CommandHeader rdm_header() const noexcept
Get the RDM protocol header contained within this command.
Definition: rdm_command.h:185
constexpr rdm::Uid rdm_source_uid() const noexcept
Get the UID of the RDM controller that has sent this command.
Definition: rdm_command.h:155
An RDM command received over RDMnet by a local component and saved for a later response.
Definition: rdm_command.h:87
constexpr bool IsGet() const noexcept
Whether this command is an RDM GET command.
Definition: rdm_command.h:362
SavedRdmCommand & operator=(const RdmnetSavedRdmCommand &c_cmd) noexcept
Assign an instance of the C RdmnetSavedRdmCommand type to an instance of this class.
Definition: rdm_command.h:256
constexpr const uint8_t * data() const noexcept
Get a pointer to the RDM parameter data buffer contained within this command.
Definition: rdm_command.h:330
ETCPAL_CONSTEXPR_14 RdmnetSavedRdmCommand & get() noexcept
Get a mutable reference to the underlying C type.
Definition: rdm_command.h:374
bool IsValid() const noexcept
Whether the values contained in this command are valid for an RDM command.
Definition: rdm_command.h:343
constexpr bool HasData() const noexcept
Whether this command has any associated RDM parameter data.
Definition: rdm_command.h:349
constexpr rdm_command_class_t command_class() const noexcept
Get the RDM command class of this command.
Definition: rdm_command.h:312
constexpr bool IsToDefaultResponder() const noexcept
Whether this command is addressed to the RDMnet default responder.
Definition: rdm_command.h:356
SavedRdmCommand()=default
Construct an empty, invalid SavedRdmCommand by default.
rdm::Command ToRdm() const
Convert the RDM data in this command to an RDM command type.
Definition: rdm_command.h:386
constexpr uint16_t dest_endpoint() const noexcept
Get the endpoint to which this command is addressed.
Definition: rdm_command.h:282
constexpr rdm::Uid rdm_dest_uid() const noexcept
Get the UID of the RDM responder to which this command is addressed.
Definition: rdm_command.h:300
constexpr uint8_t data_len() const noexcept
Get the length of the RDM parameter data contained within this command.
Definition: rdm_command.h:336
constexpr uint32_t seq_num() const noexcept
Get the RDMnet sequence number of this command.
Definition: rdm_command.h:288
constexpr rdm::Uid rdmnet_source_uid() const noexcept
Get the UID of the RDMnet controller that sent this command.
Definition: rdm_command.h:276
constexpr bool IsSet() const noexcept
Whether this command is an RDM SET command.
Definition: rdm_command.h:368
constexpr uint16_t subdevice() const noexcept
Get the RDM subdevice to which this command is addressed (0 means the root device).
Definition: rdm_command.h:306
constexpr uint16_t param_id() const noexcept
Get the RDM parameter ID (PID) of this command.
Definition: rdm_command.h:318
constexpr rdm::CommandHeader rdm_header() const noexcept
Get the RDM protocol header contained within this command.
Definition: rdm_command.h:324
constexpr rdm::Uid rdm_source_uid() const noexcept
Get the UID of the RDM controller that sent this command.
Definition: rdm_command.h:294
#define ETCPAL_CONSTEXPR_14_OR_INLINE
etcpal_error_t rdmnet_save_rdm_command(const RdmnetRdmCommand *command, RdmnetSavedRdmCommand *saved_command)
Save the data in a received RDM command for later use with API functions from a different context.
Definition: message.c:70
Basic types for parsed RDMnet messages.
A namespace which contains all C++ language definitions in the RDMnet library.
Definition: broker.h:45
const uint8_t * data
Definition: message.h:64
uint32_t seq_num
Definition: message.h:60
RdmUid rdmnet_source_uid
Definition: message.h:56
RdmCommandHeader rdm_header
Definition: message.h:62
uint8_t data_len
Definition: message.h:66
uint16_t dest_endpoint
Definition: message.h:58