pub struct DeviceProxy { /* private fields */ }
Implementations§
Source§impl DeviceProxy
impl DeviceProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.hardware.input/Device.
Sourcepub fn take_event_stream(&self) -> DeviceEventStream
pub fn take_event_stream(&self) -> DeviceEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn query(
&self,
) -> QueryResponseFut<DeviceQueryResult, DefaultFuchsiaResourceDialect>
pub fn query( &self, ) -> QueryResponseFut<DeviceQueryResult, DefaultFuchsiaResourceDialect>
Obtain information about the hidbus device and supported features.
Sourcepub fn get_report_desc(
&self,
) -> QueryResponseFut<Vec<u8>, DefaultFuchsiaResourceDialect>
pub fn get_report_desc( &self, ) -> QueryResponseFut<Vec<u8>, DefaultFuchsiaResourceDialect>
Get the report descriptor
Sourcepub fn get_device_reports_reader(
&self,
reader: ServerEnd<DeviceReportsReaderMarker>,
) -> QueryResponseFut<DeviceGetDeviceReportsReaderResult, DefaultFuchsiaResourceDialect>
pub fn get_device_reports_reader( &self, reader: ServerEnd<DeviceReportsReaderMarker>, ) -> QueryResponseFut<DeviceGetDeviceReportsReaderResult, DefaultFuchsiaResourceDialect>
Open a new DeviceReportsReader on this device. Opening a DeviceReportsReader allocates a new FIFO for receiving input reports.
Sourcepub fn read_report(
&self,
) -> QueryResponseFut<DeviceReadReportResult, DefaultFuchsiaResourceDialect>
pub fn read_report( &self, ) -> QueryResponseFut<DeviceReadReportResult, DefaultFuchsiaResourceDialect>
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,
) -> QueryResponseFut<DeviceReadReportsResult, DefaultFuchsiaResourceDialect>
pub fn read_reports( &self, ) -> QueryResponseFut<DeviceReadReportsResult, DefaultFuchsiaResourceDialect>
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,
) -> QueryResponseFut<DeviceGetReportsEventResult, DefaultFuchsiaResourceDialect>
pub fn get_reports_event( &self, ) -> QueryResponseFut<DeviceGetReportsEventResult, DefaultFuchsiaResourceDialect>
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,
) -> QueryResponseFut<DeviceGetReportResult, DefaultFuchsiaResourceDialect>
pub fn get_report( &self, type_: ReportType, id: u8, ) -> QueryResponseFut<DeviceGetReportResult, DefaultFuchsiaResourceDialect>
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],
) -> QueryResponseFut<DeviceSetReportResult, DefaultFuchsiaResourceDialect>
pub fn set_report( &self, type_: ReportType, id: u8, report: &[u8], ) -> QueryResponseFut<DeviceSetReportResult, DefaultFuchsiaResourceDialect>
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 Clone for DeviceProxy
impl Clone for DeviceProxy
Source§fn clone(&self) -> DeviceProxy
fn clone(&self) -> DeviceProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DeviceProxy
impl Debug for DeviceProxy
Source§impl DeviceProxyInterface for DeviceProxy
impl DeviceProxyInterface for DeviceProxy
type QueryResponseFut = QueryResponseFut<Result<HidInfo, i32>>
type GetReportDescResponseFut = QueryResponseFut<Vec<u8>>
type GetDeviceReportsReaderResponseFut = QueryResponseFut<Result<(), i32>>
type ReadReportResponseFut = QueryResponseFut<Result<Report, i32>>
type ReadReportsResponseFut = QueryResponseFut<Result<Vec<u8>, i32>>
type GetReportsEventResponseFut = QueryResponseFut<Result<Event, i32>>
type GetReportResponseFut = QueryResponseFut<Result<Vec<u8>, i32>>
type SetReportResponseFut = QueryResponseFut<Result<(), i32>>
fn query(&self) -> Self::QueryResponseFut
fn get_report_desc(&self) -> Self::GetReportDescResponseFut
fn get_device_reports_reader( &self, reader: ServerEnd<DeviceReportsReaderMarker>, ) -> Self::GetDeviceReportsReaderResponseFut
fn read_report(&self) -> Self::ReadReportResponseFut
fn read_reports(&self) -> Self::ReadReportsResponseFut
fn get_reports_event(&self) -> Self::GetReportsEventResponseFut
fn get_report(&self, type_: ReportType, id: u8) -> Self::GetReportResponseFut
fn set_report( &self, type_: ReportType, id: u8, report: &[u8], ) -> Self::SetReportResponseFut
fn set_trace_id(&self, id: u32) -> Result<(), Error>
Source§impl Proxy for DeviceProxy
impl Proxy for DeviceProxy
Source§type Protocol = DeviceMarker
type Protocol = DeviceMarker
Proxy
controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Auto Trait Implementations§
impl Freeze for DeviceProxy
impl !RefUnwindSafe for DeviceProxy
impl Send for DeviceProxy
impl Sync for DeviceProxy
impl Unpin for DeviceProxy
impl !UnwindSafe for DeviceProxy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)