Open Lighting Architecture 0.10.9
Loading...
Searching...
No Matches
RDMHTTPModule.h
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU Library General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15 *
16 * RDMHTTPModule.h
17 * This module acts as the HTTP -> olad gateway for RDM commands.
18 * Copyright (C) 2010 Simon Newton
19 */
20
21#ifndef OLAD_RDMHTTPMODULE_H_
22#define OLAD_RDMHTTPMODULE_H_
23
24#include <map>
25#include <queue>
26#include <string>
27#include <utility>
28#include <vector>
29#include "ola/base/Macro.h"
30#include "ola/client/ClientRDMAPIShim.h"
31#include "ola/client/OlaClient.h"
32#include "ola/http/HTTPServer.h"
33#include "ola/rdm/PidStore.h"
34#include "ola/rdm/RDMAPI.h"
35#include "ola/rdm/UID.h"
36#include "ola/thread/Mutex.h"
37#include "ola/web/JsonSections.h"
38
39namespace ola {
40
41
42/*
43 * The module that deals with RDM requests.
44 */
46 public:
50
51 void SetPidStore(const ola::rdm::RootPidStore *pid_store);
52
53 int RunRDMDiscovery(const ola::http::HTTPRequest *request,
54 ola::http::HTTPResponse *response);
55
56 int JsonUIDs(const ola::http::HTTPRequest *request,
57 ola::http::HTTPResponse *response);
58
59 // these are used by the RDM Patcher
60 int JsonUIDInfo(const ola::http::HTTPRequest *request,
61 ola::http::HTTPResponse *response);
63 ola::http::HTTPResponse *response);
65 ola::http::HTTPResponse *response);
66
67 // these are used by the RDM Attributes Panel
69 ola::http::HTTPResponse *response);
71 ola::http::HTTPResponse *response);
72 int JsonSectionInfo(const ola::http::HTTPRequest *request,
73 ola::http::HTTPResponse *response);
75 ola::http::HTTPResponse *response);
76
77 void PruneUniverseList(const std::vector<client::OlaUniverse> &universes);
78
79 private:
80 typedef struct {
81 std::string manufacturer;
82 std::string device;
83 bool active;
84 } resolved_uid;
85
86 typedef enum {
87 RESOLVE_MANUFACTURER,
88 RESOLVE_DEVICE,
89 } uid_resolve_action;
90
91 typedef struct {
92 std::map<ola::rdm::UID, resolved_uid> resolved_uids;
93 std::queue<std::pair<ola::rdm::UID, uid_resolve_action> > pending_uids;
94 bool uid_resolution_running;
95 bool active;
96 } uid_resolution_state;
97
98 ola::http::HTTPServer *m_server;
99 ola::client::OlaClient *m_client;
101 ola::rdm::RDMAPI m_rdm_api;
102 std::map<unsigned int, uid_resolution_state*> m_universe_uids;
103
104 ola::thread::Mutex m_pid_store_mu;
105 const ola::rdm::RootPidStore *m_pid_store; // GUARDED_BY(m_pid_store_mu);
106
107 typedef struct {
108 std::string id;
109 std::string name;
110 std::string hint;
111 } section_info;
112
113 struct lt_section_info {
114 bool operator()(const section_info &left, const section_info &right) {
115 return left.name < right.name;
116 }
117 };
118
119 typedef struct {
120 unsigned int universe_id;
121 const ola::rdm::UID uid;
122 std::string hint;
123 std::string device_model;
124 std::string software_version;
125 } device_info;
126
127 typedef struct {
128 unsigned int universe_id;
129 const ola::rdm::UID *uid;
130 bool include_descriptions;
131 bool return_as_section;
132 unsigned int active;
133 unsigned int next;
134 unsigned int total;
135 std::vector<std::pair<uint32_t, std::string> > personalities;
136 } personality_info;
137
138 // UID resolution methods
139 void HandleUIDList(ola::http::HTTPResponse *response,
140 unsigned int universe_id,
141 const client::Result &result,
142 const ola::rdm::UIDSet &uids);
143
144 void ResolveNextUID(unsigned int universe_id);
145
146 void UpdateUIDManufacturerLabel(unsigned int universe,
147 ola::rdm::UID uid,
148 const ola::rdm::ResponseStatus &status,
149 const std::string &device_label);
150
151 void UpdateUIDDeviceLabel(unsigned int universe,
152 ola::rdm::UID uid,
153 const ola::rdm::ResponseStatus &status,
154 const std::string &device_label);
155
156 uid_resolution_state *GetUniverseUids(unsigned int universe);
157 uid_resolution_state *GetUniverseUidsOrCreate(unsigned int universe);
158
159 // uid info handler
160 void UIDInfoHandler(ola::http::HTTPResponse *response,
161 const ola::rdm::ResponseStatus &status,
162 const ola::rdm::DeviceDescriptor &device);
163
164 // uid identify handler
165 void UIDIdentifyDeviceHandler(ola::http::HTTPResponse *response,
166 const ola::rdm::ResponseStatus &status,
167 bool value);
168
169 // personality handler
170 void SendPersonalityResponse(ola::http::HTTPResponse *response,
171 personality_info *info);
172
173
174 // supported params / sections
175 void SupportedParamsHandler(ola::http::HTTPResponse *response,
176 const ola::rdm::ResponseStatus &status,
177 const std::vector<uint16_t> &pids);
178 void SupportedSectionsHandler(ola::http::HTTPResponse *response,
179 unsigned int universe,
180 ola::rdm::UID uid,
181 const ola::rdm::ResponseStatus &status,
182 const std::vector<uint16_t> &pids);
183 void SupportedSectionsDeviceInfoHandler(
184 ola::http::HTTPResponse *response,
185 const std::vector<uint16_t> pids,
186 const ola::rdm::ResponseStatus &status,
187 const ola::rdm::DeviceDescriptor &device);
188
189 // section methods
190 std::string GetCommStatus(ola::http::HTTPResponse *response,
191 unsigned int universe_id,
192 const ola::rdm::UID &uid);
193
194 void CommStatusHandler(ola::http::HTTPResponse *response,
195 const ola::rdm::ResponseStatus &status,
196 uint16_t short_messages,
197 uint16_t length_mismatch,
198 uint16_t checksum_fail);
199
200 std::string ClearCommsCounters(ola::http::HTTPResponse *response,
201 unsigned int universe_id,
202 const ola::rdm::UID &uid);
203
204 std::string GetProxiedDevices(ola::http::HTTPResponse *response,
205 unsigned int universe_id,
206 const ola::rdm::UID &uid);
207
208
209 void ProxiedDevicesHandler(ola::http::HTTPResponse *response,
210 unsigned int universe_id,
211 const ola::rdm::ResponseStatus &status,
212 const std::vector<ola::rdm::UID> &uids);
213
214 std::string GetDeviceInfo(const ola::http::HTTPRequest *request,
215 ola::http::HTTPResponse *response,
216 unsigned int universe_id,
217 const ola::rdm::UID &uid);
218
219 void GetSoftwareVersionHandler(ola::http::HTTPResponse *response,
220 device_info dev_info,
221 const ola::rdm::ResponseStatus &status,
222 const std::string &software_version);
223
224 void GetDeviceModelHandler(ola::http::HTTPResponse *response,
225 device_info dev_info,
226 const ola::rdm::ResponseStatus &status,
227 const std::string &device_model);
228
229 void GetDeviceInfoHandler(ola::http::HTTPResponse *response,
230 device_info dev_info,
231 const ola::rdm::ResponseStatus &status,
232 const ola::rdm::DeviceDescriptor &device);
233
234 std::string GetProductIds(const ola::http::HTTPRequest *request,
235 ola::http::HTTPResponse *response,
236 unsigned int universe_id,
237 const ola::rdm::UID &uid);
238
239 void GetProductIdsHandler(ola::http::HTTPResponse *response,
240 const ola::rdm::ResponseStatus &status,
241 const std::vector<uint16_t> &ids);
242
243 std::string GetManufacturerLabel(const ola::http::HTTPRequest *request,
244 ola::http::HTTPResponse *response,
245 unsigned int universe_id,
246 const ola::rdm::UID &uid);
247
248 void GetManufacturerLabelHandler(ola::http::HTTPResponse *response,
249 unsigned int universe_id,
250 const ola::rdm::UID uid,
251 const ola::rdm::ResponseStatus &status,
252 const std::string &label);
253
254 std::string GetDeviceLabel(const ola::http::HTTPRequest *request,
255 ola::http::HTTPResponse *response,
256 unsigned int universe_id,
257 const ola::rdm::UID &uid);
258
259 void GetDeviceLabelHandler(ola::http::HTTPResponse *response,
260 unsigned int universe_id,
261 const ola::rdm::UID uid,
262 const ola::rdm::ResponseStatus &status,
263 const std::string &label);
264
265 std::string SetDeviceLabel(const ola::http::HTTPRequest *request,
266 ola::http::HTTPResponse *response,
267 unsigned int universe_id,
268 const ola::rdm::UID &uid);
269
270 std::string GetFactoryDefaults(ola::http::HTTPResponse *response,
271 unsigned int universe_id,
272 const ola::rdm::UID &uid);
273
274 void FactoryDefaultsHandler(ola::http::HTTPResponse *response,
275 const ola::rdm::ResponseStatus &status,
276 bool defaults);
277
278 std::string SetFactoryDefault(ola::http::HTTPResponse *response,
279 unsigned int universe_id,
280 const ola::rdm::UID &uid);
281
282 std::string GetLanguage(ola::http::HTTPResponse *response,
283 unsigned int universe_id,
284 const ola::rdm::UID &uid);
285
286 void GetSupportedLanguagesHandler(
287 ola::http::HTTPResponse *response,
288 unsigned int universe_id,
289 const ola::rdm::UID uid,
290 const ola::rdm::ResponseStatus &status,
291 const std::vector<std::string> &languages);
292
293 void GetLanguageHandler(ola::http::HTTPResponse *response,
294 std::vector<std::string> languages,
295 const ola::rdm::ResponseStatus &status,
296 const std::string &language);
297
298 std::string SetLanguage(const ola::http::HTTPRequest *request,
299 ola::http::HTTPResponse *response,
300 unsigned int universe_id,
301 const ola::rdm::UID &uid);
302
303 std::string GetBootSoftware(ola::http::HTTPResponse *response,
304 unsigned int universe_id,
305 const ola::rdm::UID &uid);
306
307 void GetBootSoftwareLabelHandler(ola::http::HTTPResponse *response,
308 unsigned int universe_id,
309 const ola::rdm::UID uid,
310 const ola::rdm::ResponseStatus &status,
311 const std::string &label);
312
313 void GetBootSoftwareVersionHandler(
314 ola::http::HTTPResponse *response,
315 std::string label,
316 const ola::rdm::ResponseStatus &status,
317 uint32_t version);
318
319 std::string GetPersonalities(const ola::http::HTTPRequest *request,
320 ola::http::HTTPResponse *response,
321 unsigned int universe_id,
322 const ola::rdm::UID &uid,
323 bool return_as_section,
324 bool include_description = false);
325
326 void GetPersonalityHandler(
327 ola::http::HTTPResponse *response,
328 personality_info *info,
329 const ola::rdm::ResponseStatus &status,
330 uint8_t current,
331 uint8_t total);
332
333 void GetNextPersonalityDescription(ola::http::HTTPResponse *response,
334 personality_info *info);
335
336 void GetPersonalityLabelHandler(
337 ola::http::HTTPResponse *response,
338 personality_info *info,
339 const ola::rdm::ResponseStatus &status,
340 uint8_t personality,
341 uint16_t slot_count,
342 const std::string &label);
343
344 void SendSectionPersonalityResponse(ola::http::HTTPResponse *response,
345 personality_info *info);
346
347 std::string SetPersonality(const ola::http::HTTPRequest *request,
348 ola::http::HTTPResponse *response,
349 unsigned int universe_id,
350 const ola::rdm::UID &uid);
351
352 std::string GetStartAddress(const ola::http::HTTPRequest *request,
353 ola::http::HTTPResponse *response,
354 unsigned int universe_id,
355 const ola::rdm::UID &uid);
356
357 void GetStartAddressHandler(ola::http::HTTPResponse *response,
358 const ola::rdm::ResponseStatus &status,
359 uint16_t address);
360
361 std::string SetStartAddress(const ola::http::HTTPRequest *request,
362 ola::http::HTTPResponse *response,
363 unsigned int universe_id,
364 const ola::rdm::UID &uid);
365
366 std::string GetSensor(const ola::http::HTTPRequest *request,
367 ola::http::HTTPResponse *response,
368 unsigned int universe_id,
369 const ola::rdm::UID &uid);
370
371 void SensorDefinitionHandler(ola::http::HTTPResponse *response,
372 unsigned int universe_id,
373 const ola::rdm::UID uid,
374 uint8_t sensor_id,
375 const ola::rdm::ResponseStatus &status,
376 const ola::rdm::SensorDescriptor &definition);
377
378 void SensorValueHandler(ola::http::HTTPResponse *response,
379 ola::rdm::SensorDescriptor *definition,
380 const ola::rdm::ResponseStatus &status,
381 const ola::rdm::SensorValueDescriptor &value);
382
383 std::string RecordSensor(const ola::http::HTTPRequest *request,
384 ola::http::HTTPResponse *response,
385 unsigned int universe_id,
386 const ola::rdm::UID &uid);
387
388 std::string GetDeviceHours(const ola::http::HTTPRequest *request,
389 ola::http::HTTPResponse *response,
390 unsigned int universe_id,
391 const ola::rdm::UID &uid);
392
393 std::string SetDeviceHours(const ola::http::HTTPRequest *request,
394 ola::http::HTTPResponse *response,
395 unsigned int universe_id,
396 const ola::rdm::UID &uid);
397
398 std::string GetLampHours(const ola::http::HTTPRequest *request,
399 ola::http::HTTPResponse *response,
400 unsigned int universe_id,
401 const ola::rdm::UID &uid);
402
403 std::string SetLampHours(const ola::http::HTTPRequest *request,
404 ola::http::HTTPResponse *response,
405 unsigned int universe_id,
406 const ola::rdm::UID &uid);
407
408 std::string GetLampStrikes(const ola::http::HTTPRequest *request,
409 ola::http::HTTPResponse *response,
410 unsigned int universe_id,
411 const ola::rdm::UID &uid);
412
413 std::string SetLampStrikes(const ola::http::HTTPRequest *request,
414 ola::http::HTTPResponse *response,
415 unsigned int universe_id,
416 const ola::rdm::UID &uid);
417
418 std::string GetLampState(const ola::http::HTTPRequest *request,
419 ola::http::HTTPResponse *response,
420 unsigned int universe_id,
421 const ola::rdm::UID &uid);
422
423 void LampStateHandler(ola::http::HTTPResponse *response,
424 const ola::rdm::ResponseStatus &status,
425 uint8_t state);
426
427 std::string SetLampState(const ola::http::HTTPRequest *request,
428 ola::http::HTTPResponse *response,
429 unsigned int universe_id,
430 const ola::rdm::UID &uid);
431
432 std::string GetLampMode(const ola::http::HTTPRequest *request,
433 ola::http::HTTPResponse *response,
434 unsigned int universe_id,
435 const ola::rdm::UID &uid);
436
437 void LampModeHandler(ola::http::HTTPResponse *response,
438 const ola::rdm::ResponseStatus &status,
439 uint8_t mode);
440
441 std::string SetLampMode(const ola::http::HTTPRequest *request,
442 ola::http::HTTPResponse *response,
443 unsigned int universe_id,
444 const ola::rdm::UID &uid);
445
446 std::string GetPowerCycles(const ola::http::HTTPRequest *request,
447 ola::http::HTTPResponse *response,
448 unsigned int universe_id,
449 const ola::rdm::UID &uid);
450
451 std::string SetPowerCycles(const ola::http::HTTPRequest *request,
452 ola::http::HTTPResponse *response,
453 unsigned int universe_id,
454 const ola::rdm::UID &uid);
455
456 std::string GetDisplayInvert(ola::http::HTTPResponse *response,
457 unsigned int universe_id,
458 const ola::rdm::UID &uid);
459
460 void DisplayInvertHandler(ola::http::HTTPResponse *response,
461 const ola::rdm::ResponseStatus &status,
462 uint8_t value);
463
464 std::string SetDisplayInvert(const ola::http::HTTPRequest *request,
465 ola::http::HTTPResponse *response,
466 unsigned int universe_id,
467 const ola::rdm::UID &uid);
468
469 std::string GetDisplayLevel(ola::http::HTTPResponse *response,
470 unsigned int universe_id,
471 const ola::rdm::UID &uid);
472
473 void DisplayLevelHandler(ola::http::HTTPResponse *response,
474 const ola::rdm::ResponseStatus &status,
475 uint8_t value);
476
477 std::string SetDisplayLevel(const ola::http::HTTPRequest *request,
478 ola::http::HTTPResponse *response,
479 unsigned int universe_id,
480 const ola::rdm::UID &uid);
481
482 std::string GetPanInvert(ola::http::HTTPResponse *response,
483 unsigned int universe_id,
484 const ola::rdm::UID &uid);
485
486 std::string SetPanInvert(const ola::http::HTTPRequest *request,
487 ola::http::HTTPResponse *response,
488 unsigned int universe_id,
489 const ola::rdm::UID &uid);
490
491 std::string GetTiltInvert(ola::http::HTTPResponse *response,
492 unsigned int universe_id,
493 const ola::rdm::UID &uid);
494
495 std::string SetTiltInvert(const ola::http::HTTPRequest *request,
496 ola::http::HTTPResponse *response,
497 unsigned int universe_id,
498 const ola::rdm::UID &uid);
499
500 std::string GetPanTiltSwap(ola::http::HTTPResponse *response,
501 unsigned int universe_id,
502 const ola::rdm::UID &uid);
503
504 std::string SetPanTiltSwap(const ola::http::HTTPRequest *request,
505 ola::http::HTTPResponse *response,
506 unsigned int universe_id,
507 const ola::rdm::UID &uid);
508
509 std::string GetClock(ola::http::HTTPResponse *response,
510 unsigned int universe_id,
511 const ola::rdm::UID &uid);
512
513 void ClockHandler(ola::http::HTTPResponse *response,
514 const ola::rdm::ResponseStatus &status,
515 const ola::rdm::ClockValue &clock);
516
517 std::string SyncClock(ola::http::HTTPResponse *response,
518 unsigned int universe_id,
519 const ola::rdm::UID &uid);
520
521 std::string GetIdentifyDevice(ola::http::HTTPResponse *response,
522 unsigned int universe_id,
523 const ola::rdm::UID &uid);
524
525 std::string SetIdentifyDevice(const ola::http::HTTPRequest *request,
526 ola::http::HTTPResponse *response,
527 unsigned int universe_id,
528 const ola::rdm::UID &uid);
529
530 std::string GetPowerState(ola::http::HTTPResponse *response,
531 unsigned int universe_id,
532 const ola::rdm::UID &uid);
533
534 void PowerStateHandler(ola::http::HTTPResponse *response,
535 const ola::rdm::ResponseStatus &status,
536 uint8_t value);
537
538 std::string SetPowerState(const ola::http::HTTPRequest *request,
539 ola::http::HTTPResponse *response,
540 unsigned int universe_id,
541 const ola::rdm::UID &uid);
542
543 std::string GetResetDevice(ola::http::HTTPResponse *response);
544
545 std::string SetResetDevice(const ola::http::HTTPRequest *request,
546 ola::http::HTTPResponse *response,
547 unsigned int universe_id,
548 const ola::rdm::UID &uid);
549
550 std::string GetDnsHostname(ola::http::HTTPResponse *response,
551 unsigned int universe_id,
552 const ola::rdm::UID &uid);
553
554 void GetDnsHostnameHandler(ola::http::HTTPResponse *response,
555 const ola::rdm::ResponseStatus &status,
556 const std::string &label);
557
558 std::string SetDnsHostname(const ola::http::HTTPRequest *request,
559 ola::http::HTTPResponse *response,
560 unsigned int universe_id,
561 const ola::rdm::UID &uid);
562
563 std::string GetDnsDomainName(ola::http::HTTPResponse *response,
564 unsigned int universe_id,
565 const ola::rdm::UID &uid);
566
567 void GetDnsDomainNameHandler(ola::http::HTTPResponse *response,
568 const ola::rdm::ResponseStatus &status,
569 const std::string &label);
570
571 std::string SetDnsDomainName(const ola::http::HTTPRequest *request,
572 ola::http::HTTPResponse *response,
573 unsigned int universe_id,
574 const ola::rdm::UID &uid);
575
576 // util methods
577 bool CheckForInvalidId(const ola::http::HTTPRequest *request,
578 unsigned int *universe_id);
579
580 bool CheckForInvalidUid(const ola::http::HTTPRequest *request,
581 ola::rdm::UID **uid);
582
583 uint16_t SubDeviceOrRoot(const ola::http::HTTPRequest *request);
584
585 void SetHandler(ola::http::HTTPResponse *response,
586 const ola::rdm::ResponseStatus &status);
587
588 void GenericUIntHandler(ola::http::HTTPResponse *response,
589 std::string description,
590 const ola::rdm::ResponseStatus &status,
591 uint32_t value);
592
593 void GenericUInt8BoolHandler(ola::http::HTTPResponse *response,
594 std::string description,
595 const ola::rdm::ResponseStatus &status,
596 uint8_t value);
597 void GenericBoolHandler(ola::http::HTTPResponse *response,
598 std::string description,
599 const ola::rdm::ResponseStatus &status,
600 bool value);
601
602 bool CheckForRDMError(ola::http::HTTPResponse *response,
603 const ola::rdm::ResponseStatus &status);
604 int RespondWithError(ola::http::HTTPResponse *response,
605 const std::string &error);
606 void RespondWithSection(ola::http::HTTPResponse *response,
607 const ola::web::JsonSection &section);
608
609 bool CheckForRDMSuccess(const ola::rdm::ResponseStatus &status);
610 bool CheckForRDMSuccessWithError(const ola::rdm::ResponseStatus &status,
611 std::string *error);
612
613 void HandleBoolResponse(ola::http::HTTPResponse *response,
614 const std::string &error);
615
616 void AddSection(std::vector<section_info> *sections,
617 const std::string &section_id,
618 const std::string &section_name,
619 const std::string &hint = "");
620
621 static const uint32_t INVALID_PERSONALITY = 0xffff;
622 static const char BACKEND_DISCONNECTED_ERROR[];
623
624 static const char HINT_KEY[];
625 static const char ID_KEY[];
626 static const char SECTION_KEY[];
627 static const char UID_KEY[];
628
629 static const char ADDRESS_FIELD[];
630 static const char DISPLAY_INVERT_FIELD[];
631 static const char GENERIC_BOOL_FIELD[];
632 static const char GENERIC_STRING_FIELD[];
633 static const char GENERIC_UINT_FIELD[];
634 static const char IDENTIFY_DEVICE_FIELD[];
635 static const char LABEL_FIELD[];
636 static const char LANGUAGE_FIELD[];
637 static const char RECORD_SENSOR_FIELD[];
638 static const char SUB_DEVICE_FIELD[];
639
640 static const char BOOT_SOFTWARE_SECTION[];
641 static const char CLOCK_SECTION[];
642 static const char COMMS_STATUS_SECTION[];
643 static const char DEVICE_HOURS_SECTION[];
644 static const char DEVICE_INFO_SECTION[];
645 static const char DEVICE_LABEL_SECTION[];
646 static const char DISPLAY_INVERT_SECTION[];
647 static const char DISPLAY_LEVEL_SECTION[];
648 static const char DMX_ADDRESS_SECTION[];
649 static const char DNS_DOMAIN_NAME_SECTION[];
650 static const char DNS_HOSTNAME_SECTION[];
651 static const char FACTORY_DEFAULTS_SECTION[];
652 static const char IDENTIFY_DEVICE_SECTION[];
653 static const char LAMP_HOURS_SECTION[];
654 static const char LAMP_MODE_SECTION[];
655 static const char LAMP_STATE_SECTION[];
656 static const char LAMP_STRIKES_SECTION[];
657 static const char LANGUAGE_SECTION[];
658 static const char MANUFACTURER_LABEL_SECTION[];
659 static const char PAN_INVERT_SECTION[];
660 static const char PAN_TILT_SWAP_SECTION[];
661 static const char PERSONALITY_SECTION[];
662 static const char POWER_CYCLES_SECTION[];
663 static const char POWER_STATE_SECTION[];
664 static const char PRODUCT_DETAIL_SECTION[];
665 static const char PROXIED_DEVICES_SECTION[];
666 static const char RESET_DEVICE_SECTION[];
667 static const char SENSOR_SECTION[];
668 static const char TILT_INVERT_SECTION[];
669
670 static const char BOOT_SOFTWARE_SECTION_NAME[];
671 static const char CLOCK_SECTION_NAME[];
672 static const char COMMS_STATUS_SECTION_NAME[];
673 static const char DEVICE_HOURS_SECTION_NAME[];
674 static const char DEVICE_INFO_SECTION_NAME[];
675 static const char DEVICE_LABEL_SECTION_NAME[];
676 static const char DISPLAY_INVERT_SECTION_NAME[];
677 static const char DISPLAY_LEVEL_SECTION_NAME[];
678 static const char DMX_ADDRESS_SECTION_NAME[];
679 static const char DNS_DOMAIN_NAME_SECTION_NAME[];
680 static const char DNS_HOSTNAME_SECTION_NAME[];
681 static const char FACTORY_DEFAULTS_SECTION_NAME[];
682 static const char IDENTIFY_DEVICE_SECTION_NAME[];
683 static const char LAMP_HOURS_SECTION_NAME[];
684 static const char LAMP_MODE_SECTION_NAME[];
685 static const char LAMP_STATE_SECTION_NAME[];
686 static const char LAMP_STRIKES_SECTION_NAME[];
687 static const char LANGUAGE_SECTION_NAME[];
688 static const char MANUFACTURER_LABEL_SECTION_NAME[];
689 static const char PAN_INVERT_SECTION_NAME[];
690 static const char PAN_TILT_SWAP_SECTION_NAME[];
691 static const char PERSONALITY_SECTION_NAME[];
692 static const char POWER_CYCLES_SECTION_NAME[];
693 static const char POWER_STATE_SECTION_NAME[];
694 static const char PRODUCT_DETAIL_SECTION_NAME[];
695 static const char PROXIED_DEVICES_SECTION_NAME[];
696 static const char RESET_DEVICE_SECTION_NAME[];
697 static const char TILT_INVERT_SECTION_NAME[];
698
699 RDMHTTPModule(const RDMHTTPModule &) = delete;
700 const RDMHTTPModule &operator=(const RDMHTTPModule &) = delete;
701};
702} // namespace ola
703#endif // OLAD_RDMHTTPMODULE_H_
Helper macros.
Holds information about RDM PIDs.
Provide a generic RDM API that can use different implementations.
A RDM unique identifier (UID).
Definition RDMHTTPModule.h:45
int JsonSupportedSections(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Return a list of sections to display in the RDM control panel.
Definition RDMHTTPModule.cpp:442
int JsonSupportedPIDs(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Return a list of PIDs supported by this device.
Definition RDMHTTPModule.cpp:400
int JsonUIDs(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Return the list of uids for this universe as json.
Definition RDMHTTPModule.cpp:260
int JsonUIDPersonalities(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Returns the personalities on the device.
Definition RDMHTTPModule.cpp:365
void SetPidStore(const ola::rdm::RootPidStore *pid_store)
Can be called while the server is running. Ownership is not transferred.
Definition RDMHTTPModule.cpp:218
int JsonSaveSectionInfo(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Definition RDMHTTPModule.cpp:578
int RunRDMDiscovery(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Run RDM discovery for a universe.
Definition RDMHTTPModule.cpp:230
void PruneUniverseList(const std::vector< client::OlaUniverse > &universes)
Definition RDMHTTPModule.cpp:665
int JsonUIDInfo(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Return the device info for this uid.
Definition RDMHTTPModule.cpp:287
int JsonUIDIdentifyDevice(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Returns the identify state for the device.
Definition RDMHTTPModule.cpp:326
int JsonSectionInfo(const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
Get the information required to render a section in the RDM controller panel.
Definition RDMHTTPModule.cpp:482
Definition ClientRDMAPIShim.h:39
The callback based C++ client for OLA.
Definition OlaClient.h:45
Indicates the result of a OLA API call.
Definition Result.h:52
Definition HTTPServer.h:65
Definition HTTPServer.h:110
The base HTTP Server.
Definition HTTPServer.h:157
Definition RDMAPI.h:295
Represents the state of a response and/or any error codes.
Definition RDMAPIImplInterface.h:51
The root of the RDM parameter descriptor store.
Definition PidStore.h:68
Represents a RDM UID.
Definition UID.h:57
Represents a set of RDM UIDs.
Definition UIDSet.h:48
Definition Mutex.h:41
Definition JsonSections.h:203
The namespace containing all OLA symbols.
Definition Credentials.cpp:44
Definition RDMAPI.h:132