com.ionetrics.lib.annotatorcomm
Class CommandMessage

java.lang.Object
  extended by com.ionetrics.lib.annotatorcomm.CommandMessage

public class CommandMessage
extends java.lang.Object

CommandMessage encapsulates the bytes of a command message and provides helpful methods for manipulating them.


Field Summary
static int CHECKSUM_RIDX
          Checksum reverse index
static int FOOTER_LEN
          Length of the footer in bytes
static int HEADER_LEN
          Length of the header in bytes
static int MSG_LEN_IDX
          Message length index
 
Constructor Summary
CommandMessage(CommandId cmdId)
          Construct a CommandMessage.
CommandMessage(short cmdId)
          Construct a CommandMessage.
 
Method Summary
 void addParamInt16(short param)
          Append a parameter as a 16-bit integer.
 void addParamInt32(int param)
          Append a parameter as an 32-bit integer.
 void addParamInt64(long param)
          Append a parameter as an 64-bit integer.
 void addParamInt8(byte param)
          Append a parameter as a 8-bit integer.
 byte[] getBytes()
          Get the command byte string.
 short getId()
          Get the Command ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER_LEN

public static final int HEADER_LEN
Length of the header in bytes

See Also:
Constant Field Values

FOOTER_LEN

public static final int FOOTER_LEN
Length of the footer in bytes

See Also:
Constant Field Values

MSG_LEN_IDX

public static final int MSG_LEN_IDX
Message length index

See Also:
Constant Field Values

CHECKSUM_RIDX

public static final int CHECKSUM_RIDX
Checksum reverse index

See Also:
Constant Field Values
Constructor Detail

CommandMessage

public CommandMessage(CommandId cmdId)
Construct a CommandMessage.

Parameters:
cmdId - Command ID

CommandMessage

public CommandMessage(short cmdId)
Construct a CommandMessage.

Parameters:
cmdId - Command ID
Method Detail

getId

public short getId()
Get the Command ID.

Returns:
Command ID

addParamInt8

public void addParamInt8(byte param)
Append a parameter as a 8-bit integer.

Parameters:
param - parameter

addParamInt16

public void addParamInt16(short param)
Append a parameter as a 16-bit integer.

Parameters:
param - parameter

addParamInt32

public void addParamInt32(int param)
Append a parameter as an 32-bit integer.

Parameters:
param - parameter

addParamInt64

public void addParamInt64(long param)
Append a parameter as an 64-bit integer.

Parameters:
param - parameter

getBytes

public byte[] getBytes()
Get the command byte string.

Returns:
command bytes


Copyright © 2006 Ionetrics Corp. All Rights Reserved.