21 #ifndef PLUGINS_USBDMX_ASYNCUSBRECEIVER_H_
22 #define PLUGINS_USBDMX_ASYNCUSBRECEIVER_H_
27 #include "AsyncUsbTransceiverBase.h"
28 #include "libs/usb/LibUsbAdaptor.h"
32 #include "ola/thread/Mutex.h"
55 libusb_device *usb_device,
74 bool Init(libusb_device_handle* handle);
87 m_receive_callback.reset(callback);
96 buffer->
Set(m_rx_buffer);
127 bool m_inited_with_handle;
130 std::auto_ptr<Callback0<void> > m_receive_callback;
137 #endif // PLUGINS_USBDMX_ASYNCUSBRECEIVER_H_
Provides a wrapper for the DeviceManager and SelectServer objects so that the plugins can register de...
virtual ~AsyncUsbReceiver()
Destructor.
Definition: AsyncUsbReceiver.cpp:37
AsyncUsbReceiver(ola::usb::LibUsbAdaptor *const adaptor, libusb_device *usb_device, PluginAdaptor *plugin_adaptor)
Create a new AsyncUsbReceiver.
Definition: AsyncUsbReceiver.cpp:29
bool Set(const uint8_t *data, unsigned int length)
Set the contents of this DmxBuffer.
Definition: DmxBuffer.cpp:137
A base class that receives DMX data asynchronously from a libusb_device.
Definition: AsyncUsbReceiver.h:46
virtual bool PerformTransfer()=0
Start the request of data from the widget.
bool Start()
Start receiving DMX.
Definition: AsyncUsbReceiver.cpp:55
A base class that implements common functionality to send or receive DMX asynchronously to a libusb_d...
Definition: AsyncUsbTransceiverBase.h:39
Used to hold a single universe of DMX data.
Definition: DmxBuffer.h:49
A class used to hold a single universe of DMX data.
Definition: PluginAdaptor.h:41
virtual bool TransferCompleted(DmxBuffer *buffer, int transferred_size)=0
Called when the transfer completes.
void GetDmx(DmxBuffer *buffer)
Get DMX Buffer.
Definition: AsyncUsbReceiver.h:94
void TransferComplete(struct libusb_transfer *transfer)
Called from the libusb callback when the asynchronous transfer completes.
Definition: AsyncUsbReceiver.cpp:64
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
void SetReceiveCallback(Callback0< void > *callback)
Set the callback to be called when the receive buffer is updated.
Definition: AsyncUsbReceiver.h:86
bool Init()
Initialize the receiver.
Definition: AsyncUsbReceiver.cpp:43
Wraps calls to libusb so we can test the code.
Definition: LibUsbAdaptor.h:36