Open Lighting Architecture  Latest Git
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | List of all members
ola::client::OlaClient Class Reference

Detailed Description

The callback based C++ client for OLA.

Public Member Functions

 OlaClient (ola::io::ConnectedDescriptor *descriptor)
 
bool Setup ()
 
bool Stop ()
 
void SetCloseHandler (ola::SingleUseCallback0< void > *callback)
 Set the close handler.
 
void SetDMXCallback (RepeatableDMXCallback *callback)
 Set the callback to be run when new DMX data arrives. More...
 
void ReloadPlugins (SetCallback *callback)
 Trigger a plugin reload. More...
 
void FetchPluginList (PluginListCallback *callback)
 Fetch the list of plugins loaded. More...
 
void FetchPluginDescription (ola_plugin_id plugin_id, PluginDescriptionCallback *callback)
 Fetch the description for a plugin. More...
 
void FetchPluginState (ola_plugin_id plugin_id, PluginStateCallback *callback)
 Fetch the state of a plugin. More...
 
void FetchDeviceInfo (ola_plugin_id plugin_filter, DeviceInfoCallback *callback)
 Request a list of the available devices. More...
 
void FetchCandidatePorts (CandidatePortsCallback *callback)
 Request a list of ports that could be patched to new universe. More...
 
void FetchCandidatePorts (unsigned int universe_id, CandidatePortsCallback *callback)
 Request a list of ports that could be patched to a particular universe. More...
 
void SetPluginState (ola_plugin_id plugin_id, bool state, SetCallback *callback)
 Set the state of a plugin. More...
 
void ConfigureDevice (unsigned int device_alias, const std::string &msg, ConfigureDeviceCallback *callback)
 Send a device config request. More...
 
void SetPortPriorityInherit (unsigned int device_alias, unsigned int port, PortDirection port_direction, SetCallback *callback)
 Set the priority for a port to inherit mode. More...
 
void SetPortPriorityOverride (unsigned int device_alias, unsigned int port, PortDirection port_direction, uint8_t value, SetCallback *callback)
 Set the priority for a port to override mode. More...
 
void FetchUniverseList (UniverseListCallback *callback)
 Request a list of universes. More...
 
void FetchUniverseInfo (unsigned int universe, UniverseInfoCallback *callback)
 Fetch the information for a given universe. More...
 
void SetUniverseName (unsigned int universe, const std::string &name, SetCallback *callback)
 Set the name of a universe. More...
 
void SetUniverseMergeMode (unsigned int universe, OlaUniverse::merge_mode mode, SetCallback *callback)
 Set the merge mode of a universe. More...
 
void Patch (unsigned int device_alias, unsigned int port, PortDirection port_direction, PatchAction action, unsigned int universe, SetCallback *callback)
 Patch or unpatch a port from a universe. More...
 
void RegisterUniverse (unsigned int universe, RegisterAction register_action, SetCallback *callback)
 Register our interest in a universe. More...
 
void SendDMX (unsigned int universe, const DmxBuffer &data, const SendDMXArgs &args)
 Send DMX data. More...
 
void FetchDMX (unsigned int universe, DMXCallback *callback)
 Fetch the latest DMX data for a universe. More...
 
void RunDiscovery (unsigned int universe, DiscoveryType discovery_type, DiscoveryCallback *callback)
 Trigger discovery for a universe. More...
 
void SetSourceUID (const ola::rdm::UID &uid, SetCallback *callback)
 Set the source UID for this client. More...
 
void RDMGet (unsigned int universe, const ola::rdm::UID &uid, uint16_t sub_device, uint16_t pid, const uint8_t *data, unsigned int data_length, const SendRDMArgs &args)
 Send an RDM Get Command. More...
 
void RDMSet (unsigned int universe, const ola::rdm::UID &uid, uint16_t sub_device, uint16_t pid, const uint8_t *data, unsigned int data_length, const SendRDMArgs &args)
 Send an RDM Set Command. More...
 
void SendTimeCode (const ola::timecode::TimeCode &timecode, SetCallback *callback)
 Send TimeCode data. More...
 

Member Function Documentation

void ola::client::OlaClient::ConfigureDevice ( unsigned int  device_alias,
const std::string &  msg,
ConfigureDeviceCallback callback 
)

Send a device config request.

Parameters
device_aliasthe device alias of the device to configure.
msgthe blob of data to send to the device.
callbackthe ConfigureDeviceCallback invoked upon completion.
void ola::client::OlaClient::FetchCandidatePorts ( CandidatePortsCallback callback)

Request a list of ports that could be patched to new universe.

Parameters
callbackthe CandidatePortsCallback invoked upon completion.
void ola::client::OlaClient::FetchCandidatePorts ( unsigned int  universe_id,
CandidatePortsCallback callback 
)

Request a list of ports that could be patched to a particular universe.

Parameters
universe_idthe id of the universe to fetch the candidate ports for.
callbackthe CandidatePortsCallback invoked upon completion.
void ola::client::OlaClient::FetchDeviceInfo ( ola_plugin_id  plugin_filter,
DeviceInfoCallback callback 
)

Request a list of the available devices.

Parameters
plugin_filteronly fetch devices that belong to the specified plugin.
callbackthe DeviceInfoCallback to be invoked upon completion.
void ola::client::OlaClient::FetchDMX ( unsigned int  universe,
DMXCallback callback 
)

Fetch the latest DMX data for a universe.

Parameters
universethe universe id to get data for.
callbackthe SetCallback to invoke upon completion.
void ola::client::OlaClient::FetchPluginDescription ( ola_plugin_id  plugin_id,
PluginDescriptionCallback callback 
)

Fetch the description for a plugin.

Parameters
plugin_idthe id of the plugin to fetch the state for.
callbackthe PluginDescriptionCallback to be invoked upon completion.
void ola::client::OlaClient::FetchPluginList ( PluginListCallback callback)

Fetch the list of plugins loaded.

Parameters
callbackthe PluginListCallback to be invoked upon completion.
void ola::client::OlaClient::FetchPluginState ( ola_plugin_id  plugin_id,
PluginStateCallback callback 
)

Fetch the state of a plugin.

This returns the state and the list of plugins this plugin conflicts with.

Parameters
plugin_idthe id of the plugin to fetch the state for.
callbackthe PluginStateCallback to be invoked upon completion.
void ola::client::OlaClient::FetchUniverseInfo ( unsigned int  universe,
UniverseInfoCallback callback 
)

Fetch the information for a given universe.

Parameters
universethe id of the universe.
callbackthe UniverseInfoCallback to invoke upon completion.
void ola::client::OlaClient::FetchUniverseList ( UniverseListCallback callback)

Request a list of universes.

Parameters
callbackthe UniverseListCallback to invoke upon completion.
void ola::client::OlaClient::Patch ( unsigned int  device_alias,
unsigned int  port,
PortDirection  port_direction,
PatchAction  action,
unsigned int  universe,
SetCallback callback 
)

Patch or unpatch a port from a universe.

Parameters
device_aliasthe device containing the port to change
portthe port id of the port to change.
port_directionthe direction of the port.
actionOlaClientCore::PATCH or OlaClientCore::UNPATCH.
universeuniverse id to patch the port to.
callbackthe SetCallback to invoke upon completion.
void ola::client::OlaClient::RDMGet ( unsigned int  universe,
const ola::rdm::UID uid,
uint16_t  sub_device,
uint16_t  pid,
const uint8_t *  data,
unsigned int  data_length,
const SendRDMArgs args 
)

Send an RDM Get Command.

Parameters
universethe universe to send the command on
uidthe UID to send the command to
sub_devicethe sub device index
pidthe PID to address
datathe optional data to send
data_lengththe length of the data
argsthe RDM arguments which includes the callback to run.
void ola::client::OlaClient::RDMSet ( unsigned int  universe,
const ola::rdm::UID uid,
uint16_t  sub_device,
uint16_t  pid,
const uint8_t *  data,
unsigned int  data_length,
const SendRDMArgs args 
)

Send an RDM Set Command.

Parameters
universethe universe to send the command on
uidthe UID to send the command to
sub_devicethe sub device index
pidthe PID to address
datathe optional data to send
data_lengththe length of the data
argsthe RDM arguments which includes the callback to run.
void ola::client::OlaClient::RegisterUniverse ( unsigned int  universe,
RegisterAction  register_action,
SetCallback callback 
)

Register our interest in a universe.

The callback set by SetDMXCallback() will be called when new DMX data arrives.

Parameters
universethe id of the universe to register for.
register_actionthe action (register or unregister)
callbackthe SetCallback to invoke upon completion.
void ola::client::OlaClient::ReloadPlugins ( SetCallback callback)

Trigger a plugin reload.

Parameters
callbackthe SetCallback to invoke upon completion.
void ola::client::OlaClient::RunDiscovery ( unsigned int  universe,
DiscoveryType  discovery_type,
DiscoveryCallback callback 
)

Trigger discovery for a universe.

Parameters
universethe universe id to run discovery on.
discovery_typethe type of discovery to run before returning.
callbackthe UIDListCallback to invoke upon completion.
void ola::client::OlaClient::SendDMX ( unsigned int  universe,
const DmxBuffer data,
const SendDMXArgs args 
)

Send DMX data.

Parameters
universethe universe to send to.
datathe DmxBuffer with the data
argsthe SendDMXArgs to use for this call.
void ola::client::OlaClient::SendTimeCode ( const ola::timecode::TimeCode timecode,
SetCallback callback 
)

Send TimeCode data.

Parameters
timecodeThe timecode data.
callbackthe SetCallback to invoke when the send completes.
void ola::client::OlaClient::SetDMXCallback ( RepeatableDMXCallback callback)

Set the callback to be run when new DMX data arrives.

The DMX callback will be run when new data arrives for universes that have been registered with RegisterUniverse().

Parameters
callbackthe callback to run upon receiving new DMX data.
void ola::client::OlaClient::SetPluginState ( ola_plugin_id  plugin_id,
bool  state,
SetCallback callback 
)

Set the state of a plugin.

Parameters
plugin_idthe id of the plugin to set the state of.
statethe state to set the plugin to
callbackthe SetCallback to invoke upon completion.
void ola::client::OlaClient::SetPortPriorityInherit ( unsigned int  device_alias,
unsigned int  port,
PortDirection  port_direction,
SetCallback callback 
)

Set the priority for a port to inherit mode.

Parameters
device_aliasthe device containing the port to change
portthe port id of the port to change.
port_directionthe direction of the port.
callbackthe SetCallback to invoke upon completion.
void ola::client::OlaClient::SetPortPriorityOverride ( unsigned int  device_alias,
unsigned int  port,
PortDirection  port_direction,
uint8_t  value,
SetCallback callback 
)

Set the priority for a port to override mode.

Parameters
device_aliasthe device containing the port to change
portthe port id of the port to change.
port_directionthe direction of the port.
valuethe new port priority value.
callbackthe SetCallback to invoke upon completion.
void ola::client::OlaClient::SetSourceUID ( const ola::rdm::UID uid,
SetCallback callback 
)

Set the source UID for this client.

Parameters
uidthe UID to use when sending RDM messages from this client.
callbackthe SetCallback to invoke upon completion.
void ola::client::OlaClient::SetUniverseMergeMode ( unsigned int  universe,
OlaUniverse::merge_mode  mode,
SetCallback callback 
)

Set the merge mode of a universe.

Parameters
universethe id of the universe
modethe new merge mode
callbackthe SetCallback to invoke upon completion.
void ola::client::OlaClient::SetUniverseName ( unsigned int  universe,
const std::string &  name,
SetCallback callback 
)

Set the name of a universe.

Parameters
universethe id of the universe
namethe new name to use.
callbackthe SetCallback to invoke upon completion.

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