PROTOCOLS
Device
Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl
ClearFunctions
Tells the device to remove the child devices for the configuration's interfaces
and reset the list of functions to empty.
The caller should wait for the FunctionsCleared event.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Device_ClearFunctions_Result
|
GetConfiguration
Retrieves the current device descriptor and active configuration descriptors.
Returns the active USB device descriptor and all associated configuration descriptors registered with the peripheral device manager.
- error:
ZX_ERR_BAD_STATE: The peripheral device has not been configured.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Device_GetConfiguration_Result
|
SetConfiguration
Sets the device's descriptors, adds the functions and creates the child devices for the configuration's interfaces. At least one function descriptor must be provided.
Request
| Name | Type |
|---|---|
device_desc |
DeviceDescriptor
|
config_descriptors |
vector<ConfigurationDescriptor>:5
|
Response
| Name | Type |
|---|---|
payload |
Device_SetConfiguration_Result
|
SetStateChangeListener
Adds a state change listener that is invoked when a state change completes.
Request
| Name | Type |
|---|---|
listener |
client_end:Events
|
Events
Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl
Events protocol that is used as a callback to inform the client of the completion of various server-side events. This callback interface can be registered using the SetStateChangeListener method on the Device protocol.
FunctionRegistered
Invoked when a function registers
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Events_FunctionRegistered_Result
|
FunctionsCleared
Invoked when all functions have been cleared.
Request
<EMPTY>
STRUCTS
DeviceDescriptor
Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl
The fields in DeviceDescriptor match those in usb_descriptor_t in the USB specification, except for the string fields.
| Field | Type | Description | Default |
|---|---|---|---|
bcd_usb |
uint16
|
No default | |
b_device_class |
uint8
|
No default | |
b_device_sub_class |
uint8
|
No default | |
b_device_protocol |
uint8
|
No default | |
b_max_packet_size0 |
uint8
|
No default | |
id_vendor |
uint16
|
No default | |
id_product |
uint16
|
No default | |
bcd_device |
uint16
|
No default | |
manufacturer |
string:127
|
No default | |
product |
string:127
|
No default | |
serial |
string:127
|
No default | |
b_num_configurations |
uint8
|
No default |
Device_ClearFunctions_Response
Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl
<EMPTY>
Device_GetConfiguration_Response
Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl
| Field | Type | Description | Default |
|---|---|---|---|
device_desc |
DeviceDescriptor
|
No default | |
config_descriptors |
vector<ConfigurationDescriptor>:5
|
No default |
Device_SetConfiguration_Response
Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl
<EMPTY>
Events_FunctionRegistered_Response
Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl
<EMPTY>
FunctionDescriptor
Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl
| Field | Type | Description | Default |
|---|---|---|---|
interface_class |
uint8
|
No default | |
interface_subclass |
uint8
|
No default | |
interface_protocol |
uint8
|
No default |
UNIONS
Device_ClearFunctions_Result strict
Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Device_ClearFunctions_Response
|
|
3 |
framework_err |
internal
|
Device_GetConfiguration_Result strict
Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Device_GetConfiguration_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
Device_SetConfiguration_Result strict
Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Device_SetConfiguration_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
Events_FunctionRegistered_Result strict
Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Events_FunctionRegistered_Response
|
|
3 |
framework_err |
internal
|
CONSTANTS
| Name | Value | Type | Description |
|---|---|---|---|
| MAX_CONFIG_DESCRIPTORS |
5
|
uint32 |
|
| MAX_FUNCTION_DESCRIPTORS |
32
|
uint32 |
|
| MAX_STRING_DESCRIPTORS |
255
|
uint32 |
|
| MAX_STRING_LENGTH |
127
|
uint32 |
ALIASES
| Name | Value | Description |
|---|---|---|
| ConfigurationDescriptor |
vector[MAX_FUNCTION_DESCRIPTORS] |
SERVICES
Service
Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl
| Name | Type | Transport |
|---|---|---|
| device |
fuchsia.hardware.usb.peripheral/Device
|
Channel |