Open Lighting Architecture  0.9.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
ola::plugin::usbdmx::JaRuleWidgetImpl Class Reference

Detailed Description

The internal implementation of a JaRuleWidget.

Inheritance diagram for ola::plugin::usbdmx::JaRuleWidgetImpl:
Inheritance graph
[legend]
Collaboration diagram for ola::plugin::usbdmx::JaRuleWidgetImpl:
Collaboration graph
[legend]

Public Member Functions

 JaRuleWidgetImpl (ola::io::SelectServerInterface *ss, AsyncronousLibUsbAdaptor *adaptor, libusb_device *device, const ola::rdm::UID &controller_uid)
 Create a new JaRuleWidgetImpl.
bool Init ()
 Initialize the widget.
void RunFullDiscovery (ola::rdm::RDMDiscoveryCallback *callback)
 Start a full discovery operation.
void RunIncrementalDiscovery (ola::rdm::RDMDiscoveryCallback *callback)
 Start an incremental discovery operation.
void SendRDMRequest (ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *on_complete)
 Send a RDM command.
void MuteDevice (const ola::rdm::UID &target, MuteDeviceCallback *mute_complete)
 Mute a device.
void UnMuteAll (UnMuteDeviceCallback *unmute_complete)
 Unmute all devices.
void Branch (const ola::rdm::UID &lower, const ola::rdm::UID &upper, BranchCallback *branch_complete)
 Send a DUB command.
bool SendDMX (const DmxBuffer &buffer)
 Send DMX data from this widget.
void ResetDevice ()
 Send a reset message to the hardware widget.

Additional Inherited Members

- Public Types inherited from ola::rdm::DiscoveryTargetInterface
typedef ola::BaseCallback1
< void, bool > 
MuteDeviceCallback
 The callback run when a mute command completes.
typedef ola::BaseCallback0< void > UnMuteDeviceCallback
 The callback run when an unmute command completes.
typedef ola::BaseCallback2
< void, const uint8_t
*, unsigned int > 
BranchCallback
 The callback run when a DUB command completes.

Constructor & Destructor Documentation

ola::plugin::usbdmx::JaRuleWidgetImpl::JaRuleWidgetImpl ( ola::io::SelectServerInterface ss,
AsyncronousLibUsbAdaptor adaptor,
libusb_device *  device,
const ola::rdm::UID controller_uid 
)

Create a new JaRuleWidgetImpl.

Parameters
ssThe SelectServer to run the RDM callbacks on.
adaptorThe LibUsbAdaptor to use.
devicethe libusb_device for the Ja Rule widget.
controller_uidThe UID of the controller. This is used for DUB & Mute / Unmute messages.

Member Function Documentation

void ola::plugin::usbdmx::JaRuleWidgetImpl::Branch ( const ola::rdm::UID lower,
const ola::rdm::UID upper,
BranchCallback callback 
)
virtual

Send a DUB command.

Parameters
lowerthe lower bound UID.
upperthe upper bound UID.
callbackthe callback to run when the DUB completes.

Any data received in response to the DUB command should be passed back when the callback is run.

Implements ola::rdm::DiscoveryTargetInterface.

bool ola::plugin::usbdmx::JaRuleWidgetImpl::Init ( )

Initialize the widget.

Returns
true if the USB device was claimed correctly.
void ola::plugin::usbdmx::JaRuleWidgetImpl::MuteDevice ( const ola::rdm::UID target,
MuteDeviceCallback mute_complete 
)
virtual

Mute a device.

Parameters
targetthe device to mute
mute_completethe callback to run when the mute operations completes.

Implements ola::rdm::DiscoveryTargetInterface.

void ola::plugin::usbdmx::JaRuleWidgetImpl::RunFullDiscovery ( ola::rdm::RDMDiscoveryCallback callback)
virtual

Start a full discovery operation.

Parameters
callbackThe callback run when discovery completes. This may run immediately in some implementations.

Implements ola::rdm::DiscoverableRDMControllerInterface.

void ola::plugin::usbdmx::JaRuleWidgetImpl::RunIncrementalDiscovery ( ola::rdm::RDMDiscoveryCallback callback)
virtual

Start an incremental discovery operation.

Parameters
callbackThe callback run when discovery completes. This may run immediately in some implementations.

Implements ola::rdm::DiscoverableRDMControllerInterface.

bool ola::plugin::usbdmx::JaRuleWidgetImpl::SendDMX ( const DmxBuffer buffer)

Send DMX data from this widget.

Parameters
bufferThe DmxBuffer containing the data to send.
Returns
true if the data was sent, false otherwise.
void ola::plugin::usbdmx::JaRuleWidgetImpl::SendRDMRequest ( ola::rdm::RDMRequest request,
ola::rdm::RDMCallback on_complete 
)
virtual

Send a RDM command.

Parameters
requestthe RDMRequest, ownership is transferred.
on_completeThe callback to run when the request completes.

Implementors much ensure that the callback is always run at some point. In other words, there must be no way that a request can be dropped in such a way that the callback is never run. Doing so will either block all subsequent requests, or leak memory depending on the implementation.

Also the implementor of this class may want to re-write the transaction #, and possibly the UID (changing src UIDs isn't addressed by the RDM spec).

The RDMRequest may be a DISCOVERY_COMMAND, if the implementation does not support DISCOVERY_COMMANDs then the callback should be run with ola::rdm::RDM_PLUGIN_DISCOVERY_NOT_SUPPORTED.

Implements ola::rdm::RDMControllerInterface.

void ola::plugin::usbdmx::JaRuleWidgetImpl::UnMuteAll ( UnMuteDeviceCallback unmute_complete)
virtual

Unmute all devices.

Parameters
unmute_completethe callback to run when the unmute operation completes.

Implements ola::rdm::DiscoveryTargetInterface.


The documentation for this class was generated from the following files: