pub enum UsbFunctionInterfaceRequest {
Control {
setup: UsbSetup,
write: Vec<u8>,
responder: UsbFunctionInterfaceControlResponder,
},
SetConfigured {
configured: bool,
speed: UsbSpeed,
responder: UsbFunctionInterfaceSetConfiguredResponder,
},
SetInterface {
interface: u8,
alt_setting: u8,
responder: UsbFunctionInterfaceSetInterfaceResponder,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
control_handle: UsbFunctionInterfaceControlHandle,
method_type: MethodType,
},
}Expand description
Protocol offered to [UsbFunction] instances to handle host-initiated
requests.
Variants§
Control
Callback for handling ep0 control requests.
setup is the control request to handle.
write is the data to write to the endpoint.
read is the data to read from the endpoint.
SetConfigured
Inform the function driver when the USB device configured state changes.
Called with configured == true in response to a SET_CONFIGURATION
control request that selects a configuration that contains this
function. In this case, the function driver should use
[fuchsia.hardware.usb.endpoint/Endpoint] to configure its endpoints.
Called with configured == false when configuration is disabled or USB
is disconnected. The function driver should then use
[fuchsia.hardware.usb.endpoint/Endpoint] to disable its endpoints.
SetInterface
Called to set an alternate setting for an interface due to a
SET_INTERFACE control request.
The function driver should use
[fuchsia.hardware.usb.endpoint/Endpoint] to configure or disable the
interface’s endpoints as appropriate.
#[non_exhaustive]_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
control_handle: UsbFunctionInterfaceControlHandlemethod_type: MethodTypeImplementations§
Source§impl UsbFunctionInterfaceRequest
impl UsbFunctionInterfaceRequest
pub fn into_control( self, ) -> Option<(UsbSetup, Vec<u8>, UsbFunctionInterfaceControlResponder)>
pub fn into_set_configured( self, ) -> Option<(bool, UsbSpeed, UsbFunctionInterfaceSetConfiguredResponder)>
pub fn into_set_interface( self, ) -> Option<(u8, u8, UsbFunctionInterfaceSetInterfaceResponder)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL