Open Lighting Architecture  0.9.5
 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)
 Set up a new PidStoreHelper object.
 ~PidStoreHelper ()
 Clean up.
bool Init ()
 Init the PidStoreHelper, this loads the PID store.
const PidDescriptorGetDescriptor (const std::string &pid_name, uint16_t manufacturer_id) const
 Lookup a PidDescriptor by name.
const PidDescriptorGetDescriptor (uint16_t param_id, uint16_t manufacturer_id) const
 Lookup a PidDescriptor by PID value.
const ola::messaging::MessageBuildMessage (const ola::messaging::Descriptor *descriptor, const std::vector< std::string > &inputs)
 Build a Message object from a series of input strings.
const uint8_t * SerializeMessage (const ola::messaging::Message *message, unsigned int *data_length)
 Serialize a message to binary format.
const ola::messaging::MessageDeserializeMessage (const ola::messaging::Descriptor *descriptor, const uint8_t *data, unsigned int data_length)
 DeSerialize a message.
const std::string MessageToString (const ola::messaging::Message *message)
 Convert a message to a string.
const std::string 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.
const std::string SchemaAsString (const ola::messaging::Descriptor *descriptor)
 Return a string describing the schema for a descriptor.
void SupportedPids (uint16_t manufacturer_id, std::vector< std::string > *pid_names) const
 Return the list of PIDs supported including manufacturer PIDs.
void SupportedPids (uint16_t manufacturer_id, std::vector< const PidDescriptor * > *descriptors) const
 Return the list of PidDescriptors supported.

Member Function Documentation

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.
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
is_settrue if the message is a set command, false otherwise
pidthe pid value
messagethe Message object to print
Returns
a formatted string representation of the message.
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 own the pointers, they are valid for the lifetime of the PidStoreHelper.


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