Class RemoteSerialDevice
java.lang.Object
com.diozero.internal.spi.AbstractDevice
com.diozero.internal.provider.remote.devicefactory.RemoteSerialDevice
- All Implemented Interfaces:
DeviceInterface,SerialDeviceInterface,Closeable,AutoCloseable
public class RemoteSerialDevice extends AbstractDevice implements SerialDeviceInterface
-
Constructor Summary
Constructors Constructor Description RemoteSerialDevice(RemoteDeviceFactory deviceFactory, String key, String deviceFile, int baud, SerialConstants.DataBits dataBits, SerialConstants.StopBits stopBits, SerialConstants.Parity parity, boolean readBlocking, int minReadChars, int readTimeoutMillis) -
Method Summary
Modifier and Type Method Description intbytesAvailable()protected voidcloseDevice()intread()intread(byte[] buffer)bytereadByte()voidwrite(byte... data)voidwriteByte(byte bVal)Methods inherited from class com.diozero.internal.spi.AbstractDevice
close, getDeviceFactory, getKey, isOpenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.diozero.api.DeviceInterface
close, getKey, isOpen
-
Constructor Details
-
RemoteSerialDevice
public RemoteSerialDevice(RemoteDeviceFactory deviceFactory, String key, String deviceFile, int baud, SerialConstants.DataBits dataBits, SerialConstants.StopBits stopBits, SerialConstants.Parity parity, boolean readBlocking, int minReadChars, int readTimeoutMillis)
-
-
Method Details
-
read
public int read()- Specified by:
readin interfaceSerialDeviceInterface
-
readByte
- Specified by:
readBytein interfaceSerialDeviceInterface- Throws:
RuntimeIOException
-
writeByte
public void writeByte(byte bVal)- Specified by:
writeBytein interfaceSerialDeviceInterface
-
read
public int read(byte[] buffer)- Specified by:
readin interfaceSerialDeviceInterface
-
write
public void write(byte... data)- Specified by:
writein interfaceSerialDeviceInterface
-
bytesAvailable
public int bytesAvailable()- Specified by:
bytesAvailablein interfaceSerialDeviceInterface
-
closeDevice
- Specified by:
closeDevicein classAbstractDevice- Throws:
RuntimeIOException
-