Open Lighting Architecture  0.10.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Files | Classes | Typedefs | Enumerations | 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...
 
struct  ola::rdm::RDMRequest::OverrideOptions
 
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_COMMAND > 
ola::rdm::RDMGetRequest
 
typedef BaseRDMRequest
< RDMCommand::SET_COMMAND > 
ola::rdm::RDMSetRequest
 
typedef BaseRDMResponse
< RDMCommand::GET_COMMAND_RESPONSE > 
ola::rdm::RDMGetResponse
 
typedef BaseRDMResponse
< RDMCommand::SET_COMMAND_RESPONSE > 
ola::rdm::RDMSetResponse
 

Enumerations

enum  ola::rdm::RDMCommand::RDMCommandClass {
  ola::rdm::RDMCommand::DISCOVER_COMMAND = 0x10, ola::rdm::RDMCommand::DISCOVER_COMMAND_RESPONSE = 0x11, ola::rdm::RDMCommand::GET_COMMAND = 0x20, ola::rdm::RDMCommand::GET_COMMAND_RESPONSE = 0x21,
  ola::rdm::RDMCommand::SET_COMMAND = 0x30, ola::rdm::RDMCommand::SET_COMMAND_RESPONSE = 0x31, ola::rdm::RDMCommand::INVALID_COMMAND = 0xff
}
 A set of values representing CommandClasses in E1.20. More...
 

Functions

RDMResponse * ola::rdm::NackWithReason (const RDMRequest *request, rdm_nack_reason reason, uint8_t outstanding_messages=0)
 Generate a NACK response with a reason code.
 
RDMResponse * ola::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.
 
RDMResponse * ola::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.
 
RDMDiscoveryRequest * ola::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.
 
RDMDiscoveryRequest * ola::rdm::NewMuteRequest (const UID &source, const UID &destination, uint8_t transaction_number, uint8_t port_id=1)
 Create a new Mute Request Object.
 
RDMDiscoveryRequest * ola::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 RDMCommand * ola::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 RDMRequest * ola::rdm::RDMRequest::InflateFromData (const uint8_t *data, unsigned int length)
 Inflate a request from some data. More...
 
static RDMResponse * ola::rdm::RDMResponse::InflateFromData (const uint8_t *data, size_t length, RDMStatusCode *status_code, const RDMRequest *request=NULL)
 
static RDMResponse * ola::rdm::RDMResponse::CombineResponses (const RDMResponse *response1, const RDMResponse *response2)
 Combine two RDMResponses. More...
 
static RDMDiscoveryRequest * ola::rdm::RDMDiscoveryRequest::InflateFromData (const uint8_t *data, unsigned int length)
 Inflate a discovery request.
 
static RDMDiscoveryResponse * ola::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.
 

Enumeration Type Documentation

A set of values representing CommandClasses in E1.20.

Note
Please see section 6.2.10 of ANSI E1.20 for more information.
Enumerator
DISCOVER_COMMAND 

Discovery Command

DISCOVER_COMMAND_RESPONSE 

Discovery Response

GET_COMMAND 

Get Command

GET_COMMAND_RESPONSE 

Get Response

SET_COMMAND 

Set Command

SET_COMMAND_RESPONSE 

Set Response

INVALID_COMMAND 

Invalid Command, specific to OLA

Function Documentation

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.

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.

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.
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.
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
RDMDiscoveryResponse * ola::rdm::RDMDiscoveryResponse::InflateFromData ( const uint8_t *  data,
unsigned int  length 
)
static

Inflate a discovery response.

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

Check if this is a DUB request.

Returns
true if this is a DUB request.
RDMDiscoveryRequest * ola::rdm::NewUnMuteRequest ( const UID &  source,
const UID &  destination,
uint8_t  transaction_number,
uint8_t  port_id 
)

Create a new UnMute request object.

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.
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.
void ola::rdm::RDMCommand::SetParamData ( const uint8_t *  data,
unsigned int  length 
)
protected

Set the parameter data

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

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