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;
148 #endif // PLUGINS_USBDMX_ASYNCUSBTRANSCEIVERBASE_H_ libusb_device_handle * GetHandle()
Get the libusb_device_handle of an already opened widget.
Definition: AsyncUsbTransceiverBase.h:71
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Creates dummy copy constructor and assignment operator declarations.
Definition: Macro.h:44
virtual ~AsyncUsbTransceiverBase()
Destructor.
Definition: AsyncUsbTransceiverBase.cpp:58
void FillControlTransfer(unsigned char *buffer, unsigned int timeout)
Fill a control transfer.
Definition: AsyncUsbTransceiverBase.cpp:93
libusb_device *const m_usb_device
The libusb_device passed in the constructor.
Definition: AsyncUsbTransceiverBase.h:82
ola::usb::LibUsbAdaptor *const m_adaptor
The LibUsbAdaptor passed in the constructor.
Definition: AsyncUsbTransceiverBase.h:77
virtual void TransferComplete(struct libusb_transfer *transfer)=0
Called from the libusb callback when the asynchronous transfer completes.
A base class that implements common functionality to send or receive DMX asynchronously to a libusb_d...
Definition: AsyncUsbTransceiverBase.h:39
A class used to hold a single universe of DMX data.
bool Init()
Initialize the transceiver.
Definition: AsyncUsbTransceiverBase.cpp:64
void FillBulkTransfer(unsigned char endpoint, unsigned char *buffer, int length, unsigned int timeout)
Fill a bulk transfer.
Definition: AsyncUsbTransceiverBase.cpp:99
virtual libusb_device_handle * SetupHandle()=0
Open the device handle.
void FillInterruptTransfer(unsigned char endpoint, unsigned char *buffer, int length, unsigned int timeout)
Fill an interrupt transfer.
Definition: AsyncUsbTransceiverBase.cpp:107
AsyncUsbTransceiverBase(ola::usb::LibUsbAdaptor *const adaptor, libusb_device *usb_device)
Create a new AsyncUsbTransceiverBase.
Definition: AsyncUsbTransceiverBase.cpp:47
void CancelTransfer()
Cancel any pending transfers.
Definition: AsyncUsbTransceiverBase.cpp:69
int SubmitTransfer()
Submit the transfer for tx.
Definition: AsyncUsbTransceiverBase.cpp:115
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
virtual void PostTransferHook()
Called when the transfer completes.
Definition: AsyncUsbTransceiverBase.h:97
Wraps calls to libusb so we can test the code.
Definition: LibUsbAdaptor.h:36