pub enum DeviceRequest {
Query {
responder: DeviceQueryResponder,
},
GetReportDesc {
responder: DeviceGetReportDescResponder,
},
GetDeviceReportsReader {
reader: ServerEnd<DeviceReportsReaderMarker>,
responder: DeviceGetDeviceReportsReaderResponder,
},
ReadReport {
responder: DeviceReadReportResponder,
},
ReadReports {
responder: DeviceReadReportsResponder,
},
GetReportsEvent {
responder: DeviceGetReportsEventResponder,
},
GetReport {
type_: ReportType,
id: u8,
responder: DeviceGetReportResponder,
},
SetReport {
type_: ReportType,
id: u8,
report: Vec<u8>,
responder: DeviceSetReportResponder,
},
SetTraceId {
id: u32,
control_handle: DeviceControlHandle,
},
}
Variants§
Query
Obtain information about the hidbus device and supported features.
Fields
responder: DeviceQueryResponder
GetReportDesc
Get the report descriptor
Fields
responder: DeviceGetReportDescResponder
GetDeviceReportsReader
Open a new DeviceReportsReader on this device. Opening a DeviceReportsReader allocates a new FIFO for receiving input reports.
Fields
reader: ServerEnd<DeviceReportsReaderMarker>
responder: DeviceGetDeviceReportsReaderResponder
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
.
Fields
responder: DeviceReadReportResponder
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
.
Fields
responder: DeviceReadReportsResponder
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.
Fields
responder: DeviceGetReportsEventResponder
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.
SetReport
Set a single report of the given (type, id) pair.
SetTraceId
Set the trace ID that is used for HID report flow events.
Implementations§
Source§impl DeviceRequest
impl DeviceRequest
pub fn into_query(self) -> Option<DeviceQueryResponder>
pub fn into_get_report_desc(self) -> Option<DeviceGetReportDescResponder>
pub fn into_get_device_reports_reader( self, ) -> Option<(ServerEnd<DeviceReportsReaderMarker>, DeviceGetDeviceReportsReaderResponder)>
pub fn into_read_report(self) -> Option<DeviceReadReportResponder>
pub fn into_read_reports(self) -> Option<DeviceReadReportsResponder>
pub fn into_get_reports_event(self) -> Option<DeviceGetReportsEventResponder>
pub fn into_get_report( self, ) -> Option<(ReportType, u8, DeviceGetReportResponder)>
pub fn into_set_report( self, ) -> Option<(ReportType, u8, Vec<u8>, DeviceSetReportResponder)>
pub fn into_set_trace_id(self) -> Option<(u32, DeviceControlHandle)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL