Class RemoteSerialDevice
- java.lang.Object
-
- com.diozero.internal.spi.AbstractDevice
-
- com.diozero.internal.provider.remote.devicefactory.RemoteSerialDevice
-
- All Implemented Interfaces:
DeviceInterface,SerialDeviceInterface,InternalDeviceInterface,InternalSerialDeviceInterface,AutoCloseable
public class RemoteSerialDevice extends AbstractDevice implements InternalSerialDeviceInterface
-
-
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
All Methods Instance Methods Concrete Methods 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, isOpen
-
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.internal.spi.InternalDeviceInterface
getKey, isOpen
-
-
-
-
Constructor Detail
-
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 Detail
-
read
public int read()
- Specified by:
readin interfaceSerialDeviceInterface
-
readByte
public byte readByte() throws RuntimeIOException- 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
protected void closeDevice() throws RuntimeIOException- Specified by:
closeDevicein classAbstractDevice- Throws:
RuntimeIOException
-
-