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;
113 MessageCallback *callback)
115 m_callback(callback) {
127 void SetHandler(MessageCallback *callback) {
130 m_callback = callback;
134 MessageCallback *m_callback;
136 void HandleMessage(uint8_t label,
138 unsigned int length) {
139 m_callback->Run(label, data, length);
145 #endif // PLUGINS_USBPRO_BASEUSBPROWIDGET_H_
A BidirectionalFileDescriptor that also generates notifications when closed.
Definition: Descriptor.h:282
Used to hold a single universe of DMX data.
Definition: DmxBuffer.h:49
A class used to hold a single universe of DMX data.
A 3 argument callback which can be called multiple times.
Definition: Callback.h:2838
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44