RAII wrapper for detaching and reattaching kernel driver.
More...
#include <driver_guard.hpp>
RAII wrapper for detaching and reattaching kernel driver.
This type assumes the driver is already detached at the point of construction. The destructor will attempt to release the interface and may throw if the attach operation fails.
- Note
- Satisfies detail::DeviceHandleSource.
- See also
- co_usb::detach_driver
◆ ~driver_guard()
| co_usb::driver_guard::~driver_guard |
( |
| ) |
|
|
inline |
◆ driver_guard() [1/3]
◆ driver_guard() [2/3]
◆ driver_guard() [3/3]
| co_usb::driver_guard::driver_guard |
( |
detail::DeviceHandleSource auto const & |
devh_src, |
|
|
int |
driver_guard_num |
|
) |
| |
|
inlineexplicit |
◆ attach()
| auto co_usb::driver_guard::attach |
( |
std::error_code & |
ec | ) |
-> void
|
|
inlinenoexcept |
Reattaches the detached kernel driver.
Sets the error code if the release operation fails.
◆ devh()
| auto co_usb::driver_guard::devh |
( |
| ) |
const -> libusb_device_handle *
|
|
inlinenoexcept |
◆ interface_num()
| auto co_usb::driver_guard::interface_num |
( |
| ) |
const -> int
|
|
inlinenoexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
The documentation for this struct was generated from the following file: