jamod at SF

net.wimpi.modbus.msg
Class ModbusResponse

java.lang.Object
  extended bynet.wimpi.modbus.msg.ModbusMessageImpl
      extended bynet.wimpi.modbus.msg.ModbusResponse
All Implemented Interfaces:
ModbusMessage, Transportable
Direct Known Subclasses:
ExceptionResponse, ReadCoilsResponse, ReadInputDiscretesResponse, ReadInputRegistersResponse, ReadMultipleRegistersResponse, WriteCoilResponse, WriteMultipleCoilsResponse, WriteMultipleRegistersResponse, WriteSingleRegisterResponse

public abstract class ModbusResponse
extends ModbusMessageImpl

Abstract class implementing a ModbusResponse. This class provides specialised implementations with the functionality they have in common.

Version:
1.2rc1 (09/11/2004)
Author:
Dieter Wimberger

Constructor Summary
ModbusResponse()
           
 
Method Summary
static ModbusResponse createModbusResponse(int functionCode)
          Factory method creating the required specialized ModbusResponse instance.
protected  void setMessage(byte[] msg)
          Utility method to set the raw data of the message.
 
Methods inherited from class net.wimpi.modbus.msg.ModbusMessageImpl
getDataLength, getFunctionCode, getHexMessage, getOutputLength, getProtocolID, getTransactionID, getUnitID, isHeadless, readData, readFrom, setDataLength, setFunctionCode, setHeadless, setHeadless, setProtocolID, setTransactionID, setUnitID, writeData, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModbusResponse

public ModbusResponse()
Method Detail

setMessage

protected void setMessage(byte[] msg)
Utility method to set the raw data of the message. Should not be used except under rare circumstances.

Parameters:
msg - the byte[] resembling the raw modbus response message.

createModbusResponse

public static ModbusResponse createModbusResponse(int functionCode)
Factory method creating the required specialized ModbusResponse instance.

Parameters:
functionCode - the function code of the response as int.
Returns:
a ModbusResponse instance specific for the given function code.

jamod at SF

Copyright © 2002-2004 jamod development team.