The fuchsia.usb.policy interfaces provide mechanisms for clients to query and monitor the overall state of USB devices and the USB subsystem, independent of the underlying hardware driver implementations.
PROTOCOLS
Configuration
Defined in fuchsia.usb.policy/policy.fidl
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.
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.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Configuration_GetConfiguration_Result
|
SetConfiguration
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.
Request
| Name | Type |
|---|---|
device_desc |
fuchsia.hardware.usb.peripheral/DeviceDescriptor
|
config_descriptors |
vector<fuchsia.hardware.usb.peripheral/ConfigurationDescriptor>:5
|
Response
| Name | Type |
|---|---|
payload |
Configuration_SetConfiguration_Result
|
Health
Defined in fuchsia.usb.policy/policy.fidl
Protocol for retrieving diagnostic and health information from the USB system.
GetReport
Returns a snapshot of the current USB health and device state.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Health_GetReport_Result
|
PolicyProvider
Defined in fuchsia.usb.policy/policy.fidl
An interface to monitor dynamic changes to the USB device state.
WatchDeviceState
Notify a client of an updated device state value via a hanging get. The first time this is called, it will return right away with the current state. Subsequent calls will hang until there is a change to report. Returns a table containing the updated device state.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.hardware.usb.policy/DeviceStateWatcher_WatchDeviceState_Result
|
STRUCTS
Configuration_GetConfiguration_Response
Defined in fuchsia.usb.policy/policy.fidl
| Field | Type | Description | Default |
|---|---|---|---|
device_desc |
fuchsia.hardware.usb.peripheral/DeviceDescriptor
|
No default | |
config_descriptors |
vector<fuchsia.hardware.usb.peripheral/ConfigurationDescriptor>:5
|
No default |
Configuration_SetConfiguration_Response
Defined in fuchsia.usb.policy/policy.fidl
<EMPTY>
TABLES
HealthReport
Defined in fuchsia.usb.policy/policy.fidl
A snapshot of the USB controller's current status and health.
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
state |
fuchsia.hardware.usb.policy/DeviceState
|
The current state of the device as defined by the USB 2.0 spec. |
2 |
address |
uint8
|
The address assigned to the USB device. |
UNIONS
Configuration_GetConfiguration_Result strict
Defined in fuchsia.usb.policy/policy.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Configuration_GetConfiguration_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
Configuration_SetConfiguration_Result strict
Defined in fuchsia.usb.policy/policy.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Configuration_SetConfiguration_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
Health_GetReport_Result strict
Defined in fuchsia.usb.policy/policy.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
HealthReport
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|