fuchsia.hardware.usb.peripheral

Added: HEAD

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

NameType
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

NameType
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

NameType
device_desc DeviceDescriptor
config_descriptors vector<ConfigurationDescriptor>:5

Response

NameType
payload Device_SetConfiguration_Result

SetStateChangeListener

Adds a state change listener that is invoked when a state change completes.

Request

NameType
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

NameType
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.

FieldTypeDescriptionDefault
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

FieldTypeDescriptionDefault
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

FieldTypeDescriptionDefault
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

OrdinalVariantTypeDescription
response Device_ClearFunctions_Response
framework_err internal

Device_GetConfiguration_Result strict

Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl

OrdinalVariantTypeDescription
response Device_GetConfiguration_Response
err zx/Status
framework_err internal

Device_SetConfiguration_Result strict

Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl

OrdinalVariantTypeDescription
response Device_SetConfiguration_Response
err zx/Status
framework_err internal

Events_FunctionRegistered_Result strict

Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl

OrdinalVariantTypeDescription
response Events_FunctionRegistered_Response
framework_err internal

CONSTANTS

NameValueTypeDescription
MAX_CONFIG_DESCRIPTORS 5 uint32
MAX_FUNCTION_DESCRIPTORS 32 uint32
MAX_STRING_DESCRIPTORS 255 uint32
MAX_STRING_LENGTH 127 uint32

ALIASES

NameValueDescription
ConfigurationDescriptor vector[MAX_FUNCTION_DESCRIPTORS]

SERVICES

Service

Defined in fuchsia.hardware.usb.peripheral/usb-peripheral.fidl

NameTypeTransport
device fuchsia.hardware.usb.peripheral/Device Channel