39 #ifndef INCLUDE_OLA_RDM_RDMAPI_H_
40 #define INCLUDE_OLA_RDM_RDMAPI_H_
67 uint16_t status_message_id;
81 uint8_t command_class;
85 uint32_t default_value;
95 uint8_t protocol_version_high;
96 uint8_t protocol_version_low;
97 uint16_t device_model;
98 uint16_t product_category;
99 uint32_t software_version;
100 uint16_t dmx_footprint;
101 uint8_t current_personality;
102 uint8_t personaility_count;
103 uint16_t dmx_start_address;
104 uint16_t sub_device_count;
105 uint8_t sensor_count;
106 } __attribute__((packed));
115 uint16_t slot_offset;
118 } __attribute__((packed));
126 uint16_t slot_offset;
127 uint8_t default_value;
128 } __attribute__((packed));
137 uint8_t sensor_number;
145 uint8_t recorded_value_support;
154 uint8_t sensor_number;
155 int16_t present_value;
159 } __attribute__((packed));
173 } __attribute__((packed));
185 uint16_t device_count,
186 bool list_changed) = 0;
188 const vector<UID> &uids) = 0;
190 uint16_t short_message,
191 uint16_t length_mismatch,
192 uint16_t checksum_fail) = 0;
194 const vector<StatusMessage> &messages) = 0;
196 const string &status_id) = 0;
198 uint8_t status_type) = 0;
200 const vector<uint16_t> ¶meters) = 0;
201 virtual void ParameterDescription(
207 const vector<uint16_t> &ids) = 0;
209 const string &description) = 0;
211 const string &label) = 0;
213 const string &label) = 0;
215 bool using_defaults) = 0;
217 const vector<string> &langs) = 0;
219 const string &language) = 0;
221 const string &label) = 0;
223 uint32_t version) = 0;
224 virtual void BootSoftwareVersionLabel(
const ResponseStatus &status,
225 const string &label) = 0;
227 uint8_t current_personality,
228 uint8_t personality_count) = 0;
229 virtual void DMXPersonalityDescription(
const ResponseStatus &status,
231 uint16_t slots_requires,
232 const string &label) = 0;
234 uint16_t start_address) = 0;
236 const vector<SlotDescriptor> &slots) = 0;
238 uint16_t slot_offset,
239 const string &description) = 0;
241 const vector<SlotDefault> &defaults) = 0;
259 uint8_t invert_mode) = 0;
263 uint8_t inverted) = 0;
265 uint8_t inverted) = 0;
267 uint8_t inverted) = 0;
273 uint8_t power_state) = 0;
275 uint8_t reset_device) = 0;
277 bool is_enabled) = 0;
279 uint8_t self_test_number,
280 const string &description) = 0;
282 uint16_t preset_mode,
287 const string &data) = 0;
302 uint8_t OutstandingMessagesCount(
const UID &uid);
305 bool GetProxiedDeviceCount(
306 unsigned int universe,
314 bool GetProxiedDevices(
315 unsigned int universe,
319 const vector<UID>&> *callback,
324 unsigned int universe,
333 bool ClearCommStatus(
334 unsigned int universe,
344 unsigned int universe,
346 rdm_status_type status_type,
353 unsigned int universe,
355 rdm_status_type status_type,
359 const string&> *callback,
362 bool GetStatusMessage(
363 unsigned int universe,
365 rdm_status_type status_type,
368 const vector<StatusMessage>&> *callback,
371 bool GetStatusIdDescription(
372 unsigned int universe,
376 const string&> *callback,
380 unsigned int universe,
386 bool GetSubDeviceReporting(
387 unsigned int universe,
395 bool SetSubDeviceReporting(
396 unsigned int universe,
399 rdm_status_type status_type,
404 bool GetSupportedParameters(
405 unsigned int universe,
410 const vector<uint16_t> &> *callback,
413 bool GetParameterDescription(
414 unsigned int universe,
423 unsigned int universe,
431 bool GetProductDetailIdList(
432 unsigned int universe,
437 const vector<uint16_t> &> *callback,
440 bool GetDeviceModelDescription(
441 unsigned int universe,
446 const string&> *callback,
449 bool GetManufacturerLabel(
450 unsigned int universe,
455 const string&> *callback,
459 unsigned int universe,
464 const string&> *callback,
468 unsigned int universe,
475 bool GetFactoryDefaults(
476 unsigned int universe,
484 bool ResetToFactoryDefaults(
485 unsigned int universe,
491 bool GetLanguageCapabilities(
492 unsigned int universe,
497 const vector<string>&> *callback,
501 unsigned int universe,
506 const string&> *callback,
510 unsigned int universe,
513 const string &language,
517 bool GetSoftwareVersionLabel(
518 unsigned int universe,
523 const string&> *callback,
526 bool GetBootSoftwareVersion(
527 unsigned int universe,
535 bool GetBootSoftwareVersionLabel(
536 unsigned int universe,
541 const string&> *callback,
544 bool GetDMXPersonality(
545 unsigned int universe,
554 bool SetDMXPersonality(
555 unsigned int universe,
562 bool GetDMXPersonalityDescription(
563 unsigned int universe,
571 const string&> *callback,
575 unsigned int universe,
584 unsigned int universe,
587 uint16_t start_address,
592 unsigned int universe,
597 const vector<SlotDescriptor>&> *callback,
600 bool GetSlotDescription(
601 unsigned int universe,
604 uint16_t slot_offset,
608 const string&> *callback,
611 bool GetSlotDefaultValues(
612 unsigned int universe,
617 const vector<SlotDefault>&> *callback,
620 bool GetSensorDefinition(
621 unsigned int universe,
624 uint8_t sensor_number,
631 unsigned int universe,
634 uint8_t sensor_number,
641 unsigned int universe,
644 uint8_t sensor_number,
651 unsigned int universe,
654 uint8_t sensor_number,
659 unsigned int universe,
666 unsigned int universe,
669 uint32_t device_hours,
674 unsigned int universe,
681 unsigned int universe,
689 unsigned int universe,
696 unsigned int universe,
699 uint32_t lamp_strikes,
704 unsigned int universe,
711 unsigned int universe,
719 unsigned int universe,
726 unsigned int universe,
733 bool GetDevicePowerCycles(
734 unsigned int universe,
740 bool SetDevicePowerCycles(
741 unsigned int universe,
744 uint32_t power_cycles,
748 bool GetDisplayInvert(
749 unsigned int universe,
755 bool SetDisplayInvert(
756 unsigned int universe,
759 uint8_t display_invert,
763 bool GetDisplayLevel(
764 unsigned int universe,
770 bool SetDisplayLevel(
771 unsigned int universe,
774 uint8_t display_level,
779 unsigned int universe,
786 unsigned int universe,
794 unsigned int universe,
801 unsigned int universe,
809 unsigned int universe,
816 unsigned int universe,
824 unsigned int universe,
833 unsigned int universe,
840 bool GetIdentifyMode(
841 unsigned int universe,
848 unsigned int universe,
856 unsigned int universe,
864 unsigned int universe,
871 unsigned int universe,
874 rdm_power_state power_state,
879 unsigned int universe,
882 rdm_reset_device_mode reset_device,
886 bool SelfTestEnabled(
887 unsigned int universe,
893 bool PerformSelfTest(
894 unsigned int universe,
897 uint8_t self_test_number,
901 bool SelfTestDescription(
902 unsigned int universe,
905 uint8_t self_test_number,
909 const string&> *callback,
913 unsigned int universe,
917 uint16_t fade_up_time,
918 uint16_t fade_down_time,
923 bool PresetPlaybackMode(
924 unsigned int universe,
933 bool SetPresetPlaybackMode(
934 unsigned int universe,
937 uint16_t playback_mode,
945 void _HandleLabelResponse(
948 const string&> *callback,
952 void _HandleBoolResponse(
959 void _HandleU8Response(
966 void _HandleU32Response(
973 void _HandleEmptyResponse(
979 void _HandleGetProxiedDeviceCount(
987 void _HandleGetProxiedDevices(
990 const vector<UID>&> *callback,
994 void _HandleGetCommStatus(
1001 const string &data);
1003 void _HandleQueuedMessage(
1007 const string &data);
1009 void _HandleGetStatusMessage(
1012 const vector<StatusMessage>&> *callback,
1014 const string &data);
1016 void _HandleGetSubDeviceReporting(
1021 const string &data);
1023 void _HandleGetSupportedParameters(
1026 const vector<uint16_t>&> *callback,
1028 const string &data);
1030 void _HandleGetParameterDescriptor(
1035 const string &data);
1037 void _HandleGetDeviceDescriptor(
1042 const string &data);
1044 void _HandleGetProductDetailIdList(
1047 const vector<uint16_t>&> *callback,
1049 const string &data);
1051 void _HandleGetLanguageCapabilities(
1054 const vector<string>&> *callback,
1056 const string &data);
1058 void _HandleGetLanguage(
1061 const string&> *callback,
1063 const string &data);
1065 void _HandleGetBootSoftwareVersion(
1068 uint32_t> *callback,
1070 const string &data);
1072 void _HandleGetDMXPersonality(
1078 const string &data);
1080 void _HandleGetDMXPersonalityDescription(
1085 const string&> *callback,
1087 const string &data);
1089 void _HandleGetDMXAddress(
1092 uint16_t> *callback,
1094 const string &data);
1096 void _HandleGetSlotInfo(
1099 const vector<SlotDescriptor>&> *callback,
1101 const string &data);
1103 void _HandleGetSlotDescription(
1107 const string&> *callback,
1109 const string &data);
1111 void _HandleGetSlotDefaultValues(
1114 const vector<SlotDefault>&> *callback,
1116 const string &data);
1118 void _HandleGetSensorDefinition(
1123 const string &data);
1125 void _HandleSensorValue(
1130 const string &data);
1137 const string &data);
1143 const string&> *callback,
1145 const string &data);
1153 const string &data);
1157 std::map<UID, uint8_t> m_outstanding_messages;
1159 enum {LABEL_SIZE = 32};
1162 unsigned int universe,
1170 unsigned int universe,
1172 uint16_t sub_device,
1179 unsigned int universe,
1181 uint16_t sub_device,
1187 unsigned int universe,
1189 uint16_t sub_device,
1196 template <
typename callback_type>
1197 bool CheckCallback(
string *error,
const callback_type *cb) {
1200 *error =
"Callback is null, this is a programming error";
1207 template <
typename callback_type>
1208 bool CheckNotBroadcast(
const UID &uid,
string *error,
1209 const callback_type *cb) {
1212 *error =
"Cannot send to broadcast address";
1220 template <
typename callback_type>
1221 bool CheckValidSubDevice(uint16_t sub_device,
1222 bool broadcast_allowed,
1224 const callback_type *cb) {
1225 if (sub_device <= 0x0200)
1228 if (broadcast_allowed && sub_device == ALL_RDM_SUBDEVICES)
1232 *error =
"Sub device must be <= 0x0200";
1233 if (broadcast_allowed)
1234 *error +=
" or 0xffff";
1240 bool CheckReturnStatus(
bool status,
string *error);
1242 unsigned int actual,
1243 unsigned int expected);
1247 #endif // INCLUDE_OLA_RDM_RDMAPI_H_