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>
ENUMS
CableStatus flexible
Type: uint32
Defined in fuchsia.usb.policy/policy.fidl
Status of the physical USB cable connection.
| Name | Value | Description |
|---|---|---|
DISCONNECTED |
0 |
|
CONNECTED |
1 |
FunctionStatus flexible
Type: uint32
Defined in fuchsia.usb.policy/policy.fidl
Health status of a USB function driver or connection.
| Name | Value | Description |
|---|---|---|
DISABLED |
0 |
|
DISCONNECTED |
1 |
|
CONNECTED |
2 |
|
ERROR |
3 |
TABLES
AdbHealth
Defined in fuchsia.usb.policy/policy.fidl
Health information for the USB ADB function subsystem.
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
status |
FunctionStatus
|
Describes the high-level policy and configuration state of the ADB function. |
2 |
details |
string:128
|
Provides additional diagnostic details or state description. |
3 |
online |
bool
|
Indicates whether the underlying ADB daemon connection and transport are actively online and
communicating with the host. In contrast to |
4 |
driver_state |
string:32
|
Describes the runtime execution state reported by the ADB function driver (e.g. "kAwaitingUsbConnection", "kOnline", "kStoppingForReconnect", "kStoppingForUnbind"). |
CdcEthernetHealth
Defined in fuchsia.usb.policy/policy.fidl
Health information for the USB CDC Ethernet function subsystem.
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
status |
FunctionStatus
|
Describes the high-level policy and configuration state of the CDC Ethernet function. |
2 |
details |
string:128
|
Provides additional diagnostic details or state description. |
3 |
online |
bool
|
Indicates whether the underlying Ethernet network interface and link are actively online and ready
for network traffic. In contrast to |
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
|
Describes the current state of the device as defined by the USB 2.0 spec. |
2 |
address |
uint8
|
The address assigned to the USB device. |
3 |
cable_status |
CableStatus
|
Indicates whether the USB physical cable / |
4 |
adb |
AdbHealth
|
Describes the health status of the ADB function subsystem ([AdbHealth]). |
5 |
cdc_ethernet |
CdcEthernetHealth
|
Describes the health status of the CDC Ethernet function subsystem ([CdcEthernetHealth]). |
6 |
vsock |
VsockHealth
|
Describes the health status of the VSOCK function subsystem ([VsockHealth]). |
VsockHealth
Defined in fuchsia.usb.policy/policy.fidl
Health information for the USB VSOCK function subsystem.
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
status |
FunctionStatus
|
Describes the high-level policy and configuration state of the VSOCK function. |
2 |
active_channels |
uint32
|
The number of currently active or open multiplexed VSOCK socket channels. If unknown or unsupported by the function driver, this field is absent (None). |
3 |
details |
string:128
|
Provides additional diagnostic details or state description. |
4 |
online |
bool
|
Indicates whether the underlying VSOCK transport driver is actively online and ready for traffic.
In contrast to |
5 |
driver_state |
string:32
|
Describes the runtime execution state reported by the VSOCK function driver (e.g. "Unconfigured", "Running"). |
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
|
CONSTANTS
| Name | Value | Type | Description |
|---|---|---|---|
| MAX_DETAILS_LENGTH |
128
|
uint32 |