net.sourceforge.jmodbus
Interface ModbusTransport
- All Known Implementing Classes:
- ModbusRTUTransport, ModbusTCPTransport, ModbusASCIITransport
- public interface ModbusTransport
Interface for Modbus transport mechanisims. This is the interface
that will be implemented by classes representing the transports for the
different flavours of Modbus. Examples are ModbusRTU, ModbusASCII
and ModbusTCP.
Classes implementing this interface are reponsible for the framing
and deframing of Modbus messages from ther transport media and the
actual sending and recieving of data.
sendFrame
public boolean sendFrame(ModbusMessage msg)
- Method to send a Modbus frame via the transport media. The return
status of the function indicates if the transmission sucedded.
- Parameters:
msg
- The Modbus Message to be sent.- Returns:
- Transmission sucess flag, to indicate if the transmission
was sucessful.
receiveFrame
public boolean receiveFrame(ModbusMessage msg)
- Method to receive a Modbus frame via the transport media. The return
value indicates the length of the frame. This method will block until
the comminication path is terminated or a frame is sucessfully received.
- Parameters:
msg
- The Modbus Message object for received data to be written into- Returns:
- Receive sucess flag, to indicate if the receive was sucessful.