pub enum DeviceRequest {
GetDeviceSpeed {
responder: DeviceGetDeviceSpeedResponder,
},
GetDeviceDescriptor {
responder: DeviceGetDeviceDescriptorResponder,
},
GetConfigurationDescriptorSize {
config: u8,
responder: DeviceGetConfigurationDescriptorSizeResponder,
},
GetConfigurationDescriptor {
config: u8,
responder: DeviceGetConfigurationDescriptorResponder,
},
GetStringDescriptor {
desc_id: u8,
lang_id: u16,
responder: DeviceGetStringDescriptorResponder,
},
SetInterface {
interface_number: u8,
alt_setting: u8,
responder: DeviceSetInterfaceResponder,
},
GetDeviceId {
responder: DeviceGetDeviceIdResponder,
},
GetHubDeviceId {
responder: DeviceGetHubDeviceIdResponder,
},
GetConfiguration {
responder: DeviceGetConfigurationResponder,
},
SetConfiguration {
configuration: u8,
responder: DeviceSetConfigurationResponder,
},
}
Variants§
GetDeviceSpeed
Fields
responder: DeviceGetDeviceSpeedResponder
Returns the speed of the USB device as a usb_speed_t value.
GetDeviceDescriptor
Fields
responder: DeviceGetDeviceDescriptorResponder
Returns the device’s USB device descriptor.
GetConfigurationDescriptorSize
Returns the total size of the USB configuration descriptor for the given configuration.
GetConfigurationDescriptor
Returns the device’s USB configuration descriptor for the given configuration.
GetStringDescriptor
Fetches a string descriptor from the USB device.
desc_id : The ID of the string descriptor to fetch, or 0 to fetch the language table instead.
lang_id : The language ID of the string descriptor to fetch. If no matching language ID is present in the device’s language ID table, the first entry of the language ID table will be substituted. actual_lang_id : The actual language ID of the string fetched, or 0 for the language ID table.
The worst case size for the payload of a language ID table should be 252 bytes, meaning that a 256 byte buffer should always be enough to hold any language ID table.
The worst case size for a UTF-8 encoded string descriptor payload should be 378 bytes (126 UTF-16 code units with a worst case expansion factor of 3)
SetInterface
Selects an alternate setting for an interface on a USB device.
GetDeviceId
Fields
responder: DeviceGetDeviceIdResponder
Returns an implementation specific device ID for a USB device. For informational purposes only.
GetHubDeviceId
Fields
responder: DeviceGetHubDeviceIdResponder
Returns the implementation specific device ID for the hub that a USB device is connected to. For informational purposes only.
GetConfiguration
Fields
responder: DeviceGetConfigurationResponder
Returns the device’s current configuration.
SetConfiguration
Sets the device’s current configuration.
Implementations§
source§impl DeviceRequest
impl DeviceRequest
pub fn into_get_device_speed(self) -> Option<DeviceGetDeviceSpeedResponder>
pub fn into_get_device_descriptor( self ) -> Option<DeviceGetDeviceDescriptorResponder>
pub fn into_get_configuration_descriptor_size( self ) -> Option<(u8, DeviceGetConfigurationDescriptorSizeResponder)>
pub fn into_get_configuration_descriptor( self ) -> Option<(u8, DeviceGetConfigurationDescriptorResponder)>
pub fn into_get_string_descriptor( self ) -> Option<(u8, u16, DeviceGetStringDescriptorResponder)>
pub fn into_set_interface(self) -> Option<(u8, u8, DeviceSetInterfaceResponder)>
pub fn into_get_device_id(self) -> Option<DeviceGetDeviceIdResponder>
pub fn into_get_hub_device_id(self) -> Option<DeviceGetHubDeviceIdResponder>
pub fn into_get_configuration(self) -> Option<DeviceGetConfigurationResponder>
pub fn into_set_configuration( self ) -> Option<(u8, DeviceSetConfigurationResponder)>
sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL