21 #ifndef PLUGINS_USBPRO_BASEROBEWIDGET_H_
22 #define PLUGINS_USBPRO_BASEROBEWIDGET_H_
28 #include "plugins/usbpro/SerialWidgetInterface.h"
47 bool SendMessage(uint8_t label,
49 unsigned int length)
const;
51 static const uint8_t CHANNEL_A_OUT = 0x06;
52 static const uint8_t INFO_REQUEST = 0x14;
53 static const uint8_t INFO_RESPONSE = 0x15;
54 static const uint8_t RDM_DISCOVERY = 0x12;
55 static const uint8_t RDM_DISCOVERY_RESPONSE = 0x13;
56 static const uint8_t RDM_REQUEST = 0x10;
57 static const uint8_t RDM_RESPONSE = 0x11;
58 static const uint8_t UID_REQUEST = 0x24;
59 static const uint8_t UID_RESPONSE = 0x25;
60 static const uint8_t DMX_IN_REQUEST = 0x04;
61 static const uint8_t DMX_IN_RESPONSE = 0x05;
74 enum {MAX_DATA_SIZE = 522};
85 receive_state m_state;
86 unsigned int m_bytes_received, m_data_size;
88 message_header m_header;
89 uint8_t m_recv_buffer[MAX_DATA_SIZE];
91 void DescriptorReady();
92 void ReceiveMessage();
93 virtual void HandleMessage(uint8_t label,
95 unsigned int length) = 0;
97 static const uint8_t SOM = 0xa5;
98 static const unsigned int HEADER_SIZE;
112 MessageCallback *callback = NULL)
114 m_callback(callback) {
126 void SetHandler(MessageCallback *callback) {
129 m_callback = callback;
133 MessageCallback *m_callback;
135 void HandleMessage(uint8_t label,
137 unsigned int length) {
138 m_callback->Run(label, data, length);
144 #endif // PLUGINS_USBPRO_BASEROBEWIDGET_H_
A BidirectionalFileDescriptor that also generates notifications when closed.
Definition: Descriptor.h:282
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