21 #ifndef LIBS_USB_LIBUSBTHREAD_H_ 22 #define LIBS_USB_LIBUSBTHREAD_H_ 28 #endif // HAVE_CONFIG_H 31 #include "ola/thread/Thread.h" 98 virtual void CloseHandle(libusb_device_handle *handle) = 0;
126 libusb_context*
Context()
const {
return m_context; }
129 libusb_context *m_context;
134 #if HAVE_LIBUSB_HOTPLUG_API 151 LibUsbHotplugThread(libusb_context *context,
152 libusb_hotplug_callback_fn callback_fn,
164 libusb_hotplug_callback_handle m_hotplug_handle;
165 libusb_hotplug_callback_fn m_callback_fn;
171 #endif // HAVE_LIBUSB_HOTPLUG_API 200 unsigned int m_device_count;
206 #endif // LIBS_USB_LIBUSBTHREAD_H_ void LaunchThread()
Start the libusb thread.
Definition: LibUsbThread.cpp:49
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Creates dummy copy constructor and assignment operator declarations.
Definition: Macro.h:44
void * Run()
The entry point to the libusb thread.
Definition: LibUsbThread.cpp:34
virtual void OpenHandle()=0
This must be called whenever libusb_open() is called.
void JoinThread()
Join the libusb thread.
Definition: LibUsbThread.cpp:54
LibUsbSimpleThread(libusb_context *context)
Create a new LibUsbHotplugThread.
Definition: LibUsbThread.h:191
virtual ~LibUsbThread()
Destructor.
Definition: LibUsbThread.h:69
The non-hotplug version of LibUsbThread.
Definition: LibUsbThread.h:181
The base class for the dedicated libusb thread.
Definition: LibUsbThread.h:55
LibUsbThread(libusb_context *context)
Base constructor.
Definition: LibUsbThread.h:61
void SetTerminate()
Indicate that the libusb thread should terminate.
Definition: LibUsbThread.h:107
virtual void CloseHandle(libusb_device_handle *handle)=0
This must be called whenever libusb_close() is called.
libusb_context * Context() const
Return the libusb_context this thread uses.
Definition: LibUsbThread.h:126
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
virtual bool Init()
Initialize the thread.
Definition: LibUsbThread.h:74
virtual void Shutdown()
Shutdown the thread.
Definition: LibUsbThread.h:81