Class GrpcClientI2CDevice
- java.lang.Object
-
- com.diozero.internal.spi.AbstractDevice
-
- com.diozero.internal.provider.remote.grpc.GrpcClientI2CDevice
-
- All Implemented Interfaces:
DeviceInterface,I2CDeviceInterface,I2CSMBusInterface,InternalDeviceInterface,InternalI2CDeviceInterface,AutoCloseable
public class GrpcClientI2CDevice extends AbstractDevice implements InternalI2CDeviceInterface
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.diozero.api.I2CDeviceInterface
I2CDeviceInterface.Command, I2CDeviceInterface.I2CMessage, I2CDeviceInterface.ReadCommand, I2CDeviceInterface.WriteCommand
-
-
Field Summary
-
Fields inherited from interface com.diozero.api.I2CDeviceInterface
I2C_FUNC_10BIT_ADDR, I2C_FUNC_I2C, I2C_FUNC_NOSTART, I2C_FUNC_PROTOCOL_MANGLING, I2C_FUNC_SMBUS_BLOCK_PROC_CALL, I2C_FUNC_SMBUS_PEC, I2C_FUNC_SMBUS_PROC_CALL, I2C_FUNC_SMBUS_QUICK, I2C_FUNC_SMBUS_READ_BLOCK_DATA, I2C_FUNC_SMBUS_READ_BYTE, I2C_FUNC_SMBUS_READ_BYTE_DATA, I2C_FUNC_SMBUS_READ_I2C_BLOCK, I2C_FUNC_SMBUS_READ_WORD_DATA, I2C_FUNC_SMBUS_WRITE_BLOCK_DATA, I2C_FUNC_SMBUS_WRITE_BYTE, I2C_FUNC_SMBUS_WRITE_BYTE_DATA, I2C_FUNC_SMBUS_WRITE_I2C_BLOCK, I2C_FUNC_SMBUS_WRITE_WORD_DATA
-
Fields inherited from interface com.diozero.api.I2CSMBusInterface
MAX_I2C_BLOCK_SIZE
-
-
Constructor Summary
Constructors Constructor Description GrpcClientI2CDevice(GrpcClientDeviceFactory deviceFactory, String key, int controller, int address, I2CConstants.AddressSize addressSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]blockProcessCall(int register, byte... txData)protected voidcloseDevice()booleanprobe(I2CDevice.ProbeMode mode)shortprocessCall(int register, short s)byte[]readBlockData(int register)bytereadByte()bytereadByteData(int register)intreadBytes(byte[] buffer)intreadI2CBlockData(int register, byte[] buffer)shortreadWordData(int register)voidreadWrite(I2CDeviceInterface.I2CMessage[] messages, byte[] buffer)voidwriteBlockData(int register, byte... data)voidwriteByte(byte b)voidwriteByteData(int register, byte b)voidwriteBytes(byte... data)voidwriteI2CBlockData(int register, byte... data)voidwriteQuick(byte bit)voidwriteWordData(int register, short s)-
Methods inherited from class com.diozero.internal.spi.AbstractDevice
close, getDeviceFactory, getKey, isChild, isOpen, setChild
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.diozero.api.DeviceInterface
close
-
Methods inherited from interface com.diozero.api.I2CDeviceInterface
readNoStop, readWrite, readWrite
-
Methods inherited from interface com.diozero.api.I2CSMBusInterface
probe, readWordSwapped, writeWordSwapped
-
Methods inherited from interface com.diozero.internal.spi.InternalDeviceInterface
getKey, isChild, isOpen, setChild
-
-
-
-
Constructor Detail
-
GrpcClientI2CDevice
public GrpcClientI2CDevice(GrpcClientDeviceFactory deviceFactory, String key, int controller, int address, I2CConstants.AddressSize addressSize)
-
-
Method Detail
-
probe
public boolean probe(I2CDevice.ProbeMode mode) throws RuntimeIOException
- Specified by:
probein interfaceI2CSMBusInterface- Throws:
RuntimeIOException
-
writeQuick
public void writeQuick(byte bit)
- Specified by:
writeQuickin interfaceI2CSMBusInterface
-
readByte
public byte readByte() throws RuntimeIOException- Specified by:
readBytein interfaceI2CSMBusInterface- Throws:
RuntimeIOException
-
writeByte
public void writeByte(byte b) throws RuntimeIOException- Specified by:
writeBytein interfaceI2CSMBusInterface- Throws:
RuntimeIOException
-
readByteData
public byte readByteData(int register) throws RuntimeIOException- Specified by:
readByteDatain interfaceI2CSMBusInterface- Throws:
RuntimeIOException
-
writeByteData
public void writeByteData(int register, byte b) throws RuntimeIOException- Specified by:
writeByteDatain interfaceI2CSMBusInterface- Throws:
RuntimeIOException
-
readWordData
public short readWordData(int register) throws RuntimeIOException- Specified by:
readWordDatain interfaceI2CSMBusInterface- Throws:
RuntimeIOException
-
writeWordData
public void writeWordData(int register, short s) throws RuntimeIOException- Specified by:
writeWordDatain interfaceI2CSMBusInterface- Throws:
RuntimeIOException
-
processCall
public short processCall(int register, short s) throws RuntimeIOException- Specified by:
processCallin interfaceI2CSMBusInterface- Throws:
RuntimeIOException
-
readBlockData
public byte[] readBlockData(int register) throws RuntimeIOException- Specified by:
readBlockDatain interfaceI2CSMBusInterface- Throws:
RuntimeIOException
-
writeBlockData
public void writeBlockData(int register, byte... data) throws RuntimeIOException- Specified by:
writeBlockDatain interfaceI2CSMBusInterface- Throws:
RuntimeIOException
-
blockProcessCall
public byte[] blockProcessCall(int register, byte... txData) throws RuntimeIOException- Specified by:
blockProcessCallin interfaceI2CSMBusInterface- Throws:
RuntimeIOException
-
readI2CBlockData
public int readI2CBlockData(int register, byte[] buffer) throws RuntimeIOException- Specified by:
readI2CBlockDatain interfaceI2CSMBusInterface- Throws:
RuntimeIOException
-
writeI2CBlockData
public void writeI2CBlockData(int register, byte... data) throws RuntimeIOException- Specified by:
writeI2CBlockDatain interfaceI2CSMBusInterface- Throws:
RuntimeIOException
-
readBytes
public int readBytes(byte[] buffer) throws RuntimeIOException- Specified by:
readBytesin interfaceI2CDeviceInterface- Throws:
RuntimeIOException
-
writeBytes
public void writeBytes(byte... data) throws RuntimeIOException- Specified by:
writeBytesin interfaceI2CDeviceInterface- Throws:
RuntimeIOException
-
readWrite
public void readWrite(I2CDeviceInterface.I2CMessage[] messages, byte[] buffer)
- Specified by:
readWritein interfaceI2CDeviceInterface
-
closeDevice
protected void closeDevice() throws RuntimeIOException- Specified by:
closeDevicein classAbstractDevice- Throws:
RuntimeIOException
-
-