21 #ifndef OLA_OLACLIENTCORE_H_
22 #define OLA_OLACLIENTCORE_H_
24 #include <google/protobuf/stubs/common.h>
29 #include "common/protocol/Ola.pb.h"
30 #include "common/rpc/SimpleRpcController.h"
31 #include "common/rpc/StreamRpcChannel.h"
34 #include "ola/OlaCallbackClient.h"
35 #include "ola/OlaDevice.h"
36 #include "ola/common.h"
37 #include "ola/network/Socket.h"
38 #include "ola/plugin_id.h"
42 #include "ola/timecode/TimeCode.h"
46 class OlaClientCoreServiceImpl;
72 const vector<class OlaPlugin>&,
73 const string&> *callback);
75 bool FetchPluginDescription(
76 ola_plugin_id plugin_id,
86 const vector <class OlaDevice>&,
87 const string&> *callback);
89 bool FetchCandidatePorts(
91 const vector <class OlaDevice>&,
92 const string&> *callback);
94 bool FetchCandidatePorts(
95 unsigned int universe_id,
97 const vector <class OlaDevice>&,
98 const string&> *callback);
100 bool ConfigureDevice(
101 unsigned int device_alias,
106 bool SetPortPriorityInherit(
107 unsigned int device_alias,
109 PortDirection port_direction,
111 bool SetPortPriorityOverride(
112 unsigned int device_alias,
114 PortDirection port_direction,
119 bool FetchUniverseList(
121 const vector <class OlaUniverse>&,
122 const string &> *callback);
123 bool FetchUniverseInfo(
124 unsigned int universe,
127 const string &> *callback);
128 bool SetUniverseName(
132 bool SetUniverseMergeMode(
134 OlaUniverse::merge_mode mode,
139 unsigned int device_alias,
141 ola::PortDirection port_direction,
142 ola::PatchAction action,
150 bool RegisterUniverse(
151 unsigned int universe,
152 ola::RegisterAction register_action,
155 unsigned int universe,
159 unsigned int universe,
162 bool SendDmx(
unsigned int universe,
const DmxBuffer &data);
164 unsigned int universe,
169 unsigned int universe,
172 const string&> *callback);
174 unsigned int universe,
178 const string&> *callback);
183 unsigned int universe,
188 unsigned int data_length);
190 unsigned int universe,
195 unsigned int data_length);
197 unsigned int universe,
202 unsigned int data_length);
204 unsigned int universe,
209 unsigned int data_length);
218 void UpdateDmxData(::google::protobuf::RpcController* controller,
219 const ola::proto::DmxData* request,
220 ola::proto::Ack* response,
221 ::google::protobuf::Closure* done);
228 ola::proto::PluginListReply *reply;
230 const vector<class OlaPlugin>&,
231 const string&> *callback;
238 ola::proto::PluginDescriptionReply *reply;
246 ola::proto::PluginStateReply *reply;
254 ola::proto::DeviceInfoReply *reply;
256 const vector <class OlaDevice> &,
257 const string &> *callback;
264 ola::proto::DeviceConfigReply *reply;
272 ola::proto::Ack *reply;
280 ola::proto::UniverseInfoReply *reply;
282 const vector <class OlaUniverse>&,
283 const string&> *callback;
290 ola::proto::UniverseInfoReply *reply;
298 ola::proto::DmxData *reply;
306 ola::proto::UIDListReply *reply;
309 const string&> *callback;
317 ola::proto::RDMResponse *reply;
325 ola::proto::RDMResponse *reply;
335 unsigned int universe,
339 bool GenericFetchCandidatePorts(
340 unsigned int universe_id,
341 bool include_universe,
343 const vector <class OlaDevice>&,
344 const string&> *callback);
348 unsigned int universe,
353 unsigned int data_length);
354 bool RDMCommandWithPid(
357 unsigned int universe,
362 unsigned int data_length);
365 ola::proto::RDMResponse *reply,
368 void GetParamFromReply(
369 const string &message_type,
370 ola::proto::RDMResponse *reply,
373 void UpdateResponseAckData(
374 ola::proto::RDMResponse *reply,
377 template <
typename arg_type,
typename reply_type,
typename callback_type>
381 callback_type callback);
383 template <
typename arg_type>
384 void FreeArgs(arg_type *args);
387 std::auto_ptr<DmxCallback> m_dmx_callback;
388 std::auto_ptr<DmxCallbackWithPriority> m_dmx_callback_with_priority;
390 ola::proto::OlaServerService_Stub *m_stub;
398 template <
typename arg_type,
typename reply_type,
typename callback_type>
399 arg_type *OlaClientCore::NewArgs(
402 callback_type callback) {
403 arg_type *args =
new arg_type();
404 args->controller = controller;
406 args->callback = callback;
414 template <
typename arg_type>
415 void OlaClientCore::FreeArgs(arg_type *args) {
416 delete args->controller;
421 #endif // OLA_OLACLIENTCORE_H_