/usr/include/ola/client/OlaClient.h is in libola-dev 0.9.8-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | /*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* OlaClient.h
* This is the main client API to OLA.
* Copyright (C) 2010 Simon Newton
*/
#ifndef INCLUDE_OLA_CLIENT_OLACLIENT_H_
#define INCLUDE_OLA_CLIENT_OLACLIENT_H_
#include <ola/DmxBuffer.h>
#include <ola/client/CallbackTypes.h>
#include <ola/client/ClientArgs.h>
#include <ola/client/ClientTypes.h>
#include <ola/base/Macro.h>
#include <ola/io/Descriptor.h>
#include <ola/plugin_id.h>
#include <ola/rdm/UID.h>
#include <ola/rdm/UIDSet.h>
#include <ola/timecode/TimeCode.h>
#include <memory>
#include <string>
namespace ola {
namespace client {
/**
* @class OlaClient ola/client/OlaClient.h
* @brief The callback based C++ client for OLA.
*/
class OlaClient {
public:
explicit OlaClient(ola::io::ConnectedDescriptor *descriptor);
~OlaClient();
/*
* @brief Setup this client.
* @returns true on success, false on failure
*/
bool Setup();
/*
* @brief Close the ola connection.
* @return true on sucess, false on failure
*/
bool Stop();
/**
* @brief Set the close handler.
*/
void SetCloseHandler(ola::SingleUseCallback0<void> *callback);
/**
* @brief 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().
* @param callback the callback to run upon receiving new DMX data.
*/
void SetDMXCallback(RepeatableDMXCallback *callback);
/**
* @brief Trigger a plugin reload.
* @param callback the SetCallback to invoke upon completion.
*/
void ReloadPlugins(SetCallback *callback);
/**
* @brief Fetch the list of plugins loaded.
* @param callback the PluginListCallback to be invoked upon completion.
*/
void FetchPluginList(PluginListCallback *callback);
/**
* @brief Fetch the description for a plugin.
* @param plugin_id the id of the plugin to fetch the state for.
* @param callback the PluginDescriptionCallback to be invoked upon
* completion.
*/
void FetchPluginDescription(ola_plugin_id plugin_id,
PluginDescriptionCallback *callback);
/**
* @brief Fetch the state of a plugin.
*
* This returns the state and the list of plugins this plugin conflicts with.
* @param plugin_id the id of the plugin to fetch the state for.
* @param callback the PluginStateCallback to be invoked upon completion.
*/
void FetchPluginState(ola_plugin_id plugin_id,
PluginStateCallback *callback);
/**
* @brief Request a list of the available devices.
* @param plugin_filter only fetch devices that belong to the specified
* plugin.
* @param callback the DeviceInfoCallback to be invoked upon completion.
*/
void FetchDeviceInfo(ola_plugin_id plugin_filter,
DeviceInfoCallback *callback);
/**
* @brief Request a list of ports that could be patched to new universe.
* @param callback the CandidatePortsCallback invoked upon completion.
*/
void FetchCandidatePorts(CandidatePortsCallback *callback);
/**
* @brief Request a list of ports that could be patched to a particular
* universe.
* @param universe_id the id of the universe to fetch the candidate ports
* for.
* @param callback the CandidatePortsCallback invoked upon completion.
*/
void FetchCandidatePorts(unsigned int universe_id,
CandidatePortsCallback *callback);
/**
* @brief Set the state of a plugin.
* @param plugin_id the id of the plugin to set the state of.
* @param state the state to set the plugin to
* @param callback the SetCallback to invoke upon completion.
*/
void SetPluginState(ola_plugin_id plugin_id,
bool state,
SetCallback *callback);
/**
* @brief Send a device config request.
* @param device_alias the device alias of the device to configure.
* @param msg the blob of data to send to the device.
* @param callback the ConfigureDeviceCallback invoked upon completion.
*/
void ConfigureDevice(unsigned int device_alias,
const std::string &msg,
ConfigureDeviceCallback *callback);
/**
* @brief Set the priority for a port to inherit mode.
* @param device_alias the device containing the port to change
* @param port the port id of the port to change.
* @param port_direction the direction of the port.
* @param callback the SetCallback to invoke upon completion.
*/
void SetPortPriorityInherit(unsigned int device_alias,
unsigned int port,
PortDirection port_direction,
SetCallback *callback);
/**
* @brief Set the priority for a port to override mode
* @param device_alias the device containing the port to change
* @param port the port id of the port to change.
* @param port_direction the direction of the port.
* @param value the new port priority value.
* @param callback the SetCallback to invoke upon completion.
*/
void SetPortPriorityOverride(unsigned int device_alias,
unsigned int port,
PortDirection port_direction,
uint8_t value,
SetCallback *callback);
/**
* @brief Request a list of universes.
* @param callback the UniverseListCallback to invoke upon completion.
*/
void FetchUniverseList(UniverseListCallback *callback);
/**
* @brief Fetch the information for a given universe.
* @param universe the id of the universe.
* @param callback the UniverseInfoCallback to invoke upon completion.
*/
void FetchUniverseInfo(unsigned int universe,
UniverseInfoCallback *callback);
/**
* @brief Set the name of a universe.
* @param universe the id of the universe
* @param name the new name to use.
* @param callback the SetCallback to invoke upon completion.
*/
void SetUniverseName(unsigned int universe,
const std::string &name,
SetCallback *callback);
/**
* @brief Set the merge mode of a universe.
* @param universe the id of the universe
* @param mode the new merge mode
* @param callback the SetCallback to invoke upon completion.
*/
void SetUniverseMergeMode(unsigned int universe,
OlaUniverse::merge_mode mode,
SetCallback *callback);
/**
* @brief Patch or unpatch a port from a universe.
* @param device_alias the device containing the port to change
* @param port the port id of the port to change.
* @param port_direction the direction of the port.
* @param action OlaClientCore::PATCH or OlaClientCore::UNPATCH.
* @param universe universe id to patch the port to.
* @param callback the SetCallback to invoke upon completion.
*/
void Patch(unsigned int device_alias,
unsigned int port,
PortDirection port_direction,
PatchAction action,
unsigned int universe,
SetCallback *callback);
/**
* @brief Register our interest in a universe.
*
* The callback set by SetDMXCallback() will be called when new DMX data
* arrives.
* @param universe the id of the universe to register for.
* @param register_action the action (register or unregister)
* @param callback the SetCallback to invoke upon completion.
*/
void RegisterUniverse(unsigned int universe,
RegisterAction register_action,
SetCallback *callback);
/**
* @brief Send DMX data.
* @param universe the universe to send to.
* @param data the DmxBuffer with the data
* @param args the SendDMXArgs to use for this call.
*/
void SendDMX(unsigned int universe,
const DmxBuffer &data,
const SendDMXArgs &args);
/**
* @brief Fetch the latest DMX data for a universe.
* @param universe the universe id to get data for.
* @param callback the SetCallback to invoke upon completion.
*/
void FetchDMX(unsigned int universe, DMXCallback *callback);
/**
* @brief Trigger discovery for a universe.
* @param universe the universe id to run discovery on.
* @param discovery_type the type of discovery to run before returning.
* @param callback the UIDListCallback to invoke upon completion.
*/
void RunDiscovery(unsigned int universe,
DiscoveryType discovery_type,
DiscoveryCallback *callback);
/**
* @brief Set the source UID for this client.
* @param uid the UID to use when sending RDM messages from this client.
* @param callback the SetCallback to invoke upon completion.
*/
void SetSourceUID(const ola::rdm::UID &uid, SetCallback *callback);
/**
* @brief Send an RDM Get Command.
* @param universe the universe to send the command on
* @param uid the UID to send the command to
* @param sub_device the sub device index
* @param pid the PID to address
* @param data the optional data to send
* @param data_length the length of the data
* @param args the RDM arguments which includes the callback to run.
*/
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);
/**
* @brief Send an RDM Set Command.
* @param universe the universe to send the command on
* @param uid the UID to send the command to
* @param sub_device the sub device index
* @param pid the PID to address
* @param data the optional data to send
* @param data_length the length of the data
* @param args the RDM arguments which includes the callback to run.
*/
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);
/**
* @brief Send TimeCode data.
* @param timecode The timecode data.
* @param callback the SetCallback to invoke when the send completes.
*/
void SendTimeCode(const ola::timecode::TimeCode &timecode,
SetCallback *callback);
private:
std::auto_ptr<class OlaClientCore> m_core;
DISALLOW_COPY_AND_ASSIGN(OlaClient);
};
} // namespace client
} // namespace ola
#endif // INCLUDE_OLA_CLIENT_OLACLIENT_H_
|