pub enum ConfigurationRequest {
GetConfiguration {
responder: ConfigurationGetConfigurationResponder,
},
SetConfiguration {
device_desc: DeviceDescriptor,
config_descriptors: Vec<Vec<FunctionDescriptor>>,
responder: ConfigurationSetConfigurationResponder,
},
DisconnectCable {
duration: i64,
responder: ConfigurationDisconnectCableResponder,
},
ConnectCable {
responder: ConfigurationConnectCableResponder,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
control_handle: ConfigurationControlHandle,
method_type: MethodType,
},
}Expand description
Protocol for querying and dynamically reconfiguring USB peripheral functions.
Enables policy managers and system command-line tools to inspect active USB peripheral configurations and reconfigure the peripheral device function stack at runtime.
Variants§
GetConfiguration
Retrieves the current USB device descriptor and active configuration descriptors.
§Errors
ZX_ERR_NOT_SUPPORTED: Peripheral function querying is not supported on the target hardware.
Fields
responder: ConfigurationGetConfigurationResponderSetConfiguration
Sets and activates a new USB peripheral function configuration.
Teardown of the previous peripheral function stack occurs before initializing and binding the newly specified functions. The call completes once the peripheral controller and underlying function drivers are registered and ready.
§Errors
ZX_ERR_INVALID_ARGS: Configuration parameters are invalid.ZX_ERR_ALREADY_BOUND: An existing peripheral configuration is locked or undergoing transition.ZX_ERR_NOT_SUPPORTED: The requested combination of functions cannot be supported simultaneously.
DisconnectCable
Disconnects the Type-C port CC lines via the USB power debug service
to simulate a physical cable unplug. If duration is positive,
schedules an automatic Type-C cable reconnect after duration using a
hardware wake alarm in the persistent usb-policy service so reconnect
still completes even if the calling CLI session is terminated when the
USB link drops.
ConnectCable
Reconnects the Type-C port CC lines via the USB power debug service after
a previous DisconnectCable call, cancelling any pending automatic
reconnect alarm.
Fields
responder: ConfigurationConnectCableResponder#[non_exhaustive]_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
control_handle: ConfigurationControlHandlemethod_type: MethodTypeImplementations§
Source§impl ConfigurationRequest
impl ConfigurationRequest
pub fn into_get_configuration( self, ) -> Option<ConfigurationGetConfigurationResponder>
pub fn into_set_configuration( self, ) -> Option<(DeviceDescriptor, Vec<Vec<FunctionDescriptor>>, ConfigurationSetConfigurationResponder)>
pub fn into_disconnect_cable( self, ) -> Option<(i64, ConfigurationDisconnectCableResponder)>
pub fn into_connect_cable(self) -> Option<ConfigurationConnectCableResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL