com.esf.device.modem.channel.service
Class Hip

java.lang.Object
  extended by com.esf.device.modem.channel.service.Hip

public class Hip
extends java.lang.Object

Describes HIP (Host Interface Protocol) object.

The Host Interface Protocol is a multiplexing layer designed to allow several types of message streams to share the same physical link layer. CnS is one of the supported streams. HIP is used to carry control and status data between the modem and the host to provide management of the modem device. This management consists of:

• Non-volatile configuration of the device

• Run-time configuration of the device

• Status reporting and monitoring of the device

This protocol does not include checksums. It relies on a high-reliability physical interface between the host and the modem to reduce the processing burden on the microprocessor.

HIP format:

Byte offset Content
0Framing character (0x7E)
1-2Length of ooptional payload
3Message ID
4Parameter
5-nOptional payload
n+1Framing character (0x7E)

The minimum length of a HIP packet is six bytes, for a packet without the optional payload. Note that such a packet would have the first field set to 0x0000—no payload.

Author:
ilya.binshtok

Field Summary
static byte FRAME_BYTE
          Frame byte delimiter.
static int MIN_MSG_SIZE
          Minimum message size.
static byte MSGID_CNS_HOST2MODEM
          Indicates host to modem message direction.
static byte MSGID_CNS_MODEM2HOST
          Indicates modem to host message direction.
 
Constructor Summary
Hip(java.util.ArrayList alMsg)
          HIP reply constructor
Hip(byte[] payload)
          HIP request constructor
 
Method Summary
 byte[] getHIPmessage()
          Reports HIP message
 byte getMessageID()
          Reports message ID
 byte[] getPayload()
          Reports HIP payload
 boolean isError()
          Reports if there is an error in processing HIP reply
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSGID_CNS_HOST2MODEM

public static final byte MSGID_CNS_HOST2MODEM
Indicates host to modem message direction.

See Also:
Constant Field Values

MSGID_CNS_MODEM2HOST

public static final byte MSGID_CNS_MODEM2HOST
Indicates modem to host message direction.

See Also:
Constant Field Values

MIN_MSG_SIZE

public static final int MIN_MSG_SIZE
Minimum message size.

See Also:
Constant Field Values

FRAME_BYTE

public static final byte FRAME_BYTE
Frame byte delimiter.

See Also:
Constant Field Values
Constructor Detail

Hip

public Hip(byte[] payload)
HIP request constructor

Parameters:
payload - - HIP payload

Hip

public Hip(java.util.ArrayList alMsg)
HIP reply constructor

Parameters:
alMsg - - HIP reply
Method Detail

getHIPmessage

public byte[] getHIPmessage()
Reports HIP message

Returns:
byte [] - message

getPayload

public byte[] getPayload()
Reports HIP payload

Returns:
HIP payload

getMessageID

public byte getMessageID()
Reports message ID

Returns:
Message ID

isError

public boolean isError()
Reports if there is an error in processing HIP reply

Returns:
boolean
true - error
false - no error