21#ifndef PLUGINS_USBDMX_ASYNCUSBTRANSCEIVERBASE_H_
22#define PLUGINS_USBDMX_ASYNCUSBTRANSCEIVERBASE_H_
26#include "libs/usb/LibUsbAdaptor.h"
29#include "ola/thread/Mutex.h"
47 libusb_device *usb_device);
71 libusb_device_handle *
GetHandle() {
return m_usb_handle; }
115 int length,
unsigned int timeout);
121 int length,
unsigned int timeout);
135 libusb_device_handle *m_usb_handle;
136 bool m_suppress_continuation;
137 struct libusb_transfer *m_transfer;
139 TransferState m_transfer_state;
A class used to hold a single universe of DMX data.
A base class that implements common functionality to send or receive DMX asynchronously to a libusb_d...
Definition AsyncUsbTransceiverBase.h:39
virtual ~AsyncUsbTransceiverBase()
Destructor.
Definition AsyncUsbTransceiverBase.cpp:58
libusb_device *const m_usb_device
The libusb_device passed in the constructor.
Definition AsyncUsbTransceiverBase.h:82
virtual void PostTransferHook()
Called when the transfer completes.
Definition AsyncUsbTransceiverBase.h:97
ola::usb::LibUsbAdaptor *const m_adaptor
The LibUsbAdaptor passed in the constructor.
Definition AsyncUsbTransceiverBase.h:77
void FillInterruptTransfer(unsigned char endpoint, unsigned char *buffer, int length, unsigned int timeout)
Fill an interrupt transfer.
Definition AsyncUsbTransceiverBase.cpp:107
bool Init()
Initialize the transceiver.
Definition AsyncUsbTransceiverBase.cpp:64
libusb_device_handle * GetHandle()
Get the libusb_device_handle of an already opened widget.
Definition AsyncUsbTransceiverBase.h:71
void CancelTransfer()
Cancel any pending transfers.
Definition AsyncUsbTransceiverBase.cpp:69
virtual libusb_device_handle * SetupHandle()=0
Open the device handle.
virtual void TransferComplete(struct libusb_transfer *transfer)=0
Called from the libusb callback when the asynchronous transfer completes.
AsyncUsbTransceiverBase(ola::usb::LibUsbAdaptor *const adaptor, libusb_device *usb_device)
Create a new AsyncUsbTransceiverBase.
Definition AsyncUsbTransceiverBase.cpp:47
int SubmitTransfer()
Submit the transfer for tx.
Definition AsyncUsbTransceiverBase.cpp:115
void FillControlTransfer(unsigned char *buffer, unsigned int timeout)
Fill a control transfer.
Definition AsyncUsbTransceiverBase.cpp:93
void FillBulkTransfer(unsigned char endpoint, unsigned char *buffer, int length, unsigned int timeout)
Fill a bulk transfer.
Definition AsyncUsbTransceiverBase.cpp:99
Wraps calls to libusb so we can test the code.
Definition LibUsbAdaptor.h:36
The namespace containing all OLA symbols.
Definition Credentials.cpp:44