|
co_usb
|
Trivial single-threaded libusb event handler. More...
#include <handlers.hpp>
Public Member Functions | |
| auto | start (libusb_context *usb_ctx, std::stop_token stop) -> bool |
| Start the libusb event processing loop. | |
| auto | ref () noexcept |
| Increment internal reference count. | |
| auto | unref () noexcept |
| Decrement internal reference count. | |
| auto | stop () |
| Stop the event loop and wait for the thread to finish. | |
| ~trivial_event_handler () | |
| Stop the event thread on destruction. | |
Trivial single-threaded libusb event handler.
This handler starts a background loop that repeatedly calls libusb_handle_events_timeout() until std::stop_token requests stop.
|
inline |
Stop the event thread on destruction.
|
inlinenoexcept |
Increment internal reference count.
This implementation is a no-op.
|
inline |
Start the libusb event processing loop.
| usb_ctx | libusb context to handle events for. |
| stop | Stop token used to end the loop. |
true on successful start.
|
inline |
Stop the event loop and wait for the thread to finish.
Must block until handling is stopped.
|
inlinenoexcept |
Decrement internal reference count.
This implementation is a no-op.