22 #ifndef PLUGINS_USBPRO_BASEUSBPROWIDGET_H_
23 #define PLUGINS_USBPRO_BASEUSBPROWIDGET_H_
30 #include "plugins/usbpro/SerialWidgetInterface.h"
48 void DescriptorReady();
51 virtual bool SendDMX(
const DmxBuffer &buffer);
53 bool SendMessage(uint8_t label,
55 unsigned int length)
const;
59 static const uint8_t DEVICE_LABEL = 78;
60 static const uint8_t DMX_LABEL = 6;
61 static const uint8_t GET_PARAMS = 3;
62 static const uint8_t HARDWARE_VERSION_LABEL = 14;
63 static const uint8_t MANUFACTURER_LABEL = 77;
64 static const uint8_t SERIAL_LABEL = 10;
76 enum {MAX_DATA_SIZE = 600};
86 receive_state m_state;
87 unsigned int m_bytes_received;
88 message_header m_header;
89 uint8_t m_recv_buffer[MAX_DATA_SIZE];
91 void ReceiveMessage();
92 virtual void HandleMessage(uint8_t label,
94 unsigned int length) = 0;
96 static const uint8_t EOM = 0xe7;
97 static const uint8_t SOM = 0x7e;
98 static const unsigned int HEADER_SIZE;
115 m_callback(callback) {
130 m_callback = callback;
136 void HandleMessage(uint8_t label,
138 unsigned int length) {
139 m_callback->Run(label, data, length);
145 #endif // PLUGINS_USBPRO_BASEUSBPROWIDGET_H_