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);
162 const ola::rdm::DeviceDescriptor &device);
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,
187 const ola::rdm::DeviceDescriptor &device);
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,
232 const ola::rdm::DeviceDescriptor &device);
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,
381 const ola::rdm::SensorValueDescriptor &value);
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,
515 const ola::rdm::ClockValue &clock);
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,
551 unsigned int universe_id,
556 const std::string &label);
560 unsigned int universe_id,
564 unsigned int universe_id,
569 const std::string &label);
573 unsigned int universe_id,
578 unsigned int *universe_id);
589 std::string description,
594 std::string description,
598 std::string description,
605 const std::string &error);
614 const std::string &error);
616 void AddSection(std::vector<section_info> *sections,
617 const std::string §ion_id,
618 const std::string §ion_name,
619 const std::string &hint =
"");
621 static const uint32_t INVALID_PERSONALITY = 0xffff;
622 static const char BACKEND_DISCONNECTED_ERROR[];
624 static const char HINT_KEY[];
625 static const char ID_KEY[];
626 static const char SECTION_KEY[];
627 static const char UID_KEY[];
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[];
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[];
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[];
702 #endif // OLAD_RDMHTTPMODULE_H_