21 #ifndef OLAD_RDMHTTPMODULE_H_
22 #define OLAD_RDMHTTPMODULE_H_
30 #include "ola/client/ClientRDMAPIShim.h"
31 #include "ola/client/OlaClient.h"
32 #include "ola/http/HTTPServer.h"
36 #include "ola/thread/Mutex.h"
37 #include "ola/web/JsonSections.h"
81 std::string manufacturer;
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;
96 } uid_resolution_state;
102 std::map<unsigned int, uid_resolution_state*> m_universe_uids;
113 struct lt_section_info {
114 bool operator()(
const section_info &left,
const section_info &right) {
115 return left.name < right.name;
120 unsigned int universe_id;
123 std::string device_model;
124 std::string software_version;
128 unsigned int universe_id;
130 bool include_descriptions;
131 bool return_as_section;
135 std::vector<std::pair<uint32_t, std::string> > personalities;
140 unsigned int universe_id,
144 void ResolveNextUID(
unsigned int universe_id);
146 void UpdateUIDManufacturerLabel(
unsigned int universe,
149 const std::string &device_label);
151 void UpdateUIDDeviceLabel(
unsigned int universe,
154 const std::string &device_label);
156 uid_resolution_state *GetUniverseUids(
unsigned int universe);
157 uid_resolution_state *GetUniverseUidsOrCreate(
unsigned int universe);
171 personality_info *info);
177 const std::vector<uint16_t> &pids);
179 unsigned int universe,
182 const std::vector<uint16_t> &pids);
183 void SupportedSectionsDeviceInfoHandler(
185 const std::vector<uint16_t> pids,
191 unsigned int universe_id,
196 uint16_t short_messages,
197 uint16_t length_mismatch,
198 uint16_t checksum_fail);
201 unsigned int universe_id,
205 unsigned int universe_id,
210 unsigned int universe_id,
212 const std::vector<ola::rdm::UID> &uids);
216 unsigned int universe_id,
220 device_info dev_info,
222 const std::string &software_version);
225 device_info dev_info,
227 const std::string &device_model);
230 device_info dev_info,
236 unsigned int universe_id,
241 const std::vector<uint16_t> &ids);
245 unsigned int universe_id,
249 unsigned int universe_id,
252 const std::string &label);
256 unsigned int universe_id,
260 unsigned int universe_id,
263 const std::string &label);
267 unsigned int universe_id,
271 unsigned int universe_id,
279 unsigned int universe_id,
283 unsigned int universe_id,
286 void GetSupportedLanguagesHandler(
288 unsigned int universe_id,
291 const std::vector<std::string> &languages);
294 std::vector<std::string> languages,
296 const std::string &language);
300 unsigned int universe_id,
304 unsigned int universe_id,
308 unsigned int universe_id,
311 const std::string &label);
313 void GetBootSoftwareVersionHandler(
321 unsigned int universe_id,
323 bool return_as_section,
324 bool include_description =
false);
326 void GetPersonalityHandler(
328 personality_info *info,
334 personality_info *info);
336 void GetPersonalityLabelHandler(
338 personality_info *info,
342 const std::string &label);
345 personality_info *info);
349 unsigned int universe_id,
354 unsigned int universe_id,
363 unsigned int universe_id,
368 unsigned int universe_id,
372 unsigned int universe_id,
385 unsigned int universe_id,
390 unsigned int universe_id,
395 unsigned int universe_id,
400 unsigned int universe_id,
405 unsigned int universe_id,
410 unsigned int universe_id,
415 unsigned int universe_id,
420 unsigned int universe_id,
429 unsigned int universe_id,
434 unsigned int universe_id,
443 unsigned int universe_id,
448 unsigned int universe_id,
453 unsigned int universe_id,
457 unsigned int universe_id,
466 unsigned int universe_id,
470 unsigned int universe_id,
479 unsigned int universe_id,
483 unsigned int universe_id,
488 unsigned int universe_id,
492 unsigned int universe_id,
497 unsigned int universe_id,
501 unsigned int universe_id,
506 unsigned int universe_id,
510 unsigned int universe_id,
518 unsigned int universe_id,
522 unsigned int universe_id,
527 unsigned int universe_id,
531 unsigned int universe_id,
540 unsigned int universe_id,
547 unsigned int universe_id,
552 unsigned int *universe_id);
563 std::string description,
568 std::string description,
572 std::string description,
579 const std::string &error);
588 const std::string &error);
590 void AddSection(std::vector<section_info> *sections,
591 const std::string §ion_id,
592 const std::string §ion_name,
593 const std::string &hint=
"");
595 static const uint32_t INVALID_PERSONALITY = 0xffff;
596 static const char BACKEND_DISCONNECTED_ERROR[];
598 static const char HINT_KEY[];
599 static const char ID_KEY[];
600 static const char SECTION_KEY[];
601 static const char UID_KEY[];
603 static const char ADDRESS_FIELD[];
604 static const char DISPLAY_INVERT_FIELD[];
605 static const char GENERIC_BOOL_FIELD[];
606 static const char GENERIC_STRING_FIELD[];
607 static const char GENERIC_UINT_FIELD[];
608 static const char IDENTIFY_FIELD[];
609 static const char LABEL_FIELD[];
610 static const char LANGUAGE_FIELD[];
611 static const char RECORD_SENSOR_FIELD[];
612 static const char SUB_DEVICE_FIELD[];
614 static const char BOOT_SOFTWARE_SECTION[];
615 static const char CLOCK_SECTION[];
616 static const char COMMS_STATUS_SECTION[];
617 static const char DEVICE_HOURS_SECTION[];
618 static const char DEVICE_INFO_SECTION[];
619 static const char DEVICE_LABEL_SECTION[];
620 static const char DISPLAY_INVERT_SECTION[];
621 static const char DISPLAY_LEVEL_SECTION[];
622 static const char DMX_ADDRESS_SECTION[];
623 static const char FACTORY_DEFAULTS_SECTION[];
624 static const char IDENTIFY_SECTION[];
625 static const char LAMP_HOURS_SECTION[];
626 static const char LAMP_MODE_SECTION[];
627 static const char LAMP_STATE_SECTION[];
628 static const char LAMP_STRIKES_SECTION[];
629 static const char LANGUAGE_SECTION[];
630 static const char MANUFACTURER_LABEL_SECTION[];
631 static const char PAN_INVERT_SECTION[];
632 static const char PAN_TILT_SWAP_SECTION[];
633 static const char PERSONALITY_SECTION[];
634 static const char POWER_CYCLES_SECTION[];
635 static const char POWER_STATE_SECTION[];
636 static const char PRODUCT_DETAIL_SECTION[];
637 static const char PROXIED_DEVICES_SECTION[];
638 static const char RESET_DEVICE_SECTION[];
639 static const char SENSOR_SECTION[];
640 static const char TILT_INVERT_SECTION[];
642 static const char BOOT_SOFTWARE_SECTION_NAME[];
643 static const char CLOCK_SECTION_NAME[];
644 static const char COMMS_STATUS_SECTION_NAME[];
645 static const char DEVICE_HOURS_SECTION_NAME[];
646 static const char DEVICE_INFO_SECTION_NAME[];
647 static const char DEVICE_LABEL_SECTION_NAME[];
648 static const char DISPLAY_INVERT_SECTION_NAME[];
649 static const char DISPLAY_LEVEL_SECTION_NAME[];
650 static const char DMX_ADDRESS_SECTION_NAME[];
651 static const char FACTORY_DEFAULTS_SECTION_NAME[];
652 static const char IDENTIFY_SECTION_NAME[];
653 static const char LAMP_HOURS_SECTION_NAME[];
654 static const char LAMP_MODE_SECTION_NAME[];
655 static const char LAMP_STATE_SECTION_NAME[];
656 static const char LAMP_STRIKES_SECTION_NAME[];
657 static const char LANGUAGE_SECTION_NAME[];
658 static const char MANUFACTURER_LABEL_SECTION_NAME[];
659 static const char PAN_INVERT_SECTION_NAME[];
660 static const char PAN_TILT_SWAP_SECTION_NAME[];
661 static const char PERSONALITY_SECTION_NAME[];
662 static const char POWER_CYCLES_SECTION_NAME[];
663 static const char POWER_STATE_SECTION_NAME[];
664 static const char PRODUCT_DETAIL_SECTION_NAME[];
665 static const char PROXIED_DEVICES_SECTION_NAME[];
666 static const char RESET_DEVICE_SECTION_NAME[];
667 static const char TILT_INVERT_SECTION_NAME[];
672 #endif // OLAD_RDMHTTPMODULE_H_