21 #ifndef PLUGINS_USBPRO_USBPRODEVICE_H_
22 #define PLUGINS_USBPRO_USBPRODEVICE_H_
27 #include "olad/TokenBucket.h"
28 #include "olad/PluginAdaptor.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,
59 bool AllowMultiPortPatching()
const {
return true; }
72 void UpdateParams(
unsigned int port_id,
bool status,
76 const ola::plugin::usbpro::Request *request,
77 std::string *response,
81 std::string *response,
88 const ola::plugin::usbpro::Request *request,
89 std::string *response,
93 const ola::plugin::usbpro::Request *request,
94 std::string *response,
98 std::string *response,
101 uint8_t port1_assignment,
102 uint8_t port2_assignment);
104 static std::string SerialToString(uint32_t serial);
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();
131 std::string Description()
const {
return m_description; }
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) {}
158 bool WriteDMX(
const DmxBuffer &buffer, uint8_t) {
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);
181 m_port->RunIncrementalDiscovery(callback);
184 std::string Description()
const {
return m_description; }
187 const std::string m_description;
195 #endif // PLUGINS_USBPRO_USBPRODEVICE_H_