21 #ifndef PLUGINS_USBPRO_ULTRADMXPRODEVICE_H_
22 #define PLUGINS_USBPRO_ULTRADMXPRODEVICE_H_
27 #include "olad/TokenBucket.h"
29 #include "olad/Port.h"
31 #include "plugins/usbpro/UltraDMXProWidget.h"
32 #include "plugins/usbpro/UsbSerialDevice.h"
33 #include "plugins/usbpro/messages/UsbProConfigMessages.pb.h"
46 const std::string &name,
51 uint16_t firmware_version,
52 unsigned int fps_limit);
54 std::string
DeviceId()
const {
return m_serial; }
56 bool AllowMultiPortPatching()
const {
return true; }
59 const std::string &request,
60 std::string *response,
61 ConfigureCallback *done);
67 void UpdateParams(
bool status,
const usb_pro_parameters ¶ms);
70 const ola::plugin::usbpro::Request *request,
71 std::string *response,
72 ConfigureCallback *done);
75 std::string *response,
76 ConfigureCallback *done,
78 const usb_pro_parameters ¶ms);
81 const ola::plugin::usbpro::Request *request,
82 std::string *response,
83 ConfigureCallback *done);
85 UltraDMXProWidget *m_ultra_widget;
88 bool m_got_parameters;
104 const std::string &description)
106 m_description(description),
116 const std::string m_description;
129 const std::string &description,
131 unsigned int max_burst,
135 m_description(description),
137 m_bucket(max_burst, rate, max_burst, *wake_time),
138 m_wake_time(wake_time),
139 m_primary(primary) {}
142 if (m_bucket.GetToken(*m_wake_time)) {
143 return m_primary ? m_widget->SendDMX(buffer)
144 : m_widget->SendSecondaryDMX(buffer);
146 OLA_INFO <<
"Port rated limited, dropping frame";
151 std::string Description()
const {
return m_description; }
154 const std::string m_description;
155 UltraDMXProWidget *m_widget;
163 #endif // PLUGINS_USBPRO_ULTRADMXPRODEVICE_H_