pub trait ControlPipeExt<D: Direction>: UsbPipe<Control, D> {
// Provided methods
async fn request_descriptor<T: USBDescriptor, const SIZE: usize>(
&mut self,
index: u8,
class: bool,
) -> Result<T, HostError>
where D: IsIn { ... }
async fn request_descriptor_bytes(
&mut self,
desc_type: u8,
index: u8,
buf: &mut [u8],
) -> Result<usize, HostError>
where D: IsIn { ... }
async fn interface_request_descriptor_bytes<T: USBDescriptor>(
&mut self,
interface_num: u8,
buf: &mut [u8],
) -> Result<usize, HostError>
where D: IsIn { ... }
async fn active_configuration_value(
&mut self,
) -> Result<Option<NonZeroU8>, HostError>
where D: IsIn { ... }
async fn set_configuration(
&mut self,
config_no: u8,
) -> Result<(), HostError>
where D: IsOut { ... }
async fn device_set_address(
&mut self,
new_addr: u8,
) -> Result<(), HostError>
where D: IsOut { ... }
async fn class_request_out(
&mut self,
request: u8,
value: u16,
index: u16,
buf: &[u8],
) -> Result<(), HostError>
where D: IsOut { ... }
}Expand description
Extension trait providing higher-level control request methods on a USB control pipe.
Provided Methods§
Sourceasync fn request_descriptor<T: USBDescriptor, const SIZE: usize>(
&mut self,
index: u8,
class: bool,
) -> Result<T, HostError>where
D: IsIn,
async fn request_descriptor<T: USBDescriptor, const SIZE: usize>(
&mut self,
index: u8,
class: bool,
) -> Result<T, HostError>where
D: IsIn,
Request and parse a fixed-size descriptor.
Sourceasync fn request_descriptor_bytes(
&mut self,
desc_type: u8,
index: u8,
buf: &mut [u8],
) -> Result<usize, HostError>where
D: IsIn,
async fn request_descriptor_bytes(
&mut self,
desc_type: u8,
index: u8,
buf: &mut [u8],
) -> Result<usize, HostError>where
D: IsIn,
Request the raw bytes of a descriptor by type and index.
Sourceasync fn interface_request_descriptor_bytes<T: USBDescriptor>(
&mut self,
interface_num: u8,
buf: &mut [u8],
) -> Result<usize, HostError>where
D: IsIn,
async fn interface_request_descriptor_bytes<T: USBDescriptor>(
&mut self,
interface_num: u8,
buf: &mut [u8],
) -> Result<usize, HostError>where
D: IsIn,
Request the raw bytes of a class-specific interface descriptor.
Sourceasync fn active_configuration_value(
&mut self,
) -> Result<Option<NonZeroU8>, HostError>where
D: IsIn,
async fn active_configuration_value(
&mut self,
) -> Result<Option<NonZeroU8>, HostError>where
D: IsIn,
GET_CONFIGURATION — returns the active configuration value, or None if unconfigured.
Sourceasync fn set_configuration(&mut self, config_no: u8) -> Result<(), HostError>where
D: IsOut,
async fn set_configuration(&mut self, config_no: u8) -> Result<(), HostError>where
D: IsOut,
SET_CONFIGURATION.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.