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,
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();
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";
169 m_port->ChangeToReceiveMode(
false);
175 m_port->SendRDMRequest(request, callback);
179 m_port->RunFullDiscovery(callback);
183 m_port->RunIncrementalDiscovery(callback);
189 const std::string m_description;
197 #endif // PLUGINS_USBPRO_USBPRODEVICE_H_ Definition: Universe.h:46
Definition: GenericUsbProWidget.h:36
Provides a wrapper for the DeviceManager and SelectServer objects so that the plugins can register de...
Definition: UsbProDevice.h:42
bool AllowMultiPortPatching() const
Allow multiple ports of the same type to be patched to the same universe.
Definition: UsbProDevice.h:59
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition: RDMCommand.h:234
std::string DeviceId() const
The device ID.
Definition: UsbProDevice.h:52
Used to hold a single universe of DMX data.
Definition: DmxBuffer.h:49
#define OLA_INFO
Definition: Logging.h:83
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition: UsbProDevice.h:182
A class used to hold a single universe of DMX data.
Definition: TokenBucket.h:29
Definition: PluginAdaptor.h:41
Definition: UsbProDevice.h:142
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition: UsbProDevice.h:178
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
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:173
A RpcController object is passed every time an RPC is invoked and is used to indicate the success or ...
Definition: RpcController.h:42
Represents a point in time with microsecond accuracy.
Definition: Clock.h:191
void Configure(ola::rpc::RpcController *controller, const std::string &request, std::string *response, ConfigureCallback *done)
Configure this Device.
Definition: UsbProDevice.cpp:116
std::string Description() const
Fetch the string description for a Port.
Definition: UsbProDevice.h:186