22 #ifndef PLUGINS_USBPRO_USBPROWIDGETDETECTOR_H_ 23 #define PLUGINS_USBPRO_USBPROWIDGETDETECTOR_H_ 25 #include <ola/thread/SchedulingExecutorInterface.h> 30 #include "plugins/usbpro/WidgetDetectorInterface.h" 36 class DispatchingUsbProWidget;
43 typedef uint32_t DeviceSerialNumber;
44 typedef uint16_t DeviceFirmwareVersion;
51 has_firmware_version(
false),
55 esta_id(other.esta_id),
56 device_id(other.device_id),
58 firmware_version(other.firmware_version),
59 has_firmware_version(other.has_firmware_version),
60 manufacturer(other.manufacturer),
62 dual_port(other.dual_port) {
66 void SetFirmware(DeviceFirmwareVersion new_firmware_version) {
67 has_firmware_version =
true;
68 firmware_version = new_firmware_version;
71 enum {SERIAL_LENGTH = 4};
75 DeviceSerialNumber serial;
76 DeviceFirmwareVersion firmware_version;
77 bool has_firmware_version;
78 std::string manufacturer;
94 SuccessHandler *on_success,
95 FailureHandler *on_failure,
96 unsigned int message_interval = 200);
99 bool Discover(ola::io::ConnectedDescriptor *descriptor);
103 class DiscoveryState {
106 discovery_state(MANUFACTURER_SENT),
109 hardware_version(0) {
118 HARDWARE_VERSION_SENT,
122 widget_state discovery_state;
124 unsigned int sniffer_packets;
125 uint8_t hardware_version;
129 const std::auto_ptr<SuccessHandler> m_callback;
130 const std::auto_ptr<FailureHandler> m_failure_callback;
132 typedef std::map<DispatchingUsbProWidget*, DiscoveryState> WidgetStateMap;
133 WidgetStateMap m_widgets;
134 unsigned int m_timeout_ms;
139 unsigned int length);
142 DiscoveryState *discovery_state);
143 void RemoveTimeout(DiscoveryState *discovery_state);
156 const uint8_t *data);
159 const uint8_t *data);
162 const uint8_t *data);
169 static const uint8_t ENTTEC_SNIFFER_LABEL = 0x81;
170 static const uint8_t USB_PRO_MKII_API_LABEL = 13;
171 static const uint8_t DMX_PRO_MKII_VERSION = 2;
172 static const uint8_t DMX_PRO_MKII_B_VERSION = 3;
174 static const uint32_t USB_PRO_MKII_API_KEY = 0x0d11b2d7;
179 #endif // PLUGINS_USBPRO_USBPROWIDGETDETECTOR_H_ static const timeout_id INVALID_TIMEOUT
An invalid / uninitialized timeout_id.
Definition: SchedulerInterface.h:39
Combines the ExecutorInterface and the SchedulerInterface.
Definition: SchedulingExecutorInterface.h:33
A BidirectionalFileDescriptor that also generates notifications when closed.
Definition: Descriptor.h:282
void * timeout_id
A timeout handle which can later be used to cancel a timeout.
Definition: SchedulerInterface.h:34
A 2 argument callback which can be called multiple times.
Definition: Callback.h:1895
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
A 1 argument callback which can be called multiple times.
Definition: Callback.h:992