22 #ifndef PLUGINS_USBPRO_USBPROWIDGETDETECTOR_H_
23 #define PLUGINS_USBPRO_USBPROWIDGETDETECTOR_H_
25 #include <ola/thread/SchedulingExecutorInterface.h>
30 #include "plugins/usbpro/WidgetDetectorInterface.h"
38 class DispatchingUsbProWidget;
45 typedef uint32_t DeviceSerialNumber;
54 esta_id(other.esta_id),
55 device_id(other.device_id),
57 manufacturer(other.manufacturer),
59 dual_port(other.dual_port) {
62 enum {SERIAL_LENGTH = 4};
66 DeviceSerialNumber serial;
88 unsigned int message_interval = 200);
95 class DiscoveryState {
98 discovery_state(MANUFACTURER_SENT),
99 timeout_id(ola::thread::INVALID_TIMEOUT),
101 hardware_version(0) {
109 HARDWARE_VERSION_SENT,
113 widget_state discovery_state;
114 ola::thread::timeout_id timeout_id;
115 unsigned int sniffer_packets;
116 uint8_t hardware_version;
120 const auto_ptr<SuccessHandler> m_callback;
121 const auto_ptr<FailureHandler> m_failure_callback;
123 typedef std::map<DispatchingUsbProWidget*, DiscoveryState> WidgetStateMap;
124 WidgetStateMap m_widgets;
125 unsigned int m_timeout_ms;
130 unsigned int length);
133 DiscoveryState *discovery_state);
134 void RemoveTimeout(DiscoveryState *discovery_state);
146 const uint8_t *data);
149 const uint8_t *data);
156 static const uint8_t ENTTEC_SNIFFER_LABEL = 0x81;
157 static const uint8_t USB_PRO_MKII_API_LABEL = 13;
158 static const uint8_t DMX_PRO_MKII_VERISON = 2;
160 static const uint32_t USB_PRO_MKII_API_KEY = 0x0d11b2d7;
165 #endif // PLUGINS_USBPRO_USBPROWIDGETDETECTOR_H_