Udostępnij za pośrednictwem


I2cDevice.WriteRead(Byte[], Byte[]) Method

Definition

Performs an atomic operation to write data to and then read data from the inter-integrated circuit (I2 C) bus on which the device is connected, and sends a restart condition between the write and read operations.

public:
 virtual void WriteRead(Platform::Array <byte> ^ writeBuffer, Platform::Array <byte> ^ readBuffer) = WriteRead;
void WriteRead(winrt::array_view <byte> const& writeBuffer, winrt::array_view <byte> & readBuffer);
public void WriteRead(byte[] writeBuffer, byte[] readBuffer);
function writeRead(writeBuffer, readBuffer)
Public Sub WriteRead (writeBuffer As Byte(), readBuffer As Byte())

Parameters

writeBuffer

Byte[]

byte[]

A buffer that contains the data that you want to write to the I2 C device. This data should not include the bus address.

readBuffer

Byte[]

byte[]

The buffer to which you want to read the data from the I2 C bus. The length of the buffer determines how much data to request from the device.

Windows requirements

App capabilities
lowLevel

Remarks

Error Codes

0x80070002

The bus address was not acknowledged.

0x8007045D

The I2 C device negatively acknowledged the data transfer before the entire buffer was read.

Applies to

See also