Open Lighting Architecture  Latest Git
Files | Classes | Typedefs | Functions
RDM Messages

Detailed Description

Construct and dissect RDM messages.

Collaboration diagram for RDM Messages:

Files

file  RDMCommand.cpp
 
file  MessageDeserializer.h
 Inflate a message from raw data.
 
file  MessageSerializer.h
 Serialize an RDM message.
 
file  RDMCommand.h
 Classes that represent RDM commands.
 
file  RDMCommandSerializer.h
 Write RDMCommands to a memory buffer.
 

Classes

class  ola::rdm::RDMCommand
 The base class that all RDM requests & responses inherit from. More...
 
class  ola::rdm::RDMRequest
 RDM Commands that represent requests (GET, SET or DISCOVER). More...
 
class  ola::rdm::RDMGetSetRequest
 An RDM Get / Set Request. More...
 
class  ola::rdm::BaseRDMRequest< command_class >
 
class  ola::rdm::RDMResponse
 An RDM Command that represents responses (GET, SET or DISCOVER). More...
 
class  ola::rdm::RDMGetSetResponse
 The base class for GET/SET responses. More...
 
class  ola::rdm::BaseRDMResponse< command_class >
 
class  ola::rdm::RDMDiscoveryRequest
 An RDM request of type DISCOVER_COMMAND. More...
 
class  ola::rdm::RDMDiscoveryResponse
 An RDM response of type DISCOVER_COMMAND. More...
 

Typedefs

typedef BaseRDMRequest< RDMCommand::GET_COMMANDola::rdm::RDMGetRequest
 
typedef BaseRDMRequest< RDMCommand::SET_COMMANDola::rdm::RDMSetRequest
 
typedef BaseRDMResponse< RDMCommand::GET_COMMAND_RESPONSEola::rdm::RDMGetResponse
 
typedef BaseRDMResponse< RDMCommand::SET_COMMAND_RESPONSEola::rdm::RDMSetResponse
 

Functions

RDMResponseola::rdm::NackWithReason (const RDMRequest *request, rdm_nack_reason reason, uint8_t outstanding_messages=0)
 Generate a NACK response with a reason code.
 
RDMResponseola::rdm::GetResponseFromData (const RDMRequest *request, const uint8_t *data=NULL, unsigned int length=0, rdm_response_type type=RDM_ACK, uint8_t outstanding_messages=0)
 Generate an ACK Response with some data.
 
RDMResponseola::rdm::GetResponseWithPid (const RDMRequest *request, uint16_t pid, const uint8_t *data, unsigned int length, uint8_t type=RDM_ACK, uint8_t outstanding_messages=0)
 Construct an RDM response from a RDMRequest object.
 
RDMDiscoveryRequestola::rdm::NewDiscoveryUniqueBranchRequest (const UID &source, const UID &lower, const UID &upper, uint8_t transaction_number, uint8_t port_id=1)
 Create a new DUB request object.
 
RDMDiscoveryRequestola::rdm::NewMuteRequest (const UID &source, const UID &destination, uint8_t transaction_number, uint8_t port_id=1)
 Create a new Mute Request Object.
 
RDMDiscoveryRequestola::rdm::NewUnMuteRequest (const UID &source, const UID &destination, uint8_t transaction_number, uint8_t port_id)
 
 ola::rdm::RDMCommand::RDMCommand (const UID &source, const UID &destination, uint8_t transaction_number, uint8_t port_id, uint8_t message_count, uint16_t sub_device, uint16_t param_id, const uint8_t *data, unsigned int length)
 Protected constructor for derived classes.
 
bool ola::rdm::RDMCommand::operator== (const RDMCommand &other) const
 Test for equality. More...
 
static RDMCommandola::rdm::RDMCommand::Inflate (const uint8_t *data, unsigned int length)
 Extract a RDMCommand from raw data. More...
 
void ola::rdm::RDMCommand::SetParamData (const uint8_t *data, unsigned int length)
 
static RDMStatusCode ola::rdm::RDMCommand::VerifyData (const uint8_t *data, size_t length, RDMCommandHeader *command_message)
 
static RDMCommandClass ola::rdm::RDMCommand::ConvertCommandClass (uint8_t command_type)
 
 ola::rdm::RDMRequest::RDMRequest (const UID &source, const UID &destination, uint8_t transaction_number, uint8_t port_id, uint16_t sub_device, RDMCommandClass command_class, uint16_t param_id, const uint8_t *data, unsigned int length, const OverrideOptions &options=OverrideOptions())
 Create a new request. More...
 
bool ola::rdm::RDMRequest::IsDUB () const
 Check if this is a DUB request. More...
 
uint8_t ola::rdm::RDMRequest::SubStartCode () const
 The Sub-Start code for the RDMCommand.
 
uint8_t ola::rdm::RDMRequest::MessageLength () const
 The Message length field.
 
uint16_t ola::rdm::RDMRequest::Checksum (uint16_t checksum) const
 Modify the calculated checksum for this command. More...
 
static RDMRequestola::rdm::RDMRequest::InflateFromData (const uint8_t *data, unsigned int length)
 Inflate a request from some data. More...
 
static RDMResponseola::rdm::RDMResponse::InflateFromData (const uint8_t *data, size_t length, RDMStatusCode *status_code, const RDMRequest *request=NULL)
 
static RDMResponseola::rdm::RDMResponse::CombineResponses (const RDMResponse *response1, const RDMResponse *response2)
 Combine two RDMResponses. More...
 
static RDMDiscoveryRequestola::rdm::RDMDiscoveryRequest::InflateFromData (const uint8_t *data, unsigned int length)
 Inflate a discovery request.
 
static RDMDiscoveryResponseola::rdm::RDMDiscoveryResponse::InflateFromData (const uint8_t *data, unsigned int length)
 

String Methods

std::string ola::rdm::RDMCommand::ToString () const
 Create a human readable string from the RDMCommand object. More...
 
std::ostream & ola::rdm::RDMCommand::operator<< (std::ostream &out, const RDMCommand &command)
 Output an RDMCommand object to an ostream. More...
 

Accessors

virtual uint8_t ola::rdm::RDMCommand::MessageLength () const
 The Message length field.
 

Function Documentation

◆ Checksum()

uint16_t ola::rdm::RDMRequest::Checksum ( uint16_t  checksum) const
virtual

Modify the calculated checksum for this command.

Parameters
checksumThe original calculated checksum of the command.
Returns
The new checksum to use for the command.

This can be used to generate commands with invalid checksums.

Reimplemented from ola::rdm::RDMCommand.

◆ CombineResponses()

RDMResponse * ola::rdm::RDMResponse::CombineResponses ( const RDMResponse response1,
const RDMResponse response2 
)
static

Combine two RDMResponses.

Parameters
response1the first response.
response2the second response.
Returns
A new response with the data from the first and second combined or NULL if the size limit is reached.

This is used to combine the data from two responses in an ACK_OVERFLOW session.

◆ Inflate()

RDMCommand * ola::rdm::RDMCommand::Inflate ( const uint8_t *  data,
unsigned int  length 
)
static

Extract a RDMCommand from raw data.

Parameters
dataThe data excluding the state code.
lengthThe length of the data.
Returns
NULL if the RDM command is invalid.

◆ InflateFromData() [1/3]

RDMRequest * ola::rdm::RDMRequest::InflateFromData ( const uint8_t *  data,
unsigned int  length 
)
static

Inflate a request from some data.

Parameters
dataThe raw data.
lengthThe length of the data.
Returns
A RDMRequest object or NULL if the data was invalid.

◆ InflateFromData() [2/3]

RDMResponse * ola::rdm::RDMResponse::InflateFromData ( const uint8_t *  data,
size_t  length,
RDMStatusCode status_code,
const RDMRequest request = NULL 
)
static

Create a RDMResponse request from raw data.

Parameters
datathe response data.
lengththe length of the response data.
[out]status_codea pointer to a RDMStatusCode to set
requestan optional RDMRequest object that this response is for
Returns
a new RDMResponse object, or NULL is this response is invalid

◆ InflateFromData() [3/3]

RDMDiscoveryResponse * ola::rdm::RDMDiscoveryResponse::InflateFromData ( const uint8_t *  data,
unsigned int  length 
)
static

Inflate a discovery response.

◆ IsDUB()

bool ola::rdm::RDMRequest::IsDUB ( ) const

Check if this is a DUB request.

Returns
true if this is a DUB request.

◆ NewUnMuteRequest()

RDMDiscoveryRequest * ola::rdm::NewUnMuteRequest ( const UID source,
const UID destination,
uint8_t  transaction_number,
uint8_t  port_id 
)

Create a new UnMute request object.

◆ operator==()

bool ola::rdm::RDMCommand::operator== ( const RDMCommand other) const

Test for equality.

Parameters
otherThe RDMCommand to test against.
Returns
True if two RDMCommands are equal.

◆ RDMRequest()

ola::rdm::RDMRequest::RDMRequest ( const UID source,
const UID destination,
uint8_t  transaction_number,
uint8_t  port_id,
uint16_t  sub_device,
RDMCommandClass  command_class,
uint16_t  param_id,
const uint8_t *  data,
unsigned int  length,
const OverrideOptions options = OverrideOptions() 
)

Create a new request.

Parameters
sourceThe source UID.
destinationThe destination UID.
transaction_numberThe transaction number.
port_idThe Port ID.
sub_deviceThe Sub Device index.
command_classThe Command Class of this request.
param_idThe PID value.
dataThe parameter data, or NULL if there isn't any.
lengthThe length of the parameter data.
optionsThe OverrideOptions.

◆ SetParamData()

void ola::rdm::RDMCommand::SetParamData ( const uint8_t *  data,
unsigned int  length 
)
protected

Set the parameter data

◆ ToString()

string ola::rdm::RDMCommand::ToString ( ) const

Create a human readable string from the RDMCommand object.

Returns
A string containing the source and destination UIDs, transaction number, port ID, Message count, Sub Device, Cmd Class, Param ID, Data, and a raw string of the parameter data.

Friends

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const RDMCommand command 
)
friend

Output an RDMCommand object to an ostream.

Parameters
outostream to output to
commandis the RDMCommand to print
See also
ToString()