Closed eitch closed 5 months ago
@taartspi the new I2CBus is to enable the execute() method on the I2C class. Thus allowing to perform a call with multiple read/writes atomically
Rebased with develop after the other I2C changes
@FDelporte should we merge?
Added a I2C.execute(Callable) method, allowing to atomically execute multiple I2C calls in a thread safe way
Added I2C.writeRead(byte[], byte[]) methods to atomically perform a write and then immediately afterwards a read on the I2C bus.
Fixed an issue where the LinuxFsI2CBus was closed when closing an I2C device - This was wrong, as another device might still be open on the same bus, and an operation on the underlying RandomAccessFile would lead to exceptions
Fixed the workaround requiring an I2C.read() on a newly created LinuxFsI2C device, if the first call was an ioctl - The device was not selected prior to the ioctl call.
Additional code cleanup, more to come in an additional commit