Open Lighting Architecture: ola::usb::RDMCommandSerializer Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
ola::usb::RDMCommandSerializer Class Reference

## Detailed Description

Serializes RDMCommands.

This creates the binary representation of an RDMCommand. The binary representation is restricted to 231 bytes of parameter data. If the message is more than 231 bytes then the methods will return false.

## Public Types
enum | { MAX_PARAM_DATA_LENGTH = 231 }
| The maximum parameter data a single command can contain.

## Static Public Member Functions
static bool | Pack (const RDMCommand &command, ola::io::ByteString *output)
| Serialize a RDMCommand to a ByteString, without the RDM Start Code.
static bool | Pack (const RDMCommand &command, uint8_t *buffer, unsigned int *size)
| Serialize a RDMCommand to an array of bytes.
static bool | PackWithStartCode (const RDMCommand &command, ola::io::ByteString *output)
| Serialize a RDMCommand to a ByteString, with the RDM Start Code.
static unsigned int | RequiredSize (const RDMCommand &command)
| Return the number of bytes required to store the serialized version of the RDMCommand.
static bool | Write (const RDMCommand &command, ola::io::IOStack *stack)
| Write the binary representation of an RDMCommand to an IOStack.

## Member Function Documentation

## ◆ Pack() [1/2]

bool ola::rdm::RDMCommandSerializer::Pack | ( | const RDMCommand & | command,
|  | ola::io::ByteString * | output )
| static

Serialize a RDMCommand to a ByteString, without the RDM Start Code.

Parameters

  | command | the RDMCommand to serialize.
  [out] | output | The ByteString to append to.

Returns
  True if the command was serialized correctly, false otherwise.

## ◆ Pack() [2/2]

bool ola::rdm::RDMCommandSerializer::Pack | ( | const RDMCommand & | command,
|  | uint8_t * | buffer,
|  | unsigned int * | size )
| static

Serialize a RDMCommand to an array of bytes.

Parameters

  | command | the RDMCommand to serialize.
  | buffer | The memory location to serialize to.
  [in,out] | size | The size of the memory location.

Returns
  True if the command was serialized correctly, false otherwise.

The size of the memory location should be at least as large as what was returned from RequiredSize().

## ◆ PackWithStartCode()

bool ola::rdm::RDMCommandSerializer::PackWithStartCode | ( | const RDMCommand & | command,
|  | ola::io::ByteString * | output )
| static

Serialize a RDMCommand to a ByteString, with the RDM Start Code.

Parameters

  | command | the RDMCommand to serialize.
  [out] | output | The ByteString to append to.

Returns
  True if the command was serialized correctly, false otherwise.

## ◆ RequiredSize()

unsigned int ola::rdm::RDMCommandSerializer::RequiredSize | ( | const RDMCommand & | command | ) |
| static

Return the number of bytes required to store the serialized version of the RDMCommand.

Parameters

  command | The RDMCommand which will be serialized.

Returns
  The number of bytes required for the serialized form of the command or 0 if the command contains more than 231 bytes of parameter data.

## ◆ Write()

bool ola::rdm::RDMCommandSerializer::Write | ( | const RDMCommand & | command,
|  | ola::io::IOStack * | stack )
| static

Write the binary representation of an RDMCommand to an IOStack.

Parameters

  command | the RDMCommand
  stack | the IOStack to write to.

Returns
  true if the write was successful, false if the RDM command needs to be fragmented.

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

- include/ola/rdm/RDMCommandSerializer.h
- common/rdm/RDMCommandSerializer.cpp