21 #ifndef PLUGINS_USBPRO_USBPRODEVICE_H_
22 #define PLUGINS_USBPRO_USBPRODEVICE_H_
27 #include "olad/TokenBucket.h"
29 #include "olad/Port.h"
31 #include "plugins/usbpro/EnttecUsbProWidget.h"
32 #include "plugins/usbpro/UsbSerialDevice.h"
33 #include "plugins/usbpro/messages/UsbProConfigMessages.pb.h"
46 const std::string &name,
49 uint16_t firmware_version,
50 unsigned int fps_limit);
52 std::string
DeviceId()
const {
return m_serial; }
55 const std::string &request,
56 std::string *response,
57 ConfigureCallback *done);
59 bool AllowMultiPortPatching()
const {
return true; }
72 void UpdateParams(
unsigned int port_id,
bool status,
73 const usb_pro_parameters ¶ms);
76 const ola::plugin::usbpro::Request *request,
77 std::string *response,
78 ConfigureCallback *done);
81 std::string *response,
82 ConfigureCallback *done,
85 const usb_pro_parameters ¶ms);
88 const ola::plugin::usbpro::Request *request,
89 std::string *response,
90 ConfigureCallback *done);
93 const ola::plugin::usbpro::Request *request,
94 std::string *response,
95 ConfigureCallback *done);
98 std::string *response,
99 ConfigureCallback *done,
101 uint8_t port1_assignment,
102 uint8_t port2_assignment);
104 static std::string SerialToString(uint32_t serial);
106 EnttecUsbProWidget *m_pro_widget;
107 std::string m_serial;
108 std::vector<PortParams> m_port_params;
122 const std::string &description)
124 m_description(description),
128 return m_port->FetchDMX();
134 const std::string m_description;
148 const std::string &description,
150 unsigned int max_burst,
152 :
BasicOutputPort(parent,
id, port->SupportsRDM(), port->SupportsRDM()),
153 m_description(description),
155 m_bucket(max_burst, rate, max_burst, *wake_time),
156 m_wake_time(wake_time) {}
159 if (m_bucket.GetToken(*m_wake_time))
160 return m_port->SendDMX(buffer);
162 OLA_INFO <<
"Port rated limited, dropping frame";
168 m_port->ChangeToReceiveMode(
false);
184 std::string Description()
const {
return m_description; }
187 const std::string m_description;
195 #endif // PLUGINS_USBPRO_USBPRODEVICE_H_