Open Lighting Architecture  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
ola::rdm::PidStoreHelper Class Reference

Public Member Functions

 PidStoreHelper (const std::string &pid_location, unsigned int initial_indent=0)
 ~PidStoreHelper ()
bool Init ()
const PidDescriptorGetDescriptor (const std::string &pid_name, uint16_t manufacturer_id) const
const PidDescriptorGetDescriptor (uint16_t param_id, uint16_t manufacturer_id) const
const ola::messaging::MessageBuildMessage (const ola::messaging::Descriptor *descriptor, const std::vector< std::string > &inputs)
const uint8_t * SerializeMessage (const ola::messaging::Message *message, unsigned int *data_length)
const ola::messaging::MessageDeserializeMessage (const ola::messaging::Descriptor *descriptor, const uint8_t *data, unsigned int data_length)
const std::string MessageToString (const ola::messaging::Message *message)
const std::string PrettyPrintMessage (uint16_t manufacturer_id, bool is_set, uint16_t pid, const ola::messaging::Message *message)
const std::string SchemaAsString (const ola::messaging::Descriptor *descriptor)
void SupportedPids (uint16_t manufacturer_id, std::vector< std::string > *pid_names) const
void SupportedPids (uint16_t manufacturer_id, std::vector< const PidDescriptor * > *descriptors) const

Constructor & Destructor Documentation

ola::rdm::PidStoreHelper::PidStoreHelper ( const std::string &  pid_location,
unsigned int  initial_indent = 0 
)
explicit

Set up a new PidStoreHelper object

ola::rdm::PidStoreHelper::~PidStoreHelper ( )

Clean up

Member Function Documentation

const ola::messaging::Message * ola::rdm::PidStoreHelper::BuildMessage ( const ola::messaging::Descriptor descriptor,
const std::vector< std::string > &  inputs 
)

Build a Message object from a series of input strings

const ola::messaging::Message * ola::rdm::PidStoreHelper::DeserializeMessage ( const ola::messaging::Descriptor descriptor,
const uint8_t *  data,
unsigned int  data_length 
)

DeSerialize a message

const ola::rdm::PidDescriptor * ola::rdm::PidStoreHelper::GetDescriptor ( const std::string &  pid_name,
uint16_t  manufacturer_id 
) const

Lookup a PidDescriptor by name.

Parameters
manufacturer_idthe ESTA id of the manufacturer_id
pid_namethe name of the pid
Returns
a PidDescriptor or NULL if the pid wasn't found.
const ola::rdm::PidDescriptor * ola::rdm::PidStoreHelper::GetDescriptor ( uint16_t  pid_value,
uint16_t  manufacturer_id 
) const

Lookup a PidDescriptor by pid value.

Parameters
manufacturer_idthe ESTA id of the manufacturer_id
pid_valuethe pid to lookup
Returns
a PidDescriptor or NULL if the pid wasn't found.
bool ola::rdm::PidStoreHelper::Init ( )

Init the PidStoreHelper, this loads the pid store

const string ola::rdm::PidStoreHelper::MessageToString ( const ola::messaging::Message message)

Convert a message to a string

Parameters
messagethe Message object to print
Returns
a formatted string representation of the message.
const string ola::rdm::PidStoreHelper::PrettyPrintMessage ( uint16_t  manufacturer_id,
bool  is_set,
uint16_t  pid,
const ola::messaging::Message message 
)

Pretty print a RDM message based on the PID, if we can't find a custom MessagePrinter we default to the GenericMessagePrinter.

Parameters
manufacturer_idthe manufacturer ID
pidthe pid value
messagethe Message object to print
Returns
a formatted string representation of the message.
const string ola::rdm::PidStoreHelper::SchemaAsString ( const ola::messaging::Descriptor descriptor)

Return a string describing the schema for a descriptor

const uint8_t * ola::rdm::PidStoreHelper::SerializeMessage ( const ola::messaging::Message message,
unsigned int *  data_length 
)

Serialize a message to binary format

void ola::rdm::PidStoreHelper::SupportedPids ( uint16_t  manufacturer_id,
std::vector< std::string > *  pid_names 
) const

Return the list of pids supported including manufacturer pids.

void ola::rdm::PidStoreHelper::SupportedPids ( uint16_t  manufacturer_id,
std::vector< const PidDescriptor * > *  descriptors 
) const

Return the list of PidDescriptors supported. The caller does not owner the pointers, they are valid for the lifetime of the PidStoreHelper.


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