RDMnet  0.3.0
Implementation of ANSI E1.33 (RDMnet)
View other versions:
rdmnet::SavedRdmResponse Class Reference

Overview

An RDM response received over RDMnet and saved for later processing.

This type is not used by the library API, but can come in handy if an application wants to queue or copy RDM responses before acting on them. This type does heap allocation to hold the response parameter data.

#include <rdmnet/cpp/message_types/rdm_response.h>

Public Member Functions

 SavedRdmResponse ()=default
 Constructs an empty, invalid RDM response by default.
 
 SavedRdmResponse (const RdmnetSavedRdmResponse &c_resp)
 Construct a SavedRdmResponse copied from an instance of the C RdmnetSavedRdmResponse type.
 
SavedRdmResponseoperator= (const RdmnetSavedRdmResponse &c_resp)
 Assign an instance of the C RdmnetSavedRdmResponse type to an instance of this class.
 
 SavedRdmResponse (const RdmResponse &resp)
 Construct a SavedRdmResponse from an RdmResponse.
 
SavedRdmResponseoperator= (const RdmResponse &resp)
 Assign an RdmResponse to an instance of this class.
 
const rdm::Uid & rdmnet_source_uid () const noexcept
 Get the UID of the RDMnet component that sent this response.
 
uint16_t source_endpoint () const noexcept
 Get the endpoint from which this response was sent.
 
uint32_t seq_num () const noexcept
 Get the RDMnet sequence number of this response, for matching with a corresponding command.
 
rdm::Uid original_cmd_source_uid () const noexcept
 Get the RDM source UID of the original RDM command, if available. More...
 
rdm::Uid original_cmd_dest_uid () const noexcept
 Get the RDM destination UID of the original RDM command, if available. More...
 
const rdm::CommandHeader & original_cmd_header () const noexcept
 Get the RDM protocol header of the original RDM command, if available. More...
 
const uint8_t * original_cmd_data () const noexcept
 Get the RDM parameter data of the original RDM command, if available. More...
 
uint8_t original_cmd_data_len () const noexcept
 Get the length of the RDM parameter data accompanying the original RDM command, if available. More...
 
const rdm::Command & original_cmd () const noexcept
 Get the original RDM command that resulted in this RDM response, if available. More...
 
rdm::Uid rdm_source_uid () const noexcept
 Get the UID of the RDM responder that sent this response.
 
rdm::Uid rdm_dest_uid () const noexcept
 Get the UID of the RDM controller to which this response is addressed.
 
rdm_response_type_t response_type () const noexcept
 Get the RDM response type of this response.
 
uint16_t subdevice () const noexcept
 Get the RDM subdevice from which this response originated (0 means the root device).
 
rdm_command_class_t command_class () const noexcept
 Get the RDM response class of this response.
 
uint16_t param_id () const noexcept
 Get the RDM parameter ID (PID) of this response.
 
const rdm::ResponseHeader & rdm_header () const noexcept
 Get the RDM protocol header contained within this response.
 
const uint8_t * data () const noexcept
 Get a pointer to the RDM parameter data buffer contained within this response.
 
size_t data_len () const noexcept
 Get the length of the RDM parameter data contained within this response.
 
const rdm::Response & rdm () const noexcept
 Get the RDM data in this response as an RDM response type.
 
bool IsValid () const noexcept
 Whether the values contained in this response are valid for an RDM response. More...
 
bool OriginalCommandIncluded () const noexcept
 Whether the original RDM command is included. More...
 
bool HasData () const noexcept
 Whether this RDM response includes any RDM parameter data.
 
bool IsFromDefaultResponder () const noexcept
 Whether this RDM response is from a default responder. More...
 
bool IsResponseToMe () const noexcept
 Whether the response was sent in response to a command previously sent by this controller. More...
 
bool IsAck () const noexcept
 Whether this command has an RDM response type of ACK. More...
 
bool IsNack () const noexcept
 Whether this command has an RDM response type of NACK_REASON. More...
 
bool IsGetResponse () const noexcept
 Whether this response is an RDM GET response.
 
bool IsSetResponse () const noexcept
 Whether this response is an RDM SET response.
 
etcpal::Expected< rdm::NackReason > GetNackReason () const noexcept
 Get the NACK reason code of this RDM response. More...
 
std::vector< uint8_t > GetData () const
 Copy out the data in a SavedRdmResponse. More...
 
void AppendData (const RdmResponse &new_resp)
 Append more data to this response's parameter data. More...
 
void AppendData (const uint8_t *data, size_t size)
 Append more data to this response's parameter data. More...
 

Member Function Documentation

◆ AppendData() [1/2]

void rdmnet::SavedRdmResponse::AppendData ( const RdmResponse new_resp)
inline

Append more data to this response's parameter data.

Parameters
new_respAn RdmResponse delivered to an RDMnet callback function as a continuation of a previous response.

◆ AppendData() [2/2]

void rdmnet::SavedRdmResponse::AppendData ( const uint8_t *  data,
size_t  data_len 
)
inline

Append more data to this response's parameter data.

Parameters
dataPointer to data buffer to append.
data_lenSize of data buffer to append.

◆ GetData()

std::vector< uint8_t > rdmnet::SavedRdmResponse::GetData ( ) const
inline

Copy out the data in a SavedRdmResponse.

Returns
A copied vector containing any parameter data associated with this response.

◆ GetNackReason()

etcpal::Expected< rdm::NackReason > rdmnet::SavedRdmResponse::GetNackReason ( ) const
inlinenoexcept

Get the NACK reason code of this RDM response.

Returns
If IsNack(), the valid NackReason instance.
If !IsNack(), kEtcPalErrInvalid.

◆ IsAck()

bool rdmnet::SavedRdmResponse::IsAck ( ) const
inlinenoexcept

Whether this command has an RDM response type of ACK.

If this is false, it implies that IsNack() is true (ACK_TIMER is not allowed in RDMnet, and the library recombines ACK_OVERFLOW responses automatically).

◆ IsFromDefaultResponder()

bool rdmnet::SavedRdmResponse::IsFromDefaultResponder ( ) const
inlinenoexcept

Whether this RDM response is from a default responder.

See Devices and Gateways for more information.

◆ IsNack()

bool rdmnet::SavedRdmResponse::IsNack ( ) const
inlinenoexcept

Whether this command has an RDM response type of NACK_REASON.

If this is false, it implies that IsAck() is true (ACK_TIMER is not allowed in RDMnet, and the library recombines ACK_OVERFLOW responses automatically).

◆ IsResponseToMe()

bool rdmnet::SavedRdmResponse::IsResponseToMe ( ) const
inlinenoexcept

Whether the response was sent in response to a command previously sent by this controller.

If this is false, the command was a broadcast sent to all controllers.

◆ IsValid()

bool rdmnet::SavedRdmResponse::IsValid ( ) const
inlinenoexcept

Whether the values contained in this response are valid for an RDM response.

In particular, a default-constructed SavedRdmResponse is not valid.

◆ original_cmd()

const rdm::Command & rdmnet::SavedRdmResponse::original_cmd ( ) const
inlinenoexcept

Get the original RDM command that resulted in this RDM response, if available.

Returns
If OriginalCommandIncluded(), the valid RDM command. return If !OriginalCommandIncluded(), an empty/invalid RDM command.

◆ original_cmd_data()

const uint8_t * rdmnet::SavedRdmResponse::original_cmd_data ( ) const
inlinenoexcept

Get the RDM parameter data of the original RDM command, if available.

Returns
If OriginalCommandIncluded(), the valid RDM parameter data.
If !OriginalCommandIncluded(), nullptr.

◆ original_cmd_data_len()

uint8_t rdmnet::SavedRdmResponse::original_cmd_data_len ( ) const
inlinenoexcept

Get the length of the RDM parameter data accompanying the original RDM command, if available.

Returns
If OriginalCommandIncluded(), the valid length.
If !OriginalCommandIncluded(), 0.

◆ original_cmd_dest_uid()

rdm::Uid rdmnet::SavedRdmResponse::original_cmd_dest_uid ( ) const
inlinenoexcept

Get the RDM destination UID of the original RDM command, if available.

Returns
If OriginalCommandIncluded(), the valid RDM destination UID.
If !OriginalCommandIncluded(), an empty/invalid RDM UID.

◆ original_cmd_header()

const rdm::CommandHeader & rdmnet::SavedRdmResponse::original_cmd_header ( ) const
inlinenoexcept

Get the RDM protocol header of the original RDM command, if available.

Returns
If OriginalCommandIncluded(), the valid RDM header.
If !OriginalCommandIncluded(), an empty/invalid RDM header.

◆ original_cmd_source_uid()

rdm::Uid rdmnet::SavedRdmResponse::original_cmd_source_uid ( ) const
inlinenoexcept

Get the RDM source UID of the original RDM command, if available.

Returns
If OriginalCommandIncluded(), the valid RDM source UID.
If !OriginalCommandIncluded(), an empty/invalid RDM UID.

◆ OriginalCommandIncluded()

bool rdmnet::SavedRdmResponse::OriginalCommandIncluded ( ) const
inlinenoexcept

Whether the original RDM command is included.

In RDMnet, a response to an RDM command includes the original command data. An exception to this rule is unsolicited RDM responses, which are not in response to a command and thus do not include the original command data.


The documentation for this class was generated from the following file: