Open Lighting Architecture: ola::client::OlaClient Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
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.
void | ReloadPlugins (SetCallback *callback)
| Trigger a plugin reload.
void | FetchPluginList (PluginListCallback *callback)
| Fetch the list of plugins loaded.
void | FetchPluginDescription (ola_plugin_id plugin_id, PluginDescriptionCallback *callback)
| Fetch the description for a plugin.
void | FetchPluginState (ola_plugin_id plugin_id, PluginStateCallback *callback)
| Fetch the state of a plugin.
void | FetchDeviceInfo (ola_plugin_id plugin_filter, DeviceInfoCallback *callback)
| Request a list of the available devices.
void | FetchCandidatePorts (CandidatePortsCallback *callback)
| Request a list of ports that could be patched to new universe.
void | FetchCandidatePorts (unsigned int universe_id, CandidatePortsCallback *callback)
| Request a list of ports that could be patched to a particular universe.
void | SetPluginState (ola_plugin_id plugin_id, bool state, SetCallback *callback)
| Set the state of a plugin.
void | ConfigureDevice (unsigned int device_alias, const std::string &msg, ConfigureDeviceCallback *callback)
| Send a device config request.
void | SetPortPriorityInherit (unsigned int device_alias, unsigned int port, PortDirection port_direction, SetCallback *callback)
| Set the priority for a port to inherit mode.
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.
void | FetchUniverseList (UniverseListCallback *callback)
| Request a list of universes.
void | FetchUniverseInfo (unsigned int universe, UniverseInfoCallback *callback)
| Fetch the information for a given universe.
void | SetUniverseName (unsigned int universe, const std::string &name, SetCallback *callback)
| Set the name of a universe.
void | SetUniverseMergeMode (unsigned int universe, OlaUniverse::merge_mode mode, SetCallback *callback)
| Set the merge mode of a universe.
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.
void | RegisterUniverse (unsigned int universe, RegisterAction register_action, SetCallback *callback)
| Register our interest in a universe.
void | SendDMX (unsigned int universe, const DmxBuffer &data, const SendDMXArgs &args)
| Send DMX data.
void | FetchDMX (unsigned int universe, DMXCallback *callback)
| Fetch the latest DMX data for a universe.
void | RunDiscovery (unsigned int universe, DiscoveryType discovery_type, DiscoveryCallback *callback)
| Trigger discovery for a universe.
void | SetSourceUID (const ola::rdm::UID &uid, SetCallback *callback)
| Set the source UID for this client.
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.
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.
void | SendTimeCode (const ola::timecode::TimeCode &timecode, SetCallback *callback)
| Send TimeCode data.

## Member Function Documentation

## ◆ ConfigureDevice()

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

Send a device config request.

Parameters

  device_alias | the device alias of the device to configure.
  msg | the blob of data to send to the device.
  callback | the ConfigureDeviceCallback invoked upon completion.

## ◆ FetchCandidatePorts() [1/2]

void ola::client::OlaClient::FetchCandidatePorts | ( | CandidatePortsCallback * | callback | ) |

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

Parameters

  callback | the CandidatePortsCallback invoked upon completion.

## ◆ FetchCandidatePorts() [2/2]

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_id | the id of the universe to fetch the candidate ports for.
  callback | the CandidatePortsCallback invoked upon completion.

## ◆ FetchDeviceInfo()

void ola::client::OlaClient::FetchDeviceInfo | ( | ola_plugin_id | plugin_filter,
|  | DeviceInfoCallback * | callback )

Request a list of the available devices.

Parameters

  plugin_filter | only fetch devices that belong to the specified plugin.
  callback | the DeviceInfoCallback to be invoked upon completion.

## ◆ FetchDMX()

void ola::client::OlaClient::FetchDMX | ( | unsigned int | universe,
|  | DMXCallback * | callback )

Fetch the latest DMX data for a universe.

Parameters

  universe | the universe id to get data for.
  callback | the SetCallback to invoke upon completion.

## ◆ FetchPluginDescription()

void ola::client::OlaClient::FetchPluginDescription | ( | ola_plugin_id | plugin_id,
|  | PluginDescriptionCallback * | callback )

Fetch the description for a plugin.

Parameters

  plugin_id | the id of the plugin to fetch the state for.
  callback | the PluginDescriptionCallback to be invoked upon completion.

## ◆ FetchPluginList()

void ola::client::OlaClient::FetchPluginList | ( | PluginListCallback * | callback | ) |

Fetch the list of plugins loaded.

Parameters

  callback | the PluginListCallback to be invoked upon completion.

## ◆ FetchPluginState()

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_id | the id of the plugin to fetch the state for.
  callback | the PluginStateCallback to be invoked upon completion.

## ◆ FetchUniverseInfo()

void ola::client::OlaClient::FetchUniverseInfo | ( | unsigned int | universe,
|  | UniverseInfoCallback * | callback )

Fetch the information for a given universe.

Parameters

  universe | the id of the universe.
  callback | the UniverseInfoCallback to invoke upon completion.

## ◆ FetchUniverseList()

void ola::client::OlaClient::FetchUniverseList | ( | UniverseListCallback * | callback | ) |

Request a list of universes.

Parameters

  callback | the UniverseListCallback to invoke upon completion.

## ◆ Patch()

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_alias | the device containing the port to change
  port | the port id of the port to change.
  port_direction | the direction of the port.
  action | OlaClientCore::PATCH or OlaClientCore::UNPATCH.
  universe | universe id to patch the port to.
  callback | the SetCallback to invoke upon completion.

## ◆ RDMGet()

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

  universe | the universe to send the command on
  uid | the UID to send the command to
  sub_device | the sub device index
  pid | the PID to address
  data | the optional data to send
  data_length | the length of the data
  args | the RDM arguments which includes the callback to run.

## ◆ RDMSet()

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

  universe | the universe to send the command on
  uid | the UID to send the command to
  sub_device | the sub device index
  pid | the PID to address
  data | the optional data to send
  data_length | the length of the data
  args | the RDM arguments which includes the callback to run.

## ◆ RegisterUniverse()

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

  universe | the id of the universe to register for.
  register_action | the action (register or unregister)
  callback | the SetCallback to invoke upon completion.

## ◆ ReloadPlugins()

void ola::client::OlaClient::ReloadPlugins | ( | SetCallback * | callback | ) |

Trigger a plugin reload.

Parameters

  callback | the SetCallback to invoke upon completion.

## ◆ RunDiscovery()

void ola::client::OlaClient::RunDiscovery | ( | unsigned int | universe,
|  | DiscoveryType | discovery_type,
|  | DiscoveryCallback * | callback )

Trigger discovery for a universe.

Parameters

  universe | the universe id to run discovery on.
  discovery_type | the type of discovery to run before returning.
  callback | the UIDListCallback to invoke upon completion.

## ◆ SendDMX()

void ola::client::OlaClient::SendDMX | ( | unsigned int | universe,
|  | const DmxBuffer & | data,
|  | const SendDMXArgs & | args )

Send DMX data.

Parameters

  universe | the universe to send to.
  data | the DmxBuffer with the data
  args | the SendDMXArgs to use for this call.

## ◆ SendTimeCode()

void ola::client::OlaClient::SendTimeCode | ( | const ola::timecode::TimeCode & | timecode,
|  | SetCallback * | callback )

Send TimeCode data.

Parameters

  timecode | The timecode data.
  callback | the SetCallback to invoke when the send completes.

## ◆ SetDMXCallback()

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

  callback | the callback to run upon receiving new DMX data.

## ◆ SetPluginState()

void ola::client::OlaClient::SetPluginState | ( | ola_plugin_id | plugin_id,
|  | bool | state,
|  | SetCallback * | callback )

Set the state of a plugin.

Parameters

  plugin_id | the id of the plugin to set the state of.
  state | the state to set the plugin to
  callback | the SetCallback to invoke upon completion.

## ◆ SetPortPriorityInherit()

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_alias | the device containing the port to change
  port | the port id of the port to change.
  port_direction | the direction of the port.
  callback | the SetCallback to invoke upon completion.

## ◆ SetPortPriorityOverride()

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_alias | the device containing the port to change
  port | the port id of the port to change.
  port_direction | the direction of the port.
  value | the new port priority value.
  callback | the SetCallback to invoke upon completion.

## ◆ SetSourceUID()

void ola::client::OlaClient::SetSourceUID | ( | const ola::rdm::UID & | uid,
|  | SetCallback * | callback )

Set the source UID for this client.

Parameters

  uid | the UID to use when sending RDM messages from this client.
  callback | the SetCallback to invoke upon completion.

## ◆ SetUniverseMergeMode()

void ola::client::OlaClient::SetUniverseMergeMode | ( | unsigned int | universe,
|  | OlaUniverse::merge_mode | mode,
|  | SetCallback * | callback )

Set the merge mode of a universe.

Parameters

  universe | the id of the universe
  mode | the new merge mode
  callback | the SetCallback to invoke upon completion.

## ◆ SetUniverseName()

void ola::client::OlaClient::SetUniverseName | ( | unsigned int | universe,
|  | const std::string & | name,
|  | SetCallback * | callback )

Set the name of a universe.

Parameters

  universe | the id of the universe
  name | the new name to use.
  callback | the SetCallback to invoke upon completion.

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

- include/ola/client/OlaClient.h
- ola/OlaClient.cpp