Hi all
I think that there is bug in default implementation of writeRead method in I2c.java
default int writeRead(byte[] writeBuffer, int writeSize, int writeOffset, byte[] readBuffer, int readSize,
int readOffset) {
return execute(() -> {
int written = write(writeBuffer, writeOffset, writeSize);
if (written != writeOffset)
throw new IllegalStateException(
"Expected to write " + writeOffset + " bytes but only wrote " + written + " bytes");
return read(readBuffer, readOffset, readSize);
});
}
The if conditions compares written to writeOffset instead of writeSize which is the number of bytes to write.
Hi all I think that there is bug in default implementation of writeRead method in I2c.java
The if conditions compares written to writeOffset instead of writeSize which is the number of bytes to write.