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§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.