39 #ifndef INCLUDE_OLA_RDM_RDMAPI_H_ 40 #define INCLUDE_OLA_RDM_RDMAPI_H_ 60 uint16_t status_message_id;
74 uint8_t command_class;
78 uint32_t default_value;
80 std::string description;
88 struct device_info_s {
89 uint8_t protocol_version_high;
90 uint8_t protocol_version_low;
91 uint16_t device_model;
92 uint16_t product_category;
93 uint32_t software_version;
94 uint16_t dmx_footprint;
95 uint8_t current_personality;
96 uint8_t personality_count;
97 uint16_t dmx_start_address;
98 uint16_t sub_device_count;
102 typedef struct device_info_s DeviceDescriptor;
110 uint16_t slot_offset;
115 typedef struct slot_info_s SlotDescriptor;
121 struct slot_default_s {
122 uint16_t slot_offset;
123 uint8_t default_value;
126 typedef struct slot_default_s SlotDefault;
133 uint8_t sensor_number;
141 uint8_t recorded_value_support;
142 std::string description;
150 struct sensor_values_s {
151 uint8_t sensor_number;
152 int16_t present_value;
158 typedef struct sensor_values_s SensorValueDescriptor;
164 struct clock_value_s {
173 typedef struct clock_value_s ClockValue;
179 uint16_t min_level_lower_limit;
180 uint16_t min_level_upper_limit;
181 uint16_t max_level_lower_limit;
182 uint16_t max_level_upper_limit;
183 uint8_t curves_supported;
185 bool split_levels_supported;
192 uint16_t min_level_increasing;
193 uint16_t min_level_decreasing;
205 uint16_t device_count,
206 bool list_changed) = 0;
208 const std::vector<UID> &uids) = 0;
210 uint16_t short_message,
211 uint16_t length_mismatch,
212 uint16_t checksum_fail) = 0;
214 const std::vector<StatusMessage> &messages) = 0;
216 const std::string &status_id) = 0;
218 uint8_t status_type) = 0;
219 virtual void SupportedParameters(
221 const std::vector<uint16_t> ¶meters) = 0;
222 virtual void ParameterDescription(
226 const DeviceDescriptor &device_info) = 0;
228 const std::vector<uint16_t> &ids) = 0;
230 const std::string &description) = 0;
232 const std::string &label) = 0;
234 const std::string &label) = 0;
236 bool using_defaults) = 0;
237 virtual void LanguageCapabilities(
239 const std::vector<std::string> &langs) = 0;
241 const std::string &language) = 0;
243 const std::string &label) = 0;
245 uint32_t version) = 0;
246 virtual void BootSoftwareVersionLabel(
const ResponseStatus &status,
247 const std::string &label) = 0;
249 uint8_t current_personality,
250 uint8_t personality_count) = 0;
251 virtual void DMXPersonalityDescription(
const ResponseStatus &status,
253 uint16_t slots_requires,
254 const std::string &label) = 0;
256 uint16_t start_address) = 0;
258 const std::vector<SlotDescriptor> &slots) = 0;
260 uint16_t slot_offset,
261 const std::string &description) = 0;
262 virtual void SlotDefaultValues(
264 const std::vector<SlotDefault> &defaults) = 0;
268 const SensorValueDescriptor &descriptor) = 0;
282 uint8_t invert_mode) = 0;
286 uint8_t inverted) = 0;
288 uint8_t inverted) = 0;
290 uint8_t inverted) = 0;
294 const ClockValue &clock) = 0;
296 uint8_t power_state) = 0;
298 uint8_t reset_device) = 0;
300 bool is_enabled) = 0;
302 uint8_t self_test_number,
303 const std::string &description) = 0;
305 uint16_t preset_mode,
310 const std::string &data) = 0;
325 uint8_t OutstandingMessagesCount(
const UID &uid);
328 bool GetProxiedDeviceCount(
329 unsigned int universe,
337 bool GetProxiedDevices(
338 unsigned int universe,
342 const std::vector<UID>&> *callback,
347 unsigned int universe,
356 bool ClearCommStatus(
357 unsigned int universe,
366 bool GetQueuedMessage(
367 unsigned int universe,
369 rdm_status_type status_type,
375 bool GetQueuedMessage(
376 unsigned int universe,
378 rdm_status_type status_type,
382 const std::string&> *callback,
385 bool GetStatusMessage(
386 unsigned int universe,
388 rdm_status_type status_type,
391 const std::vector<StatusMessage>&> *callback,
394 bool GetStatusIdDescription(
395 unsigned int universe,
399 const std::string&> *callback,
403 unsigned int universe,
409 bool GetSubDeviceReporting(
410 unsigned int universe,
418 bool SetSubDeviceReporting(
419 unsigned int universe,
422 rdm_status_type status_type,
427 bool GetSupportedParameters(
428 unsigned int universe,
433 const std::vector<uint16_t> &> *callback,
436 bool GetParameterDescription(
437 unsigned int universe,
446 unsigned int universe,
451 const DeviceDescriptor&> *callback,
454 bool GetProductDetailIdList(
455 unsigned int universe,
460 const std::vector<uint16_t> &> *callback,
463 bool GetDeviceModelDescription(
464 unsigned int universe,
469 const std::string&> *callback,
472 bool GetManufacturerLabel(
473 unsigned int universe,
478 const std::string&> *callback,
482 unsigned int universe,
487 const std::string&> *callback,
491 unsigned int universe,
494 const std::string &label,
498 bool GetFactoryDefaults(
499 unsigned int universe,
507 bool ResetToFactoryDefaults(
508 unsigned int universe,
514 bool GetLanguageCapabilities(
515 unsigned int universe,
520 const std::vector<std::string>&> *callback,
524 unsigned int universe,
529 const std::string&> *callback,
533 unsigned int universe,
536 const std::string &language,
540 bool GetSoftwareVersionLabel(
541 unsigned int universe,
546 const std::string&> *callback,
549 bool GetBootSoftwareVersion(
550 unsigned int universe,
558 bool GetBootSoftwareVersionLabel(
559 unsigned int universe,
564 const std::string&> *callback,
567 bool GetDMXPersonality(
568 unsigned int universe,
577 bool SetDMXPersonality(
578 unsigned int universe,
585 bool GetDMXPersonalityDescription(
586 unsigned int universe,
594 const std::string&> *callback,
598 unsigned int universe,
607 unsigned int universe,
610 uint16_t start_address,
615 unsigned int universe,
620 const std::vector<SlotDescriptor>&> *callback,
623 bool GetSlotDescription(
624 unsigned int universe,
627 uint16_t slot_offset,
631 const std::string&> *callback,
634 bool GetSlotDefaultValues(
635 unsigned int universe,
640 const std::vector<SlotDefault>&> *callback,
643 bool GetSensorDefinition(
644 unsigned int universe,
647 uint8_t sensor_number,
654 unsigned int universe,
657 uint8_t sensor_number,
660 const SensorValueDescriptor&> *callback,
664 unsigned int universe,
667 uint8_t sensor_number,
670 const SensorValueDescriptor&> *callback,
674 unsigned int universe,
677 uint8_t sensor_number,
682 unsigned int universe,
691 unsigned int universe,
694 uint32_t device_hours,
699 unsigned int universe,
708 unsigned int universe,
716 unsigned int universe,
725 unsigned int universe,
728 uint32_t lamp_strikes,
733 unsigned int universe,
740 unsigned int universe,
748 unsigned int universe,
755 unsigned int universe,
762 bool GetDevicePowerCycles(
763 unsigned int universe,
771 bool SetDevicePowerCycles(
772 unsigned int universe,
775 uint32_t power_cycles,
779 bool GetDisplayInvert(
780 unsigned int universe,
786 bool SetDisplayInvert(
787 unsigned int universe,
790 uint8_t display_invert,
794 bool GetDisplayLevel(
795 unsigned int universe,
801 bool SetDisplayLevel(
802 unsigned int universe,
805 uint8_t display_level,
810 unsigned int universe,
817 unsigned int universe,
825 unsigned int universe,
832 unsigned int universe,
840 unsigned int universe,
847 unsigned int universe,
855 unsigned int universe,
860 const ClockValue&> *callback,
864 unsigned int universe,
867 const ClockValue &clock,
871 bool GetIdentifyDevice(
872 unsigned int universe,
879 unsigned int universe,
887 unsigned int universe,
895 unsigned int universe,
902 unsigned int universe,
905 rdm_power_state power_state,
910 unsigned int universe,
913 rdm_reset_device_mode reset_device,
918 unsigned int universe,
923 const std::string&> *callback,
927 unsigned int universe,
930 const std::string &label,
934 bool GetDnsDomainName(
935 unsigned int universe,
940 const std::string&> *callback,
943 bool SetDnsDomainName(
944 unsigned int universe,
947 const std::string &label,
952 unsigned int universe,
962 unsigned int universe,
969 bool GetCurveDescription(
970 unsigned int universe,
977 const std::string&> *callback,
981 unsigned int universe,
989 bool GetDimmerMinimumLevels(
990 unsigned int universe,
998 bool SetDimmerMinimumLevels(
999 unsigned int universe,
1001 uint16_t sub_device,
1002 uint16_t min_increasing,
1003 uint16_t min_decreasing,
1006 std::string *error);
1008 bool GetDimmerMaximumLevel(
1009 unsigned int universe,
1014 uint16_t> *callback,
1015 std::string *error);
1017 bool SetDimmerMaximumLevel(
1018 unsigned int universe,
1020 uint16_t sub_device,
1021 uint16_t maximum_level,
1023 std::string *error);
1025 bool SelfTestEnabled(
1026 unsigned int universe,
1028 uint16_t sub_device,
1030 std::string *error);
1032 bool PerformSelfTest(
1033 unsigned int universe,
1035 uint16_t sub_device,
1036 uint8_t self_test_number,
1038 std::string *error);
1040 bool SelfTestDescription(
1041 unsigned int universe,
1043 uint16_t sub_device,
1044 uint8_t self_test_number,
1048 const std::string&> *callback,
1049 std::string *error);
1052 unsigned int universe,
1054 uint16_t sub_device,
1056 uint16_t fade_up_time,
1057 uint16_t fade_down_time,
1060 std::string *error);
1062 bool PresetPlaybackMode(
1063 unsigned int universe,
1065 uint16_t sub_device,
1070 std::string *error);
1072 bool SetPresetPlaybackMode(
1073 unsigned int universe,
1075 uint16_t sub_device,
1076 uint16_t playback_mode,
1079 std::string *error);
1084 void _HandleCustomLengthLabelResponse(
1087 const std::string&> *callback,
1090 const std::string &data);
1092 void _HandleLabelResponse(
1095 const std::string&> *callback,
1097 const std::string &data);
1099 void _HandleBoolResponse(
1104 const std::string &data);
1106 void _HandleU8Response(
1111 const std::string &data);
1113 void _HandleU16Response(
1116 uint16_t> *callback,
1118 const std::string &data);
1120 void _HandleU32Response(
1123 uint32_t> *callback,
1125 const std::string &data);
1127 void _HandleEmptyResponse(
1130 const std::string &data);
1133 void _HandleGetProxiedDeviceCount(
1139 const std::string &data);
1141 void _HandleGetProxiedDevices(
1144 const std::vector<UID>&> *callback,
1146 const std::string &data);
1148 void _HandleGetCommStatus(
1153 uint16_t> *callback,
1155 const std::string &data);
1157 void _HandleQueuedMessage(
1161 const std::string &data);
1163 void _HandleGetStatusMessage(
1166 const std::vector<StatusMessage>&> *callback,
1168 const std::string &data);
1170 void _HandleGetSubDeviceReporting(
1175 const std::string &data);
1177 void _HandleGetSupportedParameters(
1180 const std::vector<uint16_t>&> *callback,
1182 const std::string &data);
1184 void _HandleGetParameterDescriptor(
1189 const std::string &data);
1191 void _HandleGetDeviceDescriptor(
1194 const DeviceDescriptor&> *callback,
1196 const std::string &data);
1198 void _HandleGetProductDetailIdList(
1201 const std::vector<uint16_t>&> *callback,
1203 const std::string &data);
1205 void _HandleGetLanguageCapabilities(
1208 const std::vector<std::string>&> *callback,
1210 const std::string &data);
1212 void _HandleGetLanguage(
1215 const std::string&> *callback,
1217 const std::string &data);
1219 void _HandleGetBootSoftwareVersion(
1222 uint32_t> *callback,
1224 const std::string &data);
1226 void _HandleGetDMXPersonality(
1232 const std::string &data);
1234 void _HandleGetDMXPersonalityDescription(
1239 const std::string&> *callback,
1241 const std::string &data);
1243 void _HandleGetSlotInfo(
1246 const std::vector<SlotDescriptor>&> *callback,
1248 const std::string &data);
1250 void _HandleGetSlotDescription(
1254 const std::string&> *callback,
1256 const std::string &data);
1258 void _HandleGetSlotDefaultValues(
1261 const std::vector<SlotDefault>&> *callback,
1263 const std::string &data);
1265 void _HandleGetSensorDefinition(
1270 const std::string &data);
1272 void _HandleSensorValue(
1275 const SensorValueDescriptor&> *callback,
1277 const std::string &data);
1282 const ClockValue&> *callback,
1284 const std::string &data);
1286 void _HandleSelfTestDescription(
1290 const std::string&> *callback,
1292 const std::string &data);
1294 void _HandlePlaybackMode(
1300 const std::string &data);
1302 void _HandleGetCurve(
1308 const std::string &data);
1310 void _HandleGetCurveDescription(
1314 const std::string&> *callback,
1316 const std::string &data);
1318 void _HandleGetDimmerInfo(
1323 const std::string &data);
1325 void _HandleGetDimmerMinimumLevels(
1330 const std::string &data);
1334 std::map<UID, uint8_t> m_outstanding_messages;
1337 unsigned int universe,
1342 std::string *error);
1345 unsigned int universe,
1347 uint16_t sub_device,
1351 std::string *error);
1354 unsigned int universe,
1356 uint16_t sub_device,
1359 uint16_t> *callback,
1361 std::string *error);
1364 unsigned int universe,
1366 uint16_t sub_device,
1370 std::string *error);
1373 unsigned int universe,
1375 uint16_t sub_device,
1378 uint32_t> *callback,
1380 std::string *error);
1383 unsigned int universe,
1385 uint16_t sub_device,
1389 std::string *error);
1392 template <
typename callback_type>
1393 bool CheckCallback(std::string *error,
const callback_type *cb) {
1396 *error =
"Callback is null, this is a programming error";
1403 template <
typename callback_type>
1404 bool CheckNotBroadcast(
const UID &uid, std::string *error,
1405 const callback_type *cb) {
1408 *error =
"Cannot send to broadcast address";
1416 template <
typename callback_type>
1417 bool CheckValidSubDevice(uint16_t sub_device,
1418 bool broadcast_allowed,
1420 const callback_type *cb) {
1421 if (sub_device <= 0x0200)
1424 if (broadcast_allowed && sub_device == ALL_RDM_SUBDEVICES)
1428 *error =
"Sub device must be <= 0x0200";
1429 if (broadcast_allowed)
1430 *error +=
" or 0xffff";
1436 bool CheckReturnStatus(
bool status, std::string *error);
1438 unsigned int actual,
1439 unsigned int expected);
1443 #endif // INCLUDE_OLA_RDM_RDMAPI_H_ #define PACK(__Declaration__)
Pack structures.
Definition: Macro.h:170
A RDM unique identifier (UID).
bool IsBroadcast() const
Check if this UID is a broadcast or vendorcast UID.
Definition: UID.h:175
The interface for an RDM API Implementation.
Represents the state of a response and/or any error codes.
Definition: RDMAPIImplInterface.h:51
Used to get the current time.
Definition: Clock.h:242
This is the interface for an RDMAPI implementation.
Definition: RDMAPIImplInterface.h:83
A 1 argument callback which deletes itself after it's run.
Definition: Callback.h:1004
Various constants used in RDM.
A 3 argument callback which deletes itself after it's run.
Definition: Callback.h:2850
Represents a RDM UID.
Definition: UID.h:57
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
A 2 argument callback which deletes itself after it's run.
Definition: Callback.h:1907
A 4 argument callback which deletes itself after it's run.
Definition: Callback.h:3833