Open Lighting Architecture: RDM Messages

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Files | Classes | Typedefs | 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 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_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

## 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.
static RDMCommand * | ola::rdm::RDMCommand::Inflate (const uint8_t *data, unsigned int length)
| Extract a RDMCommand from raw data.
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.
bool | ola::rdm::RDMRequest::IsDUB () const
| Check if this is a DUB request.
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.
static RDMRequest * | ola::rdm::RDMRequest::InflateFromData (const uint8_t *data, unsigned int length)
| Inflate a request from some data.
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.
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.
std::ostream & | ola::plugin::artnet::RDMCommand::operator<< (std::ostream &out, const RDMCommand &command)
| Output an RDMCommand object to an ostream.
std::ostream & | ola::plugin::spi::RDMCommand::operator<< (std::ostream &out, const RDMCommand &command)
| Output an RDMCommand object to an ostream.
std::ostream & | ola::plugin::usbpro::RDMCommand::operator<< (std::ostream &out, const RDMCommand &command)
| Output an RDMCommand object to an ostream.
std::ostream & | ola::rdm::RDMCommand::operator<< (std::ostream &out, const RDMCommand &command)
| Output an RDMCommand object to an ostream.
std::ostream & | ola::usb::RDMCommand::operator<< (std::ostream &out, const RDMCommand &command)
| Output an RDMCommand object to an ostream.

## 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

  checksum | The 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

  response1 | the first response.
  response2 | the 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

  data | The data excluding the state code.
  length | The length of the data.

Returns
  NULL if the RDM command is invalid.

## ◆ InflateFromData() [1/3]

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

Inflate a discovery response.

## ◆ InflateFromData() [2/3]

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

Inflate a request from some data.

Parameters

  data | The raw data.
  length | The length of the data.

Returns
  A RDMRequest object or NULL if the data was invalid.

## ◆ InflateFromData() [3/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

  | data | the response data.
  | length | the length of the response data.
  [out] | status_code | a pointer to a RDMStatusCode to set
  | request | an optional RDMRequest object that this response is for

Returns
  a new RDMResponse object, or NULL is this response is invalid

## ◆ IsDUB()

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

Check if this is a DUB request.

Returns
  true if this is a DUB request.

## ◆ MessageLength() [1/2]

uint8_t ola::rdm::RDMCommand::MessageLength | ( |  | ) | const
| virtual

The Message length field.

Reimplemented in ola::plugin::artnet::RDMRequest, ola::plugin::spi::RDMRequest, ola::plugin::usbpro::RDMRequest, ola::rdm::RDMRequest, ola::RDMRequest, and ola::usb::RDMRequest.

## ◆ MessageLength() [2/2]

uint8_t ola::rdm::RDMRequest::MessageLength | ( |  | ) | const
| virtual

The Message length field.

Reimplemented from ola::rdm::RDMCommand.

## ◆ 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

  other | The 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

  source | The source UID.
  destination | The destination UID.
  transaction_number | The transaction number.
  port_id | The Port ID.
  sub_device | The Sub Device index.
  command_class | The Command Class of this request.
  param_id | The PID value.
  data | The parameter data, or NULL if there isn't any.
  length | The length of the parameter data.
  options | The OverrideOptions.

## ◆ SetParamData()

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

Set the parameter data

## ◆ SubStartCode()

uint8_t ola::rdm::RDMRequest::SubStartCode | ( |  | ) | const
| virtual

The Sub-Start code for the RDMCommand.

Reimplemented from ola::rdm::RDMCommand.

## ◆ 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<< [1/5]

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

Output an RDMCommand object to an ostream.

Parameters

  out | ostream to output to
  command | is the RDMCommand to print

See also
  ToString()

## ◆ operator<< [2/5]

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

Output an RDMCommand object to an ostream.

Parameters

  out | ostream to output to
  command | is the RDMCommand to print

See also
  ToString()

## ◆ operator<< [3/5]

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

Output an RDMCommand object to an ostream.

Parameters

  out | ostream to output to
  command | is the RDMCommand to print

See also
  ToString()

## ◆ operator<< [4/5]

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

Output an RDMCommand object to an ostream.

Parameters

  out | ostream to output to
  command | is the RDMCommand to print

See also
  ToString()

## ◆ operator<< [5/5]

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

Output an RDMCommand object to an ostream.

Parameters

  out | ostream to output to
  command | is the RDMCommand to print

See also
  ToString()