Open Lighting Architecture  Latest Git
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ola::rdm::RDMCommand Class Referenceabstract

Detailed Description

The base class that all RDM requests & responses inherit from.

Note
RDMCommands may hold more than 231 bytes of data. Use the RDMCommandSerializer class if you want the wire format.
Inheritance diagram for ola::rdm::RDMCommand:
Inheritance graph
[legend]
Collaboration diagram for ola::rdm::RDMCommand:
Collaboration graph
[legend]

Public Types

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

Public Member Functions

virtual uint16_t Checksum (uint16_t checksum) const
 Modify the calculated checksum for this command. More...
 
virtual void Print (CommandPrinter *printer, bool summarize, bool unpack_param_data) const
 Output the contents of the command to a CommandPrinter. More...
 
bool operator== (const RDMCommand &other) const
 Test for equality. More...
 
Accessors
virtual uint8_t SubStartCode () const
 The Sub-Start code for the RDMCommand.
 
virtual uint8_t MessageLength () const
 The Message length field.
 
const UIDSourceUID () const
 Returns the Source UID of the RDMCommand.
 
const UIDDestinationUID () const
 Returns the Destination UID of the RDMCommand.
 
uint8_t TransactionNumber () const
 Returns the Transaction Number of the RDMCommand.
 
uint8_t PortIdResponseType () const
 Returns the Port ID of the RDMCommand.
 
uint8_t MessageCount () const
 Returns the Message Count of the RDMCommand.
 
uint16_t SubDevice () const
 Returns the SubDevice of the RDMCommand.
 
virtual RDMCommandClass CommandClass () const =0
 The CommmandClass of this message.
 
uint16_t ParamId () const
 Returns the Parameter ID of the RDMCommand.
 
unsigned int ParamDataSize () const
 Returns the Size of the Parameter Data of the RDMCommand.
 
const uint8_t * ParamData () const
 Returns the Parameter Data of the RDMCommand.
 

Static Public Member Functions

static RDMCommandInflate (const uint8_t *data, unsigned int length)
 Extract a RDMCommand from raw data. More...
 

Static Public Attributes

static const uint8_t START_CODE = ola::rdm::START_CODE
 The RDM Start Code. More...
 

Protected Member Functions

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

Static Protected Member Functions

static RDMStatusCode VerifyData (const uint8_t *data, size_t length, RDMCommandHeader *command_message)
 
static RDMCommandClass ConvertCommandClass (uint8_t command_type)
 

Protected Attributes

uint8_t m_port_id
 
UID m_source
 
UID m_destination
 
uint8_t m_transaction_number
 

String Methods

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

Member Function Documentation

virtual uint16_t ola::rdm::RDMCommand::Checksum ( uint16_t  checksum) const
inlinevirtual

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 in ola::rdm::RDMRequest.

virtual void ola::rdm::RDMCommand::Print ( CommandPrinter printer,
bool  summarize,
bool  unpack_param_data 
) const
inlinevirtual

Output the contents of the command to a CommandPrinter.

Parameters
printerCommandPrinter which will use the information
summarizeenable a one line summary
unpack_param_dataif the summary isn't enabled, this controls if we unpack and display parameter data.

Reimplemented in ola::rdm::RDMDiscoveryResponse, ola::rdm::RDMDiscoveryRequest, ola::rdm::RDMResponse, and ola::rdm::RDMRequest.

Member Data Documentation

const uint8_t ola::rdm::RDMCommand::START_CODE = ola::rdm::START_CODE
static

The RDM Start Code.

Deprecated:
Use ola::rdm::START_CODE from RDMPacket.h instead (10 Mar 2019).

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