public abstract class AbstractModbusTransport extends Object
| Constructor and Description |
|---|
AbstractModbusTransport() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Closes the raw input and output streams of
this ModbusTransport.
|
abstract ModbusTransaction |
createTransaction()
Creates a Modbus transaction for the underlying transport.
|
abstract ModbusRequest |
readRequest(AbstractModbusListener listener)
Reads a ModbusRequest from the
input stream of this ModbusTransport.
|
abstract ModbusResponse |
readResponse()
Reads a ModbusResponse from the
input stream of this ModbusTransport.
|
void |
setTimeout(int time)
Set the socket timeout
|
abstract void |
writeRequest(ModbusRequest msg)
Writes a ModbusMessage to the
output stream of this ModbusTransport.
|
abstract void |
writeResponse(ModbusResponse msg)
Writes a ModbusResponseMessage to the
output stream of this ModbusTransport.
|
public void setTimeout(int time)
time - Timeout in millisecondspublic abstract void close()
throws IOException
IOException - if a stream
cannot be closed properly.public abstract ModbusTransaction createTransaction()
public abstract void writeRequest(ModbusRequest msg) throws ModbusIOException
msg - a ModbusMessage.ModbusIOException - data cannot be
written properly to the raw output stream of
this ModbusTransport.public abstract void writeResponse(ModbusResponse msg) throws ModbusIOException
msg - a ModbusMessage.ModbusIOException - data cannot be
written properly to the raw output stream of
this ModbusTransport.public abstract ModbusRequest readRequest(AbstractModbusListener listener) throws ModbusIOException
listener - Listener the request was received byModbusIOException - data cannot be
read properly from the raw input stream of
this ModbusTransport.public abstract ModbusResponse readResponse() throws ModbusIOException
ModbusIOException - data cannot be
read properly from the raw input stream of
this ModbusTransport.Copyright © 2025. All Rights Reserved.