pub trait ControlChannelExt<D: Direction>: UsbChannel<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 { ... }
async fn enumerate_device(
&mut self,
speed: Speed,
new_device_address: u8,
ls_over_fs: bool,
) -> Result<EnumerationInfo, HostError>
where D: IsIn + IsOut { ... }
}Expand description
Extension trait providing higher-level control request methods on a USB control channel.
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.
Sourceasync fn device_set_address(&mut self, new_addr: u8) -> Result<(), HostError>where
D: IsOut,
async fn device_set_address(&mut self, new_addr: u8) -> Result<(), HostError>where
D: IsOut,
SET_ADDRESS — assign the device a new address.
§Warning
Breaks host channel state; use only during enumeration.
Sourceasync fn class_request_out(
&mut self,
request: u8,
value: u16,
index: u16,
buf: &[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,
Class + Interface OUT request (no data stage).
Sourceasync fn enumerate_device(
&mut self,
speed: Speed,
new_device_address: u8,
ls_over_fs: bool,
) -> Result<EnumerationInfo, HostError>
async fn enumerate_device( &mut self, speed: Speed, new_device_address: u8, ls_over_fs: bool, ) -> Result<EnumerationInfo, HostError>
Enumerate the currently pending device and return an EnumerationInfo.
The device must have been reset immediately before this call.
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.