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);
187 const std::string m_description;
195 #endif // PLUGINS_USBPRO_USBPRODEVICE_H_
Definition: Universe.h:45
Provides a wrapper for the DeviceManager and SelectServer objects so that the plugins can register de...
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
Start an incremental discovery operation.
Definition: EnttecUsbProWidget.cpp:695
Definition: UsbProDevice.h:42
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition: RDMCommand.h:233
Used to hold a single universe of DMX data.
Definition: DmxBuffer.h:49
BasicOutputPort(AbstractDevice *parent, unsigned int port_id, bool start_rdm_discovery_on_patch=false, bool supports_rdm=false)
Create a new BasicOutputPort.
Definition: Port.cpp:120
#define OLA_INFO
Definition: Logging.h:81
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition: UsbProDevice.h:180
A class used to hold a single universe of DMX data.
Definition: TokenBucket.h:29
Definition: PluginAdaptor.h:41
std::string Description() const
Fetch the string description for a Port.
Definition: UsbProDevice.h:184
std::string DeviceId() const
The device ID.
Definition: UsbProDevice.h:52
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
Start a full discovery operation.
Definition: EnttecUsbProWidget.cpp:686
Definition: UsbProDevice.h:142
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition: UsbProDevice.h:176
Definition: UsbSerialDevice.h:36
The base class for all 1 argument callbacks.
Definition: Callback.h:982
bool WriteDMX(const DmxBuffer &buffer, uint8_t)
Write DMX data to this port.
Definition: UsbProDevice.h:158
Definition: EnttecUsbProWidget.h:49
void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *on_complete)
Send a RDM command.
Definition: EnttecUsbProWidget.cpp:676
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *callback)
Handle an RDMRequest, subclasses can implement this to support RDM.
Definition: UsbProDevice.h:171
A RpcController object is passed every time an RPC is invoked and is used to indicate the success or ...
Definition: RpcController.h:42