Open Lighting Architecture: ola::usb::JaRuleWidgetPort Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ola::usb::JaRuleWidgetPort Class Reference

## Detailed Description

The internal model of a port on a JaRule device.

Each port has its own libusb transfers as well as a command queue. This avoids slow commands on one port blocking another.

## Public Member Functions
| JaRuleWidgetPort (ola::thread::ExecutorInterface *executor, LibUsbAdaptor *adaptor, libusb_device_handle *usb_handle, uint8_t endpoint_number, const ola::rdm::UID &uid, uint8_t physical_port)
| Create a new JaRuleWidgetPort.
| ~JaRuleWidgetPort ()
| Destructor.
JaRulePortHandle * | ClaimPort ()
| Claim the handle to this port.
void | ReleasePort ()
| Release a handle to a port.
void | CancelAll ()
| Cancel all commands for this port.
void | SendCommand (CommandClass command, const uint8_t *data, unsigned int size, CommandCompleteCallback *callback)
| Send a command on this port.
void | _OutTransferComplete ()
| Called by the libusb callback when the transfer completes or is cancelled.
void | _InTransferComplete ()
| Called by the libusb callback when the transfer completes or is cancelled.

## Constructor & Destructor Documentation

## ◆ JaRuleWidgetPort()

ola::usb::JaRuleWidgetPort::JaRuleWidgetPort | ( | ola::thread::ExecutorInterface * | executor,
|  | LibUsbAdaptor * | adaptor,
|  | libusb_device_handle * | usb_handle,
|  | uint8_t | endpoint_number,
|  | const ola::rdm::UID & | uid,
|  | uint8_t | physical_port )

Create a new JaRuleWidgetPort.

Parameters

  executor | The Executor to run the callbacks on.
  adaptor | The LibUsbAdaptor to use.
  usb_handle | the libusb_device_handle for the Ja Rule widget.
  endpoint_number | The endpoint to use for transfers.
  uid | The device's UID.
  physical_port | The physical port index.

## Member Function Documentation

## ◆ ClaimPort()

JaRulePortHandle * ola::usb::JaRuleWidgetPort::ClaimPort | ( |  | ) |

Claim the handle to this port.

Returns
  a port handle, ownership is not transferred. Will return NULL if the port is already claimed.

## ◆ ReleasePort()

void ola::usb::JaRuleWidgetPort::ReleasePort | ( |  | ) |

Release a handle to a port.

Returns
  a port handle, ownership is not transferred.

## ◆ SendCommand()

void ola::usb::JaRuleWidgetPort::SendCommand | ( | CommandClass | command,
|  | const uint8_t * | data,
|  | unsigned int | size,
|  | CommandCompleteCallback * | callback )

Send a command on this port.

Parameters

  command | the Command type.
  data | the payload data. The data is copied and can be freed once the method returns.
  size | the payload size.
  callback | The callback to run when the command completes. This may be run immediately in some conditions.

SendCommand() can be called from any thread, and messages will be queued.

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

- libs/usb/JaRuleWidgetPort.h
- libs/usb/JaRuleWidgetPort.cpp