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;
96 unsigned int message_interval = 200);
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_VERISON = 2;
173 static const uint32_t USB_PRO_MKII_API_KEY = 0x0d11b2d7;
178 #endif // PLUGINS_USBPRO_USBPROWIDGETDETECTOR_H_