net.wimpi.modbus.io
Interface ModbusTransport

All Known Implementing Classes:
ModbusASCIITransport, ModbusBINTransport, ModbusRTUTransport, ModbusSerialTransport, ModbusTCPTransport, ModbusUDPTransport

public interface ModbusTransport

Interface defining the I/O mechanisms for ModbusMessage instances.

Version:
@version@ (@date@)
Author:
Dieter Wimberger

Method Summary
 void close()
          Closes the raw input and output streams of this ModbusTransport.
 ModbusRequest readRequest()
          Reads a ModbusRequest from the input stream of this ModbusTransport.
 ModbusResponse readResponse()
          Reads a ModbusResponse from the input stream of this ModbusTransport.
 void writeMessage(ModbusMessage msg)
          Writes a to the output stream of this ModbusTransport.
 

Method Detail

close

void close()
           throws IOException
Closes the raw input and output streams of this ModbusTransport.

Throws:
IOException - if a stream cannot be closed properly.

writeMessage

void writeMessage(ModbusMessage msg)
                  throws ModbusIOException
Writes a to the output stream of this ModbusTransport.

Parameters:
msg - a ModbusMessage.
Throws:
ModbusIOException - data cannot be written properly to the raw output stream of this ModbusTransport.

readRequest

ModbusRequest readRequest()
                          throws ModbusIOException
Reads a ModbusRequest from the input stream of this ModbusTransport.

Returns:
req the ModbusRequest read from the underlying stream.
Throws:
ModbusIOException - data cannot be read properly from the raw input stream of this ModbusTransport.

readResponse

ModbusResponse readResponse()
                            throws ModbusIOException
Reads a ModbusResponse from the input stream of this ModbusTransport.

Returns:
res the ModbusResponse read from the underlying stream.
Throws:
ModbusIOException - data cannot be read properly from the raw input stream of this ModbusTransport.


Copyright © 2010. All Rights Reserved.