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;
A class used to hold a single universe of DMX data.
Provides a wrapper for the DeviceManager and SelectServer objects so that the plugins can register de...
A 0 argument callback which can be called multiple times.
Definition Callback.h:129
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
bool Set(const uint8_t *data, unsigned int length)
Set the contents of this DmxBuffer.
Definition DmxBuffer.cpp:137
Definition PluginAdaptor.h:41
A base class that receives DMX data asynchronously from a libusb_device.
Definition AsyncUsbReceiver.h:46
bool Init()
Initialize the receiver.
Definition AsyncUsbReceiver.cpp:43
void GetDmx(DmxBuffer *buffer)
Get DMX Buffer.
Definition AsyncUsbReceiver.h:94
AsyncUsbReceiver(ola::usb::LibUsbAdaptor *const adaptor, libusb_device *usb_device, PluginAdaptor *plugin_adaptor)
Create a new AsyncUsbReceiver.
Definition AsyncUsbReceiver.cpp:29
void SetReceiveCallback(Callback0< void > *callback)
Set the callback to be called when the receive buffer is updated.
Definition AsyncUsbReceiver.h:86
virtual ~AsyncUsbReceiver()
Destructor.
Definition AsyncUsbReceiver.cpp:37
void TransferComplete(struct libusb_transfer *transfer)
Called from the libusb callback when the asynchronous transfer completes.
Definition AsyncUsbReceiver.cpp:64
bool Start()
Start receiving DMX.
Definition AsyncUsbReceiver.cpp:55
virtual bool TransferCompleted(DmxBuffer *buffer, int transferred_size)=0
Called when the transfer completes.
virtual bool PerformTransfer()=0
Start the request of data from the widget.
A base class that implements common functionality to send or receive DMX asynchronously to a libusb_d...
Definition AsyncUsbTransceiverBase.h:39
Wraps calls to libusb so we can test the code.
Definition LibUsbAdaptor.h:36
The namespace containing all OLA symbols.
Definition Credentials.cpp:44