Open Lighting Architecture  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Files | Classes | Typedefs | Enumerations | Functions
RDM Messages
RDM

Detailed Description

Construct and dissect 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 commands inherit from. More...
class  ola::rdm::RDMRequest
 RDM Commands that represent requests (GET, SET or DISCOVER). More...
class  ola::rdm::RDMGetSetRequest
 The parent class for GET/SET requests. More...
class  ola::rdm::BaseRDMRequest< command_class >
class  ola::rdm::RDMResponse
 The set of RDM Commands that represent 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::rdm_message_type { ola::rdm::RDM_REQUEST, ola::rdm::RDM_RESPONSE, ola::rdm::RDM_INVALID }
 An OLA specific enum that allows us to tell if a command is a request or a response. See RDMCommandClass for more information. More...

Functions

bool ola::rdm::GuessMessageType (rdm_message_type *type_arg, RDMCommand::RDMCommandClass *command_class_arg, const uint8_t *data, unsigned int length)
RDMResponse * ola::rdm::NackWithReason (const RDMRequest *request, rdm_nack_reason reason_enum, uint8_t outstanding_messages)
RDMResponse * ola::rdm::GetResponseFromData (const RDMRequest *request, const uint8_t *data, unsigned int length, rdm_response_type type, uint8_t outstanding_messages)
RDMResponse * ola::rdm::GetResponseWithPid (const RDMRequest *request, uint16_t pid, const uint8_t *data, unsigned int length, uint8_t type, uint8_t outstanding_messages)
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)
bool ola::rdm::RDMCommand::operator== (const RDMCommand &other) const
 Equality Operator.
void ola::rdm::RDMCommand::Write (ola::io::OutputStream *stream) const
 Write this RDMCommand to an OutputStream.
static RDMCommand * ola::rdm::RDMCommand::Inflate (const uint8_t *data, unsigned int length)
void ola::rdm::RDMCommand::SetParamData (const uint8_t *data, unsigned int length)
static rdm_response_code ola::rdm::RDMCommand::VerifyData (const uint8_t *data, unsigned int length, RDMCommandHeader *command_message)
static RDMCommandClass ola::rdm::RDMCommand::ConvertCommandClass (uint8_t command_type)
static RDMRequest * ola::rdm::RDMRequest::InflateFromData (const uint8_t *data, unsigned int length)
static RDMRequest * ola::rdm::RDMRequest::InflateFromData (const std::string &data)
static RDMResponse * ola::rdm::RDMResponse::InflateFromData (const uint8_t *data, unsigned int length, rdm_response_code *response_code, const RDMRequest *request=NULL)
static RDMResponse * ola::rdm::RDMResponse::InflateFromData (const uint8_t *data, unsigned int length, rdm_response_code *response_code, const RDMRequest *request, uint8_t transaction_number)
static RDMResponse * ola::rdm::RDMResponse::InflateFromData (const std::string &data, rdm_response_code *response_code, const RDMRequest *request=NULL)
static RDMResponse * ola::rdm::RDMResponse::InflateFromData (const std::string &data, rdm_response_code *response_code, const RDMRequest *request, uint8_t transaction_number)
static RDMResponse * ola::rdm::RDMResponse::CombineResponses (const RDMResponse *response1, const RDMResponse *response2)
static RDMDiscoveryRequest * ola::rdm::RDMDiscoveryRequest::InflateFromData (const uint8_t *data, unsigned int length)
static RDMDiscoveryRequest * ola::rdm::RDMDiscoveryRequest::InflateFromData (const std::string &data)
static RDMDiscoveryResponse * ola::rdm::RDMDiscoveryResponse::InflateFromData (const uint8_t *data, unsigned int length)
static RDMDiscoveryResponse * ola::rdm::RDMDiscoveryResponse::InflateFromData (const std::string &data)

String Methods

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

Enumeration Type Documentation

An OLA specific enum that allows us to tell if a command is a request or a response. See RDMCommandClass for more information.

Enumerator:
RDM_REQUEST 

Request

RDM_RESPONSE 

Response

RDM_INVALID 

Invalid

Function Documentation

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

This combines two RDMResponses into one. It's used to combine the data from two responses in an ACK_OVERFLOW session together.

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.
RDMResponse * ola::rdm::GetResponseWithPid ( const RDMRequest *  request,
uint16_t  pid,
const uint8_t *  data,
unsigned int  length,
uint8_t  type,
uint8_t  outstanding_messages 
)

Construct a RDM response from a RDMRequest object.

bool ola::rdm::GuessMessageType ( rdm_message_type *  type_arg,
RDMCommand::RDMCommandClass *  command_class_arg,
const uint8_t *  data,
unsigned int  length 
)

Guess the type of an RDM message, so we know whether we should unpack it as a request or response. This doesn't perform any data checking (that's left to the Inflate* methods).

Parameters
type_arga pointer to a rdm_message_type variable which is set to RDM_REQUEST or RDM_RESPONSE.
dataa pointer to the rdm message (excluding the start code)
lengthlength of the rdm data
Returns
true if we could determine the type, false otherwise
RDMCommand * ola::rdm::RDMCommand::Inflate ( const uint8_t *  data,
unsigned int  length 
)
static

Attempt to inflate RDM data (excluding the start code) into an RDMCommand object. This is really only useful for sniffer-style programs.

Returns
NULL if the RDM command is invalid.
RDMRequest * ola::rdm::RDMRequest::InflateFromData ( const std::string &  data)
static

Inflate from some data

Reimplemented in ola::rdm::RDMDiscoveryRequest.

RDMResponse * ola::rdm::RDMResponse::InflateFromData ( const uint8_t *  data,
unsigned int  length,
rdm_response_code *  response_code,
const RDMRequest request = NULL 
)
static

Inflate a request from some data

Parameters
datathe request data
lengththe length of the request data
response_codea pointer to a rdm_response_code to set
requestan optional RDMRequest object that this response is for
Returns
a new RDMResponse object, or NULL is this response is invalid
RDMResponse * ola::rdm::RDMResponse::InflateFromData ( const std::string &  data,
rdm_response_code *  response_code,
const RDMRequest request = NULL 
)
static

Inflate from some data

RDMResponse * ola::rdm::RDMResponse::InflateFromData ( const std::string &  data,
rdm_response_code *  response_code,
const RDMRequest request,
uint8_t  transaction_number 
)
static

Inflate from some data

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

Inflate a discovery request.

Reimplemented from ola::rdm::RDMRequest.

RDMDiscoveryRequest * ola::rdm::RDMDiscoveryRequest::InflateFromData ( const std::string &  data)
static

Inflate from some data

Reimplemented from ola::rdm::RDMRequest.

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

Inflate a discovery response.

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

Equality Operator.

Parameters
otheris the other RDMCommand you wish to compare against.
void ola::rdm::RDMCommand::SetParamData ( const uint8_t *  data,
unsigned int  length 
)
protected

Set the parameter data

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

Create a 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.
void ola::rdm::RDMCommand::Write ( ola::io::OutputStream stream) const

Write this RDMCommand to an OutputStream.

Parameters
streamis a pointer to an OutputStream

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