pub struct DeviceSynchronousProxy { /* private fields */ }
Implementations§
Source§impl DeviceSynchronousProxy
impl DeviceSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<DeviceEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<DeviceEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn query(
&self,
___deadline: MonotonicInstant,
) -> Result<DeviceQueryResult, Error>
pub fn query( &self, ___deadline: MonotonicInstant, ) -> Result<DeviceQueryResult, Error>
Obtain information about the hidbus device and supported features.
Sourcepub fn get_report_desc(
&self,
___deadline: MonotonicInstant,
) -> Result<Vec<u8>, Error>
pub fn get_report_desc( &self, ___deadline: MonotonicInstant, ) -> Result<Vec<u8>, Error>
Get the report descriptor
Sourcepub fn get_device_reports_reader(
&self,
reader: ServerEnd<DeviceReportsReaderMarker>,
___deadline: MonotonicInstant,
) -> Result<DeviceGetDeviceReportsReaderResult, Error>
pub fn get_device_reports_reader( &self, reader: ServerEnd<DeviceReportsReaderMarker>, ___deadline: MonotonicInstant, ) -> Result<DeviceGetDeviceReportsReaderResult, Error>
Open a new DeviceReportsReader on this device. Opening a DeviceReportsReader allocates a new FIFO for receiving input reports.
Sourcepub fn read_report(
&self,
___deadline: MonotonicInstant,
) -> Result<DeviceReadReportResult, Error>
pub fn read_report( &self, ___deadline: MonotonicInstant, ) -> Result<DeviceReadReportResult, Error>
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
.
Sourcepub fn read_reports(
&self,
___deadline: MonotonicInstant,
) -> Result<DeviceReadReportsResult, Error>
pub fn read_reports( &self, ___deadline: MonotonicInstant, ) -> Result<DeviceReadReportsResult, Error>
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
.
Sourcepub fn get_reports_event(
&self,
___deadline: MonotonicInstant,
) -> Result<DeviceGetReportsEventResult, Error>
pub fn get_reports_event( &self, ___deadline: MonotonicInstant, ) -> Result<DeviceGetReportsEventResult, Error>
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.
Sourcepub fn get_report(
&self,
type_: ReportType,
id: u8,
___deadline: MonotonicInstant,
) -> Result<DeviceGetReportResult, Error>
pub fn get_report( &self, type_: ReportType, id: u8, ___deadline: MonotonicInstant, ) -> Result<DeviceGetReportResult, Error>
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.
Sourcepub fn set_report(
&self,
type_: ReportType,
id: u8,
report: &[u8],
___deadline: MonotonicInstant,
) -> Result<DeviceSetReportResult, Error>
pub fn set_report( &self, type_: ReportType, id: u8, report: &[u8], ___deadline: MonotonicInstant, ) -> Result<DeviceSetReportResult, Error>
Set a single report of the given (type, id) pair.
Sourcepub fn set_trace_id(&self, id: u32) -> Result<(), Error>
pub fn set_trace_id(&self, id: u32) -> Result<(), Error>
Set the trace ID that is used for HID report flow events.
Trait Implementations§
Source§impl Debug for DeviceSynchronousProxy
impl Debug for DeviceSynchronousProxy
Source§impl SynchronousProxy for DeviceSynchronousProxy
impl SynchronousProxy for DeviceSynchronousProxy
Source§type Proxy = DeviceProxy
type Proxy = DeviceProxy
Source§type Protocol = DeviceMarker
type Protocol = DeviceMarker
Proxy
controls.