pub struct DeviceProxy { /* private fields */ }
Implementations§
Source§impl DeviceProxy
impl DeviceProxy
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 transfer(
&self,
transactions: &[Transaction],
) -> QueryResponseFut<DeviceTransferResult, DefaultFuchsiaResourceDialect>
pub fn transfer( &self, transactions: &[Transaction], ) -> QueryResponseFut<DeviceTransferResult, DefaultFuchsiaResourceDialect>
Issue one or more transactions to a particular I2C device.
Each Transaction
is performed in the order in which it appears in transactions
. Data for
read transfers (if there are any) is returned through read_data
, which has one entry for
each read transfer in transactions
. Transaction processing continues until all transfers
have been completed, an error occurs, or the target issues a NACK in response to a write
transfer.
The possible error values are:
ZX_ERR_INVALID_ARGS: transactions
has zero elements, data_transfer
was not specified
for a Transaction
, or there was a zero-length DataTransfer
.
ZX_ERR_OUT_OF_RANGE: A DataTransfer
was too large to be handled by this I2C controller.
ZX_ERR_IO_NOT_PRESENT: The device did not respond to its I2C address.
ZX_ERR_IO_REFUSED: The device issued a NACK before the end of a write transfer.
Sourcepub fn get_name(
&self,
) -> QueryResponseFut<DeviceGetNameResult, DefaultFuchsiaResourceDialect>
pub fn get_name( &self, ) -> QueryResponseFut<DeviceGetNameResult, DefaultFuchsiaResourceDialect>
Get the name of this I2C Device. Returns ZX_ERR_NOT_SUPPORTED if the name is unspecified or the empty string.
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 TransferResponseFut = QueryResponseFut<Result<Vec<Vec<u8>>, i32>>
type GetNameResponseFut = QueryResponseFut<Result<String, i32>>
fn transfer(&self, transactions: &[Transaction]) -> Self::TransferResponseFut
fn get_name(&self) -> Self::GetNameResponseFut
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
)