fuchsia.hardware.usb.peripheral

PROTOCOLS

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

NameType

Response

NameType

FunctionsCleared

Invoked when all functions have been cleared.

Request

NameType

Device

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

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
function_descriptors vector<FunctionDescriptor>[32]

Response

NameType
result Device_SetConfiguration_Result

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

NameType

Response

NameType

SetStateChangeListener

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

Request

NameType
listener request<Events>

STRUCTS

Device_SetConfiguration_Response

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

NameTypeDescriptionDefault

FunctionDescriptor

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

NameTypeDescriptionDefault
interface_class uint8 No default
interface_subclass uint8 No default
interface_protocol uint8 No default

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.

NameTypeDescriptionDefault
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

UNIONS

Device_SetConfiguration_Result

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

NameTypeDescription
response Device_SetConfiguration_Response
err zx/status

CONSTANTS

NameValueTypeDescription
MAX_FUNCTION_DESCRIPTORS 32 uint32
MAX_STRING_DESCRIPTORS 255 uint32
MAX_STRING_LENGTH 127 uint32