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;
183 uint16_t device_count,
184 bool list_changed) = 0;
186 const std::vector<UID> &uids) = 0;
188 uint16_t short_message,
189 uint16_t length_mismatch,
190 uint16_t checksum_fail) = 0;
192 const std::vector<StatusMessage> &messages) = 0;
194 const std::string &status_id) = 0;
196 uint8_t status_type) = 0;
197 virtual void SupportedParameters(
199 const std::vector<uint16_t> ¶meters) = 0;
200 virtual void ParameterDescription(
204 const DeviceDescriptor &device_info) = 0;
206 const std::vector<uint16_t> &ids) = 0;
208 const std::string &description) = 0;
210 const std::string &label) = 0;
212 const std::string &label) = 0;
214 bool using_defaults) = 0;
215 virtual void LanguageCapabilities(
217 const std::vector<std::string> &langs) = 0;
219 const std::string &language) = 0;
221 const std::string &label) = 0;
223 uint32_t version) = 0;
224 virtual void BootSoftwareVersionLabel(
const ResponseStatus &status,
225 const std::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 std::string &label) = 0;
234 uint16_t start_address) = 0;
236 const std::vector<SlotDescriptor> &slots) = 0;
238 uint16_t slot_offset,
239 const std::string &description) = 0;
240 virtual void SlotDefaultValues(
242 const std::vector<SlotDefault> &defaults) = 0;
246 const SensorValueDescriptor &descriptor) = 0;
260 uint8_t invert_mode) = 0;
264 uint8_t inverted) = 0;
266 uint8_t inverted) = 0;
268 uint8_t inverted) = 0;
272 const ClockValue &clock) = 0;
274 uint8_t power_state) = 0;
276 uint8_t reset_device) = 0;
278 bool is_enabled) = 0;
280 uint8_t self_test_number,
281 const std::string &description) = 0;
283 uint16_t preset_mode,
288 const std::string &data) = 0;
303 uint8_t OutstandingMessagesCount(
const UID &uid);
306 bool GetProxiedDeviceCount(
307 unsigned int universe,
315 bool GetProxiedDevices(
316 unsigned int universe,
320 const std::vector<UID>&> *callback,
325 unsigned int universe,
334 bool ClearCommStatus(
335 unsigned int universe,
345 unsigned int universe,
347 rdm_status_type status_type,
354 unsigned int universe,
356 rdm_status_type status_type,
360 const std::string&> *callback,
363 bool GetStatusMessage(
364 unsigned int universe,
366 rdm_status_type status_type,
369 const std::vector<StatusMessage>&> *callback,
372 bool GetStatusIdDescription(
373 unsigned int universe,
377 const std::string&> *callback,
381 unsigned int universe,
387 bool GetSubDeviceReporting(
388 unsigned int universe,
396 bool SetSubDeviceReporting(
397 unsigned int universe,
400 rdm_status_type status_type,
405 bool GetSupportedParameters(
406 unsigned int universe,
411 const std::vector<uint16_t> &> *callback,
414 bool GetParameterDescription(
415 unsigned int universe,
424 unsigned int universe,
429 const DeviceDescriptor&> *callback,
432 bool GetProductDetailIdList(
433 unsigned int universe,
438 const std::vector<uint16_t> &> *callback,
441 bool GetDeviceModelDescription(
442 unsigned int universe,
447 const std::string&> *callback,
450 bool GetManufacturerLabel(
451 unsigned int universe,
456 const std::string&> *callback,
460 unsigned int universe,
465 const std::string&> *callback,
469 unsigned int universe,
472 const std::string &label,
476 bool GetFactoryDefaults(
477 unsigned int universe,
485 bool ResetToFactoryDefaults(
486 unsigned int universe,
492 bool GetLanguageCapabilities(
493 unsigned int universe,
498 const std::vector<std::string>&> *callback,
502 unsigned int universe,
507 const std::string&> *callback,
511 unsigned int universe,
514 const std::string &language,
518 bool GetSoftwareVersionLabel(
519 unsigned int universe,
524 const std::string&> *callback,
527 bool GetBootSoftwareVersion(
528 unsigned int universe,
536 bool GetBootSoftwareVersionLabel(
537 unsigned int universe,
542 const std::string&> *callback,
545 bool GetDMXPersonality(
546 unsigned int universe,
555 bool SetDMXPersonality(
556 unsigned int universe,
563 bool GetDMXPersonalityDescription(
564 unsigned int universe,
572 const std::string&> *callback,
576 unsigned int universe,
585 unsigned int universe,
588 uint16_t start_address,
593 unsigned int universe,
598 const std::vector<SlotDescriptor>&> *callback,
601 bool GetSlotDescription(
602 unsigned int universe,
605 uint16_t slot_offset,
609 const std::string&> *callback,
612 bool GetSlotDefaultValues(
613 unsigned int universe,
618 const std::vector<SlotDefault>&> *callback,
621 bool GetSensorDefinition(
622 unsigned int universe,
625 uint8_t sensor_number,
632 unsigned int universe,
635 uint8_t sensor_number,
638 const SensorValueDescriptor&> *callback,
642 unsigned int universe,
645 uint8_t sensor_number,
648 const SensorValueDescriptor&> *callback,
652 unsigned int universe,
655 uint8_t sensor_number,
660 unsigned int universe,
669 unsigned int universe,
672 uint32_t device_hours,
677 unsigned int universe,
686 unsigned int universe,
694 unsigned int universe,
703 unsigned int universe,
706 uint32_t lamp_strikes,
711 unsigned int universe,
718 unsigned int universe,
726 unsigned int universe,
733 unsigned int universe,
740 bool GetDevicePowerCycles(
741 unsigned int universe,
749 bool SetDevicePowerCycles(
750 unsigned int universe,
753 uint32_t power_cycles,
757 bool GetDisplayInvert(
758 unsigned int universe,
764 bool SetDisplayInvert(
765 unsigned int universe,
768 uint8_t display_invert,
772 bool GetDisplayLevel(
773 unsigned int universe,
779 bool SetDisplayLevel(
780 unsigned int universe,
783 uint8_t display_level,
788 unsigned int universe,
795 unsigned int universe,
803 unsigned int universe,
810 unsigned int universe,
818 unsigned int universe,
825 unsigned int universe,
833 unsigned int universe,
838 const ClockValue&> *callback,
842 unsigned int universe,
845 const ClockValue &clock,
849 bool GetIdentifyDevice(
850 unsigned int universe,
857 unsigned int universe,
865 unsigned int universe,
873 unsigned int universe,
880 unsigned int universe,
883 rdm_power_state power_state,
888 unsigned int universe,
891 rdm_reset_device_mode reset_device,
896 unsigned int universe,
901 const std::string&> *callback,
905 unsigned int universe,
908 const std::string &label,
912 bool GetDnsDomainName(
913 unsigned int universe,
918 const std::string&> *callback,
921 bool SetDnsDomainName(
922 unsigned int universe,
925 const std::string &label,
929 bool SelfTestEnabled(
930 unsigned int universe,
936 bool PerformSelfTest(
937 unsigned int universe,
940 uint8_t self_test_number,
944 bool SelfTestDescription(
945 unsigned int universe,
948 uint8_t self_test_number,
952 const std::string&> *callback,
956 unsigned int universe,
960 uint16_t fade_up_time,
961 uint16_t fade_down_time,
966 bool PresetPlaybackMode(
967 unsigned int universe,
976 bool SetPresetPlaybackMode(
977 unsigned int universe,
980 uint16_t playback_mode,
988 void _HandleCustomLengthLabelResponse(
991 const std::string&> *callback,
994 const std::string &data);
996 void _HandleLabelResponse(
999 const std::string&> *callback,
1001 const std::string &data);
1003 void _HandleBoolResponse(
1008 const std::string &data);
1010 void _HandleU8Response(
1015 const std::string &data);
1017 void _HandleU32Response(
1020 uint32_t> *callback,
1022 const std::string &data);
1024 void _HandleEmptyResponse(
1027 const std::string &data);
1030 void _HandleGetProxiedDeviceCount(
1036 const std::string &data);
1038 void _HandleGetProxiedDevices(
1041 const std::vector<UID>&> *callback,
1043 const std::string &data);
1045 void _HandleGetCommStatus(
1050 uint16_t> *callback,
1052 const std::string &data);
1054 void _HandleQueuedMessage(
1058 const std::string &data);
1060 void _HandleGetStatusMessage(
1063 const std::vector<StatusMessage>&> *callback,
1065 const std::string &data);
1067 void _HandleGetSubDeviceReporting(
1072 const std::string &data);
1074 void _HandleGetSupportedParameters(
1077 const std::vector<uint16_t>&> *callback,
1079 const std::string &data);
1081 void _HandleGetParameterDescriptor(
1086 const std::string &data);
1088 void _HandleGetDeviceDescriptor(
1091 const DeviceDescriptor&> *callback,
1093 const std::string &data);
1095 void _HandleGetProductDetailIdList(
1098 const std::vector<uint16_t>&> *callback,
1100 const std::string &data);
1102 void _HandleGetLanguageCapabilities(
1105 const std::vector<std::string>&> *callback,
1107 const std::string &data);
1109 void _HandleGetLanguage(
1112 const std::string&> *callback,
1114 const std::string &data);
1116 void _HandleGetBootSoftwareVersion(
1119 uint32_t> *callback,
1121 const std::string &data);
1123 void _HandleGetDMXPersonality(
1129 const std::string &data);
1131 void _HandleGetDMXPersonalityDescription(
1136 const std::string&> *callback,
1138 const std::string &data);
1140 void _HandleGetDMXAddress(
1143 uint16_t> *callback,
1145 const std::string &data);
1147 void _HandleGetSlotInfo(
1150 const std::vector<SlotDescriptor>&> *callback,
1152 const std::string &data);
1154 void _HandleGetSlotDescription(
1158 const std::string&> *callback,
1160 const std::string &data);
1162 void _HandleGetSlotDefaultValues(
1165 const std::vector<SlotDefault>&> *callback,
1167 const std::string &data);
1169 void _HandleGetSensorDefinition(
1174 const std::string &data);
1176 void _HandleSensorValue(
1179 const SensorValueDescriptor&> *callback,
1181 const std::string &data);
1186 const ClockValue&> *callback,
1188 const std::string &data);
1194 const std::string&> *callback,
1196 const std::string &data);
1204 const std::string &data);
1208 std::map<UID, uint8_t> m_outstanding_messages;
1211 unsigned int universe,
1216 std::string *error);
1219 unsigned int universe,
1221 uint16_t sub_device,
1225 std::string *error);
1228 unsigned int universe,
1230 uint16_t sub_device,
1233 uint32_t> *callback,
1235 std::string *error);
1238 unsigned int universe,
1240 uint16_t sub_device,
1244 std::string *error);
1247 template <
typename callback_type>
1248 bool CheckCallback(std::string *error,
const callback_type *cb) {
1251 *error =
"Callback is null, this is a programming error";
1258 template <
typename callback_type>
1259 bool CheckNotBroadcast(
const UID &uid, std::string *error,
1260 const callback_type *cb) {
1263 *error =
"Cannot send to broadcast address";
1271 template <
typename callback_type>
1272 bool CheckValidSubDevice(uint16_t sub_device,
1273 bool broadcast_allowed,
1275 const callback_type *cb) {
1276 if (sub_device <= 0x0200)
1279 if (broadcast_allowed && sub_device == ALL_RDM_SUBDEVICES)
1283 *error =
"Sub device must be <= 0x0200";
1284 if (broadcast_allowed)
1285 *error +=
" or 0xffff";
1291 bool CheckReturnStatus(
bool status, std::string *error);
1293 unsigned int actual,
1294 unsigned int expected);
1298 #endif // INCLUDE_OLA_RDM_RDMAPI_H_
bool GetQueuedMessage(unsigned int universe, const UID &uid, rdm_status_type status_type, QueuedMessageHandler *handler, std::string *error)
Definition: RDMAPI.cpp:198
#define PACK(__Declaration__)
Pack structures.
Definition: Macro.h:170
A RDM unique identifier (UID).
The interface for an RDM API Implementation.
bool IsBroadcast() const
Check if this UID is a broadcast or vendorcast UID.
Definition: UID.h:150
Represents the state of a response and/or any error codes.
Definition: RDMAPIImplInterface.h:51
Used to get the current time.
Definition: Clock.h:221
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
void _HandleSelfTestDescription(ola::SingleUseCallback3< void, const ResponseStatus &, uint8_t, const std::string & > *callback, const ResponseStatus &status, const std::string &data)
Definition: RDMAPI.cpp:3710
void _HandlePlaybackMode(ola::SingleUseCallback3< void, const ResponseStatus &, uint16_t, uint8_t > *callback, const ResponseStatus &status, const std::string &data)
Definition: RDMAPI.cpp:3756
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