23 #include "common/protocol/Ola.pb.h"
26 #include "olad/ClientBroker.h"
28 #ifndef OLAD_OLASERVERSERVICEIMPL_H_
29 #define OLAD_OLASERVERSERVICEIMPL_H_
33 using google::protobuf::RpcController;
34 using ola::proto::Ack;
54 m_universe_store(universe_store),
55 m_device_manager(device_manager),
56 m_plugin_manager(plugin_manager),
57 m_export_map(export_map),
58 m_port_manager(port_manager),
60 m_wake_up_time(wake_up_time),
64 void GetDmx(RpcController* controller,
65 const ola::proto::UniverseRequest* request,
66 ola::proto::DmxData* response,
67 google::protobuf::Closure* done);
68 void RegisterForDmx(RpcController* controller,
69 const ola::proto::RegisterDmxRequest* request,
71 google::protobuf::Closure* done,
73 void UpdateDmxData(RpcController* controller,
74 const ola::proto::DmxData* request,
76 google::protobuf::Closure* done,
78 void StreamDmxData(RpcController* controller,
79 const ::ola::proto::DmxData* request,
80 ::ola::proto::STREAMING_NO_RESPONSE* response,
81 ::google::protobuf::Closure* done,
83 void SetUniverseName(RpcController* controller,
84 const ola::proto::UniverseNameRequest* request,
86 google::protobuf::Closure* done);
87 void SetMergeMode(RpcController* controller,
88 const ola::proto::MergeModeRequest* request,
90 google::protobuf::Closure* done);
91 void PatchPort(RpcController* controller,
92 const ola::proto::PatchPortRequest* request,
94 google::protobuf::Closure* done);
95 void SetPortPriority(RpcController* controller,
96 const ola::proto::PortPriorityRequest* request,
98 google::protobuf::Closure* done);
99 void GetUniverseInfo(RpcController* controller,
100 const ola::proto::OptionalUniverseRequest* request,
101 ola::proto::UniverseInfoReply* response,
102 google::protobuf::Closure* done);
103 void GetPlugins(RpcController* controller,
104 const ola::proto::PluginListRequest* request,
105 ola::proto::PluginListReply* response,
106 google::protobuf::Closure* done);
107 void GetPluginDescription(
108 RpcController* controller,
109 const ola::proto::PluginDescriptionRequest* request,
110 ola::proto::PluginDescriptionReply* response,
111 google::protobuf::Closure* done);
113 RpcController* controller,
114 const ola::proto::PluginStateRequest* request,
115 ola::proto::PluginStateReply* response,
116 google::protobuf::Closure* done);
117 void GetDeviceInfo(RpcController* controller,
118 const ola::proto::DeviceInfoRequest* request,
119 ola::proto::DeviceInfoReply* response,
120 google::protobuf::Closure* done);
121 void GetCandidatePorts(RpcController* controller,
122 const ola::proto::OptionalUniverseRequest* request,
123 ola::proto::DeviceInfoReply* response,
124 google::protobuf::Closure* done);
125 void ConfigureDevice(RpcController* controller,
126 const ola::proto::DeviceConfigRequest* request,
127 ola::proto::DeviceConfigReply* response,
128 google::protobuf::Closure* done);
129 void GetUIDs(RpcController* controller,
130 const ola::proto::UniverseRequest* request,
131 ola::proto::UIDListReply* response,
132 google::protobuf::Closure* done);
133 void ForceDiscovery(RpcController* controller,
134 const ola::proto::DiscoveryRequest* request,
135 ola::proto::UIDListReply* response,
136 google::protobuf::Closure* done);
137 void RDMCommand(RpcController* controller,
138 const ::ola::proto::RDMRequest* request,
139 ola::proto::RDMResponse* response,
140 google::protobuf::Closure* done,
143 void RDMDiscoveryCommand(RpcController* controller,
144 const ::ola::proto::RDMDiscoveryRequest* request,
145 ola::proto::RDMResponse* response,
146 google::protobuf::Closure* done,
149 void SetSourceUID(RpcController* controller,
150 const ::ola::proto::UID* request,
151 ola::proto::Ack* response,
152 google::protobuf::Closure* done);
155 const ::ola::proto::TimeCode* request,
156 ::ola::proto::Ack* response,
157 ::google::protobuf::Closure* done);
160 void HandleRDMResponse(ola::proto::RDMResponse* response,
161 google::protobuf::Closure* done,
162 bool include_raw_packets,
163 ola::rdm::rdm_response_code code,
165 const std::vector<std::string> &packets);
166 void RDMDiscoveryComplete(
unsigned int universe,
167 google::protobuf::Closure* done,
168 ola::proto::UIDListReply *response,
171 void MissingUniverseError(RpcController* controller);
172 void MissingPluginError(RpcController* controller);
173 void MissingDeviceError(RpcController* controller);
174 void MissingPortError(RpcController* controller);
177 ola::proto::PluginInfo *plugin_info)
const;
180 ola::proto::DeviceInfoReply* response)
const;
182 template <
class PortClass>
183 void PopulatePort(
const PortClass &port,
184 ola::proto::PortInfo *port_info)
const;
213 void GetDmx(RpcController* controller,
214 const ola::proto::UniverseRequest* request,
215 ola::proto::DmxData* response,
216 google::protobuf::Closure* done) {
217 m_impl->GetDmx(controller, request, response, done);
220 void RegisterForDmx(RpcController* controller,
221 const ola::proto::RegisterDmxRequest* request,
223 google::protobuf::Closure* done) {
224 m_impl->RegisterForDmx(controller, request, response, done, m_client);
227 void UpdateDmxData(RpcController* controller,
228 const ola::proto::DmxData* request,
230 google::protobuf::Closure* done) {
231 m_impl->UpdateDmxData(controller, request, response, done, m_client);
234 void StreamDmxData(RpcController* controller,
235 const ::ola::proto::DmxData* request,
236 ::ola::proto::STREAMING_NO_RESPONSE* response,
237 ::google::protobuf::Closure* done) {
238 m_impl->StreamDmxData(controller, request, response, done, m_client);
241 void SetUniverseName(RpcController* controller,
242 const ola::proto::UniverseNameRequest* request,
244 google::protobuf::Closure* done) {
245 m_impl->SetUniverseName(controller, request, response, done);
248 void SetMergeMode(RpcController* controller,
249 const ola::proto::MergeModeRequest* request,
251 google::protobuf::Closure* done) {
252 m_impl->SetMergeMode(controller, request, response, done);
255 void PatchPort(RpcController* controller,
256 const ola::proto::PatchPortRequest* request,
258 google::protobuf::Closure* done) {
259 m_impl->PatchPort(controller, request, response, done);
262 void SetPortPriority(RpcController* controller,
263 const ola::proto::PortPriorityRequest* request,
265 google::protobuf::Closure* done) {
266 m_impl->SetPortPriority(controller, request, response, done);
269 void GetUniverseInfo(RpcController* controller,
270 const ola::proto::OptionalUniverseRequest* request,
271 ola::proto::UniverseInfoReply* response,
272 google::protobuf::Closure* done) {
273 m_impl->GetUniverseInfo(controller, request, response, done);
276 void GetPlugins(RpcController* controller,
277 const ola::proto::PluginListRequest* request,
278 ola::proto::PluginListReply* response,
279 google::protobuf::Closure* done) {
280 m_impl->GetPlugins(controller, request, response, done);
283 void GetPluginDescription(
284 RpcController* controller,
285 const ola::proto::PluginDescriptionRequest* request,
286 ola::proto::PluginDescriptionReply* response,
287 google::protobuf::Closure* done) {
288 m_impl->GetPluginDescription(controller, request, response, done);
292 RpcController* controller,
293 const ola::proto::PluginStateRequest* request,
294 ola::proto::PluginStateReply* response,
295 google::protobuf::Closure* done) {
296 m_impl->GetPluginState(controller, request, response, done);
299 void GetDeviceInfo(RpcController* controller,
300 const ola::proto::DeviceInfoRequest* request,
301 ola::proto::DeviceInfoReply* response,
302 google::protobuf::Closure* done) {
303 m_impl->GetDeviceInfo(controller, request, response, done);
306 void GetCandidatePorts(RpcController* controller,
307 const ola::proto::OptionalUniverseRequest* request,
308 ola::proto::DeviceInfoReply* response,
309 google::protobuf::Closure* done) {
310 m_impl->GetCandidatePorts(controller, request, response, done);
313 void ConfigureDevice(RpcController* controller,
314 const ola::proto::DeviceConfigRequest* request,
315 ola::proto::DeviceConfigReply* response,
316 google::protobuf::Closure* done) {
317 m_impl->ConfigureDevice(controller, request, response, done);
320 void GetUIDs(RpcController* controller,
321 const ola::proto::UniverseRequest* request,
322 ola::proto::UIDListReply* response,
323 google::protobuf::Closure* done) {
324 m_impl->GetUIDs(controller, request, response, done);
327 void ForceDiscovery(RpcController* controller,
328 const ola::proto::DiscoveryRequest* request,
329 ola::proto::UIDListReply* response,
330 google::protobuf::Closure* done) {
331 m_impl->ForceDiscovery(controller, request, response, done);
334 void RDMCommand(RpcController* controller,
335 const ::ola::proto::RDMRequest* request,
336 ola::proto::RDMResponse* response,
337 google::protobuf::Closure* done) {
338 m_impl->RDMCommand(controller, request, response, done, m_uid, m_client);
341 void RDMDiscoveryCommand(RpcController* controller,
342 const ::ola::proto::RDMDiscoveryRequest* request,
343 ola::proto::RDMResponse* response,
344 google::protobuf::Closure* done) {
345 m_impl->RDMDiscoveryCommand(controller, request, response, done, m_uid,
349 void SetSourceUID(RpcController* controller,
350 const ::ola::proto::UID* request,
351 ola::proto::Ack* response,
352 google::protobuf::Closure* done);
354 void SendTimeCode(RpcController* controller,
355 const ::ola::proto::TimeCode* request,
356 ::ola::proto::Ack* response,
357 ::google::protobuf::Closure* done) {
358 m_impl->
SendTimeCode(controller, request, response, done);
361 Client *GetClient()
const {
return m_client; }
379 #endif // OLAD_OLASERVERSERVICEIMPL_H_