transfer method

NativeI2CmsgHelper transfer(
  1. List<I2Cmsg> data
)

Transfers a list of I2Cmsg.

Each I2C message structure specifies the transfer of a consecutive number of bytes to a slave address. The slave address, message flags, buffer length, and pointer to a byte buffer should be specified in each message. The message flags specify whether the message is a read (I2C_M_RD) or write (0) transaction, as well as additional options selected by the bitwise OR of their bitmasks.

Returns a NativeI2CmsgHelper which contains the NativeI2Cmsg list. To free the allocated memory resources NativeI2CmsgHelper.dispose must be called by the user.

Implementation

NativeI2CmsgHelper transfer(List<I2Cmsg> data) {
  _checkStatus();
  var nativeMsg = I2Cmsg._toNative(data);
  _checkError(_nativeI2ctransfer(_i2cHandle, nativeMsg, data.length));
  return NativeI2CmsgHelper(nativeMsg, data.length);
}