Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.input

PROTOCOLS

Device

Defined in fuchsia.hardware.input/input.fidl

GetBootProtocol

Get the HID boot interface protocol this device supports

Request

NameType

Response

NameType
protocol BootProtocol

GetDeviceIds

Get the Device's IDs. If this is a real HID device, the IDs will come from the device. If it is a mock HID decice, the IDs will either be 0's or user defined.

Request

NameType

Response

NameType
ids DeviceIds

GetDeviceReportsReader

Open a new DeviceReportsReader on this device. Opening a DeviceReportsReader allocates a new FIFO for receiving input reports.

Request

NameType
reader request<DeviceReportsReader>

Response

NameType
result Device_GetDeviceReportsReader_Result

GetReport

Send a request to the hardware for a given report described by type and id. Returns the hardware's response. This interface is not intended to be used for continuous polling of the reports.

Request

NameType
type ReportType
id ReportId

Response

NameType
status zx/status
report vector<uint8>[8192]

GetReportDesc

Get the report descriptor

Request

NameType

Response

NameType
desc vector<uint8>[8192]

GetReportsEvent

Receive an event that will signal on ZX_USER_SIGNAL_0 when there are reports in the Device's report FIFO. This signal will be de-asserted when there are no reports in the Device's report FIFO. This event can be re-used each time the client wishes to know if there are reports in the FIFO.

Request

NameType

Response

NameType
status zx/status
event handle<event>

ReadReport

Read one report out of the report FIFO. Only a single report will be returned in this API. time is the time the report was created, from the view of the monotonic clock. If status is ZX_ERR_SHOULD_WAIT the client can wait on the event from GetReportsEvent.

Request

NameType

Response

NameType
status zx/status
data vector<uint8>[8192]
time zx/time

ReadReports

Read up to MAX_REPORT_DATA bytes of reports that have been sent from a device. This is the interface that is supposed to be used for continuous polling. Multiple reports can be returned from this API at a time, it is up to the client to do the parsing of the reports with the correct sizes and offset. It is guaranteed that only whole reports will be sent. If there are no reports, this will return ZX_ERR_SHOULD_WAIT, and the client can wait on the event from GetReportsEvent.

Request

NameType

Response

NameType
status zx/status
data vector<uint8>[8192]

SetReport

Set a single report of the given (type, id) pair.

Request

NameType
type ReportType
id ReportId
report vector<uint8>[8192]

Response

NameType
status zx/status

SetTraceId

Set the trace ID that is used for HID report flow events.

Request

NameType
id uint32

DeviceReportsReader

Defined in fuchsia.hardware.input/input.fidl

Each DeviceReportsReader has its own FIFO of reports in the driver. Calling ReadReports drains the Report FIFO. If the Report FIFO fills up between calls to ReadReports the channel will be closed.

ReadReports

This is a Hanging-Get function to read the reports in the Report FIFO. This will block until there is at least one report available. If there is already one outstanding Hanging-Get, calling this again will return ZX_ERR_ALREADY_BOUND.

Request

NameType

Response

NameType
result DeviceReportsReader_ReadReports_Result

STRUCTS

DeviceIds

Defined in fuchsia.hardware.input/input.fidl

DeviceIds lets a clients determine the vendor and product id for a device. If the device is real HID device, then the id information will come from the device itself. Mock HID devices may assign the ids in the driver. If the mock HID driver does not assign ids, zeros will be used instead.

NameTypeDescriptionDefault
vendor_id uint32 No default
product_id uint32 No default
version uint32 No default

DeviceReportsReader_ReadReports_Response

Defined in fuchsia.hardware.input/input.fidl

NameTypeDescriptionDefault
reports vector<Report>[50] No default

Device_GetDeviceReportsReader_Response

Defined in fuchsia.hardware.input/input.fidl

NameTypeDescriptionDefault

Report

Defined in fuchsia.hardware.input/input.fidl

A single HID Report.

NameTypeDescriptionDefault
time zx/time

The time the report was created, from the view of the monotonic clock.

No default
data vector<uint8>[8192]

The HID report data. This is guaranteed to always be a full HID report.

No default

ENUMS

BootProtocol

Type: uint32

Defined in fuchsia.hardware.input/input.fidl

NameValueDescription
NONE 0
KBD 1
MOUSE 2

ReportType

Type: uint8

Defined in fuchsia.hardware.input/input.fidl

NameValueDescription
INPUT 1
OUTPUT 2
FEATURE 3

UNIONS

DeviceReportsReader_ReadReports_Result

Defined in fuchsia.hardware.input/input.fidl

NameTypeDescription
response DeviceReportsReader_ReadReports_Response
err zx/status

Device_GetDeviceReportsReader_Result

Defined in fuchsia.hardware.input/input.fidl

NameTypeDescription
response Device_GetDeviceReportsReader_Response
err zx/status

CONSTANTS

NameValueTypeDescription
MAX_DESC_LEN 8192 uint16
MAX_REPORTS_COUNT 50 uint32
MAX_REPORT_DATA 8192 uint16
MAX_REPORT_LEN 8192 uint16

TYPE ALIASES

NameValueDescription
ReportId uint8