23 #ifndef RDMNET_CPP_MESSAGE_TYPES_LLRP_RDM_RESPONSE_H_
24 #define RDMNET_CPP_MESSAGE_TYPES_LLRP_RDM_RESPONSE_H_
29 #include "rdm/cpp/message.h"
30 #include "rdm/cpp/uid.h"
37 class SavedRdmResponse;
57 constexpr uint32_t
seq_num() const noexcept;
59 constexpr rdm::Uid
source_uid() const noexcept;
60 constexpr rdm::Uid
dest_uid() const noexcept;
62 constexpr uint16_t
subdevice() const noexcept;
64 constexpr uint16_t
param_id() const noexcept;
65 constexpr rdm::ResponseHeader
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;
71 constexpr
bool IsAck() const noexcept;
72 constexpr
bool IsNack() const noexcept;
81 rdm::Response
ToRdm() const;
105 uint32_t
seq_num() const noexcept;
113 const rdm::ResponseHeader&
rdm_header() const noexcept;
114 const uint8_t*
data() const noexcept;
116 const rdm::Response& rdm() const noexcept;
118 bool IsValid() const noexcept;
121 bool IsAck() const noexcept;
122 bool IsNack() const noexcept;
147 return resp_.source_cid;
153 return resp_.seq_num;
159 return resp_.rdm_header.source_uid;
165 return resp_.rdm_header.dest_uid;
171 return resp_.rdm_header.resp_type;
177 return resp_.rdm_header.subdevice;
183 return resp_.rdm_header.command_class;
189 return resp_.rdm_header.param_id;
195 return resp_.rdm_header;
201 return resp_.rdm_data;
207 return resp_.rdm_data_len;
222 return (resp_.rdm_header.resp_type == kRdmResponseTypeAck);
231 return (resp_.rdm_header.resp_type == kRdmResponseTypeNackReason);
237 return (resp_.rdm_header.command_class == kRdmCCGetCommandResponse);
243 return (resp_.rdm_header.command_class == kRdmCCSetCommandResponse);
266 return rdm::Response(resp_.rdm_header, resp_.rdm_data, resp_.rdm_data_len);
284 , rdm_(c_resp.
rdm_header, c_resp.rdm_data, c_resp.rdm_data_len)
299 : source_cid_(resp.source_cid()), seq_num_(resp.seq_num()), rdm_(resp.ToRdm())
327 return rdm_.source_uid();
333 return rdm_.dest_uid();
339 return rdm_.response_type();
345 return rdm_.subdevice();
351 return rdm_.command_class();
357 return rdm_.param_id();
363 return rdm_.header();
375 return static_cast<uint8_t
>(rdm_.data_len());
388 return rdm_.IsValid();
394 return rdm_.HasData();
412 return rdm_.IsNack();
418 return rdm_.IsGetResponse();
424 return rdm_.IsSetResponse();
432 return rdm_.GetNackReason();
An RDM response received over LLRP and delivered to an RDMnet callback function.
Definition: llrp_rdm_response.h:45
RdmResponse & operator=(const RdmResponse &other)=delete
Not copyable - use Save() to create a copyable version.
constexpr rdm::ResponseHeader rdm_header() const noexcept
Get the RDM protocol header contained within this response.
Definition: llrp_rdm_response.h:193
constexpr uint16_t param_id() const noexcept
Get the RDM parameter ID (PID) of this response.
Definition: llrp_rdm_response.h:187
constexpr bool IsNack() const noexcept
Whether this response has an RDM response type of NACK_REASON.
Definition: llrp_rdm_response.h:229
constexpr etcpal::Uuid source_cid() const noexcept
Get the CID of the LLRP target that sent this response.
Definition: llrp_rdm_response.h:145
constexpr uint8_t data_len() const noexcept
Get the length of the RDM parameter data contained within this response.
Definition: llrp_rdm_response.h:205
rdm::Response ToRdm() const
Convert the RDM data in this response to an RDM response type.
Definition: llrp_rdm_response.h:264
constexpr bool IsAck() const noexcept
Whether this response has an RDM response type of ACK.
Definition: llrp_rdm_response.h:220
constexpr rdm_command_class_t command_class() const noexcept
Get the RDM response class of this response.
Definition: llrp_rdm_response.h:181
constexpr const uint8_t * data() const noexcept
Get a pointer to the RDM parameter data buffer contained within this response.
Definition: llrp_rdm_response.h:199
constexpr rdm::Uid source_uid() const noexcept
Get the UID of the LLRP target that sent this response.
Definition: llrp_rdm_response.h:157
SavedRdmResponse Save() const
Save the data in this response for later use from a different context.
Definition: llrp_rdm_response.h:271
constexpr rdm_response_type_t response_type() const noexcept
Get the RDM response type of this response.
Definition: llrp_rdm_response.h:169
constexpr uint16_t subdevice() const noexcept
Get the RDM subdevice from which this response originated (0 means the root device).
Definition: llrp_rdm_response.h:175
RdmResponse()=delete
Not default-constructible.
constexpr uint32_t seq_num() const noexcept
Get the LLRP sequence number of this response, for matching with a corresponding command.
Definition: llrp_rdm_response.h:151
constexpr rdm::Uid dest_uid() const noexcept
Get the UID of the LLRP manager to which this response is addressed.
Definition: llrp_rdm_response.h:163
constexpr bool IsSetResponse() const noexcept
Whether this response is an RDM SET response.
Definition: llrp_rdm_response.h:241
RdmResponse(const RdmResponse &other)=delete
Not copyable - use Save() to create a copyable version.
constexpr bool HasData() const noexcept
Whether this RDM response includes any RDM parameter data.
Definition: llrp_rdm_response.h:211
constexpr const LlrpRdmResponse & get() const noexcept
Get a const reference to the underlying C type.
Definition: llrp_rdm_response.h:258
etcpal::Expected< rdm::NackReason > GetNackReason() const noexcept
Get the NACK reason code of this RDM response.
Definition: llrp_rdm_response.h:249
constexpr bool IsGetResponse() const noexcept
Whether this response is an RDM GET response.
Definition: llrp_rdm_response.h:235
An RDM response received over LLRP and saved for later processing.
Definition: llrp_rdm_response.h:95
bool HasData() const noexcept
Whether this RDM response includes any RDM parameter data.
Definition: llrp_rdm_response.h:392
const etcpal::Uuid & source_cid() const noexcept
Get the CID of the LLRP target that sent this response.
Definition: llrp_rdm_response.h:313
bool IsSetResponse() const noexcept
Whether this response is an RDM SET response.
Definition: llrp_rdm_response.h:422
bool IsAck() const noexcept
Whether this response has an RDM response type of ACK.
Definition: llrp_rdm_response.h:401
uint16_t subdevice() const noexcept
Get the RDM subdevice from which this response originated (0 means the root device).
Definition: llrp_rdm_response.h:343
etcpal::Expected< rdm::NackReason > GetNackReason() const noexcept
Get the NACK reason code of this RDM response.
Definition: llrp_rdm_response.h:430
const rdm::Response & rdm() const noexcept
Get the RDM data in this response as an RDM response type.
Definition: llrp_rdm_response.h:379
bool IsValid() const noexcept
Whether the values contained in this response are valid for an RDM response.
Definition: llrp_rdm_response.h:386
const rdm::ResponseHeader & rdm_header() const noexcept
Get the RDM protocol header contained within this response.
Definition: llrp_rdm_response.h:361
uint32_t seq_num() const noexcept
Get the LLRP sequence number of this response, for matching with a corresponding command.
Definition: llrp_rdm_response.h:319
SavedRdmResponse & operator=(const LlrpSavedRdmResponse &c_resp)
Assign an instance of the C LlrpSavedRdmResponse type to an instance of this class.
Definition: llrp_rdm_response.h:289
rdm_response_type_t response_type() const noexcept
Get the RDM response type of this response.
Definition: llrp_rdm_response.h:337
rdm::Uid dest_uid() const noexcept
Get the UID of the LLRP manager to which this response is addressed.
Definition: llrp_rdm_response.h:331
uint8_t data_len() const noexcept
Get the length of the RDM parameter data contained within this response.
Definition: llrp_rdm_response.h:373
rdm_command_class_t command_class() const noexcept
Get the RDM response class of this response.
Definition: llrp_rdm_response.h:349
bool IsGetResponse() const noexcept
Whether this response is an RDM GET response.
Definition: llrp_rdm_response.h:416
uint16_t param_id() const noexcept
Get the RDM parameter ID (PID) of this response.
Definition: llrp_rdm_response.h:355
rdm::Uid source_uid() const noexcept
Get the UID of the LLRP target that sent this response.
Definition: llrp_rdm_response.h:325
SavedRdmResponse()=default
Constructs an empty, invalid RDM response by default.
bool IsNack() const noexcept
Whether this response has an RDM response type of NACK_REASON.
Definition: llrp_rdm_response.h:410
const uint8_t * data() const noexcept
Get a pointer to the RDM parameter data buffer contained within this response.
Definition: llrp_rdm_response.h:367
uint16_t etcpal_unpack_u16b(const uint8_t *buf)
Basic types for parsed RDMnet messages.
A namespace which contains all C++ language definitions in the RDMnet library.
Definition: broker.h:45
An RDM response received from a remote LLRP Target.
Definition: message.h:479
An RDM command received from a remote LLRP Manager.
Definition: message.h:494
uint32_t seq_num
The sequence number of this response (to be associated with a previously-sent command).
Definition: message.h:498
uint8_t rdm_data_len
The length of the parameter data associated with the RDM response.
Definition: message.h:504
uint8_t rdm_data[RDM_MAX_PDL]
Any parameter data associated with the RDM response.
Definition: message.h:502
EtcPalUuid source_cid
The CID of the LLRP Target from which this command was received.
Definition: message.h:496
RdmResponseHeader rdm_header
The header information from the encapsulated RDM response.
Definition: message.h:500