jamod at SF

net.wimpi.modbus.io
Interface ModbusTransport

All Known Implementing Classes:
ModbusSerialTransport, ModbusTCPTransport, ModbusUDPTransport

public interface ModbusTransport

Interface defining the I/O mechanisms for ModbusMessage instances.

Version:
1.2rc1 (09/11/2004)
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

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

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

writeMessage

public 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

public 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

public 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.

jamod at SF

Copyright © 2002-2004 jamod development team.