|
co_usb
|
USB endpoint aggregate templated on its direction. More...
#include <endpoint.hpp>
Public Member Functions | |
| uint8_t | addr () const noexcept |
| auto | devh () const noexcept -> libusb_device_handle *requires(Direction !=endpoint_direction::any) |
| template<endpoint_direction ToDirection> requires (Direction == endpoint_direction::any && ToDirection != endpoint_direction::any) | |
| std::optional< endpoint< ToDirection > > | as () const noexcept |
Cast an any endpoint to a concrete direction. | |
Static Public Member Functions | |
| template<co_usb::detail::DeviceHandleSource DevSourceTy> requires (Direction != endpoint_direction::any) | |
| static endpoint< Direction > | make_safe (uint8_t ep, DevSourceTy const &dev_source) noexcept |
| Makes an endpoint and completes address to proper value. | |
| template<co_usb::detail::DeviceHandleSource DevSourceTy> | |
| static endpoint< Direction > | make_unsafe (uint8_t ep, DevSourceTy const &devh) noexcept |
| template<co_usb::detail::DeviceHandleSource DevSourceTy> requires (Direction != endpoint_direction::any) | |
| static endpoint< Direction > | make_throwing (uint8_t ep, DevSourceTy const &devh) |
| Creates an endpoint or throws if the address doesn't match expected direction. | |
USB endpoint aggregate templated on its direction.
Must be used with transfer types to provide directional information. Prefer make_safe function to construct a valid endpoint.
| Direction | direction of an endpoint. Value co_usb::ep_direction::any is semantically equal to an unknown endpoint direction and as such only allows casts to either in or out endpoint. |
|
inlinenoexcept |
|
inlinenoexcept |
Cast an any endpoint to a concrete direction.
Cast is performed on the basis of endpoint address containing LIBUSB_ENDPOINT_IN bit set to 1.
|
inlinenoexcept |
|
inlinestaticnoexcept |
Makes an endpoint and completes address to proper value.
Example:
|
inlinestatic |
Creates an endpoint or throws if the address doesn't match expected direction.
| std::invalid_argument | when endpoint address does not match Direction |
|
inlinestaticnoexcept |