Open Lighting Architecture: ola::usb::LibUsbSimpleThread Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ola::usb::LibUsbSimpleThread Class Reference

## Detailed Description

The non-hotplug version of LibUsbThread.

The libusb thread is only run when one of more handles are open. Otherwise there is no way to interrupt libusb_handle_events(). See the libusb Async documentation at http://libusb.sourceforge.net/api-1.0/group__asyncio.html for more information.

Inheritance diagram for ola::usb::LibUsbSimpleThread:

## Public Member Functions
| LibUsbSimpleThread (libusb_context *context)
| Create a new LibUsbHotplugThread.
void | OpenHandle ()
| This must be called whenever libusb_open() is called.
void | CloseHandle (libusb_device_handle *handle)
| This must be called whenever libusb_close() is called.
Public Member Functions inherited from ola::usb::LibUsbThread
| LibUsbThread (libusb_context *context)
| Base constructor.
virtual | ~LibUsbThread ()
| Destructor.
virtual bool | Init ()
| Initialize the thread.
virtual void | Shutdown ()
| Shutdown the thread.
void * | Run ()
| The entry point to the libusb thread.

## Additional Inherited Members
Protected Member Functions inherited from ola::usb::LibUsbThread
void | SetTerminate ()
| Indicate that the libusb thread should terminate.
void | LaunchThread ()
| Start the libusb thread.
void | JoinThread ()
| Join the libusb thread.
libusb_context * | Context () const
| Return the libusb_context this thread uses.

## Constructor & Destructor Documentation

## ◆ LibUsbSimpleThread()

ola::usb::LibUsbSimpleThread::LibUsbSimpleThread | ( | libusb_context * | context | ) |
| inlineexplicit

Create a new LibUsbHotplugThread.

Parameters

  context | the libusb context to use.

The thread is starts as soon as this object is created. When the object is destroyed, the handle is de-registered as part of the thread shutdown sequence.

## Member Function Documentation

## ◆ CloseHandle()

void ola::usb::LibUsbSimpleThread::CloseHandle | ( | libusb_device_handle * | handle | ) |
| virtual

This must be called whenever libusb_close() is called.

Implements ola::usb::LibUsbThread.

## ◆ OpenHandle()

void ola::usb::LibUsbSimpleThread::OpenHandle | ( |  | ) |
| virtual

This must be called whenever libusb_open() is called.

Implements ola::usb::LibUsbThread.

The documentation for this class was generated from the following files:

- libs/usb/LibUsbThread.h
- libs/usb/LibUsbThread.cpp