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

Overview

An RDM response received over RDMnet and delivered to an RDMnet callback function.

Not valid for use other than as a parameter to an RDMnet callback function; use RdmResponse::Save() to create a copyable version.

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

Public Member Functions

 RdmResponse ()=delete
 Not default-constructible.
 
 RdmResponse (const RdmResponse &other)=delete
 Not copyable - use Save() to create a copyable version.
 
RdmResponseoperator= (const RdmResponse &other)=delete
 Not copyable - use Save() to create a copyable version.
 
constexpr RdmResponse (const RdmnetRdmResponse &c_resp) noexcept
 Construct a RdmResponse copied from an instance of the C RdmnetRdmResponse type.
 
constexpr rdm::Uid rdmnet_source_uid () const noexcept
 Get the UID of the RDMnet component that sent this response.
 
constexpr uint16_t source_endpoint () const noexcept
 Get the endpoint from which this response was sent.
 
constexpr uint32_t seq_num () const noexcept
 Get the RDMnet sequence number of this response, for matching with a corresponding command.
 
constexpr rdm::Uid original_cmd_source_uid () const noexcept
 Get the RDM source UID of the original RDM command, if available. More...
 
constexpr rdm::Uid original_cmd_dest_uid () const noexcept
 Get the RDM destination UID of the original RDM command, if available. More...
 
constexpr rdm::CommandHeader original_cmd_header () const noexcept
 Get the RDM protocol header of the original RDM command, if available. More...
 
constexpr const uint8_t * original_cmd_data () const noexcept
 Get the RDM parameter data of the original RDM command, if available. More...
 
constexpr uint8_t original_cmd_data_len () const noexcept
 Get the length of the RDM parameter data accompanying the original RDM command, if available. More...
 
constexpr rdm::Uid rdm_source_uid () const noexcept
 Get the UID of the RDM responder that sent this response.
 
constexpr rdm::Uid rdm_dest_uid () const noexcept
 Get the UID of the RDM controller to which this response is addressed.
 
constexpr rdm_response_type_t response_type () const noexcept
 Get the RDM response type of this response.
 
constexpr uint16_t subdevice () const noexcept
 Get the RDM subdevice from which this response originated (0 means the root device).
 
constexpr rdm_command_class_t command_class () const noexcept
 Get the RDM response class of this response.
 
constexpr uint16_t param_id () const noexcept
 Get the RDM parameter ID (PID) of this response.
 
constexpr rdm::ResponseHeader rdm_header () const noexcept
 Get the RDM protocol header contained within this response.
 
constexpr const uint8_t * data () const noexcept
 Get a pointer to the RDM parameter data buffer contained within this response.
 
constexpr size_t data_len () const noexcept
 Get the length of the RDM parameter data contained within this response.
 
constexpr bool more_coming () const noexcept
 This message contains partial RDM data. More...
 
constexpr bool OriginalCommandIncluded () const noexcept
 Whether the original RDM command is included. More...
 
constexpr bool HasData () const noexcept
 Whether this RDM response includes any RDM parameter data.
 
constexpr bool IsFromDefaultResponder () const noexcept
 Whether this RDM response is from a default responder. More...
 
constexpr bool IsResponseToMe () const noexcept
 Whether the response was sent in response to a command previously sent by this controller. More...
 
constexpr bool IsAck () const noexcept
 Whether this command has an RDM response type of ACK. More...
 
constexpr bool IsNack () const noexcept
 Whether this command has an RDM response type of NACK_REASON. More...
 
constexpr bool IsGetResponse () const noexcept
 Whether this response is an RDM GET response.
 
constexpr 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 RdmResponse. More...
 
std::vector< uint8_t > GetOriginalCmdData () const
 Copy out the original RDM command data in a RdmResponse. More...
 
constexpr const RdmnetRdmResponseget () const noexcept
 Get a const reference to the underlying C type.
 
rdm::Command OriginalCommandToRdm () const
 Convert the original RDM command associated with this response to an RDM command type. More...
 
rdm::Response ToRdm () const
 Convert the RDM data in this response to an RDM response type.
 
SavedRdmResponse Save () const
 Save the data in this response for later use from a different context. More...
 

Member Function Documentation

◆ GetData()

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

Copy out the data in a RdmResponse.

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

◆ GetNackReason()

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

Get the NACK reason code of this RDM response.

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

◆ GetOriginalCmdData()

std::vector< uint8_t > rdmnet::RdmResponse::GetOriginalCmdData ( ) const
inline

Copy out the original RDM command data in a RdmResponse.

Returns
A copied vector containing the parameter data associated with the original RDM command that generated this response.

◆ IsAck()

constexpr bool rdmnet::RdmResponse::IsAck ( ) const
constexprnoexcept

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()

constexpr bool rdmnet::RdmResponse::IsFromDefaultResponder ( ) const
constexprnoexcept

Whether this RDM response is from a default responder.

See Devices and Gateways for more information.

◆ IsNack()

constexpr bool rdmnet::RdmResponse::IsNack ( ) const
constexprnoexcept

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()

constexpr bool rdmnet::RdmResponse::IsResponseToMe ( ) const
constexprnoexcept

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.

◆ more_coming()

constexpr bool rdmnet::RdmResponse::more_coming ( ) const
constexprnoexcept

This message contains partial RDM data.

This can be set when the library runs out of static memory in which to store RDM response data and must deliver a partial data buffer before continuing (this only applies to the data buffer within the RDM response). The application should store the partial data but should not act on it until another RdmResponse is received with more_coming set to false.

◆ original_cmd_data()

constexpr const uint8_t * rdmnet::RdmResponse::original_cmd_data ( ) const
constexprnoexcept

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()

constexpr uint8_t rdmnet::RdmResponse::original_cmd_data_len ( ) const
constexprnoexcept

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()

constexpr rdm::Uid rdmnet::RdmResponse::original_cmd_dest_uid ( ) const
constexprnoexcept

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()

constexpr rdm::CommandHeader rdmnet::RdmResponse::original_cmd_header ( ) const
constexprnoexcept

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()

constexpr rdm::Uid rdmnet::RdmResponse::original_cmd_source_uid ( ) const
constexprnoexcept

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()

constexpr bool rdmnet::RdmResponse::OriginalCommandIncluded ( ) const
constexprnoexcept

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.

◆ OriginalCommandToRdm()

rdm::Command rdmnet::RdmResponse::OriginalCommandToRdm ( ) const
inline

Convert the original RDM command associated with this response to an RDM command type.

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

◆ Save()

SavedRdmResponse rdmnet::RdmResponse::Save ( ) const
inline

Save the data in this response for later use from a different context.

Returns
A SavedRdmResponse containing the copied data.

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