tuwien.auto.calimero.link.medium
Class PL132Ack

java.lang.Object
  extended by tuwien.auto.calimero.link.medium.RawAckBase
      extended by tuwien.auto.calimero.link.medium.PL132Ack
All Implemented Interfaces:
RawFrame

public class PL132Ack
extends RawAckBase

Raw acknowledge frame on PL132 communication medium.

The acknowledge on PL132 medium is handled using the frame checksum in the associated frame request.
A positive acknowledgment frame contains the sequence of bits received in the FCS field of the associated L-data request. A negative acknowledgment contains the bitwise complement of the checksum received with the L-data request.


Field Summary
static int FULL
          Negative acknowledge type, reception buffer is full.
static int UNKNOWN_ACK
          The kind of acknowledge is unknown, because no checksum from the frame request is available for comparison, or the delivered checksum in the ack-frame is invalid.
 
Fields inherited from class tuwien.auto.calimero.link.medium.RawAckBase
ack, ACK, NAK
 
Fields inherited from interface tuwien.auto.calimero.link.medium.RawFrame
ACK_FRAME, LDATA_FRAME, LPOLLDATA_FRAME
 
Constructor Summary
PL132Ack(byte[] data, int offset)
          Creates a new PL132 acknowledge frame out of a byte array.
PL132Ack(byte[] data, int offset, int requestChecksum)
          Creates a new PL132 acknowledge frame out of a byte array.
 
Method Summary
 int getChecksum()
          Returns the checksum contained in this acknowledge frame.
 java.lang.String toString()
          Returns a textual representation of the acknowledge frame information.
 
Methods inherited from class tuwien.auto.calimero.link.medium.RawAckBase
getAckType, getFrameType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FULL

public static final int FULL
Negative acknowledge type, reception buffer is full.

See Also:
RawAckBase.getAckType(), Constant Field Values

UNKNOWN_ACK

public static final int UNKNOWN_ACK
The kind of acknowledge is unknown, because no checksum from the frame request is available for comparison, or the delivered checksum in the ack-frame is invalid.

See Also:
RawAckBase.getAckType(), Constant Field Values
Constructor Detail

PL132Ack

public PL132Ack(byte[] data,
                int offset)
Creates a new PL132 acknowledge frame out of a byte array.

The type of acknowledge returned for the created frame is always UNKNOWN_ACK, since no checksum of the associated frame request is supplied. Use getChecksum() to determine the type of acknowledge.

Parameters:
data - byte array containing the acknowledge frame
offset - start offset of frame structure in data, offset >= 0

PL132Ack

public PL132Ack(byte[] data,
                int offset,
                int requestChecksum)
Creates a new PL132 acknowledge frame out of a byte array.

Parameters:
data - byte array containing the acknowledge frame
offset - start offset of frame structure in data, offset >= 0
requestChecksum - checksum of the associated frame request
Method Detail

getChecksum

public final int getChecksum()
Returns the checksum contained in this acknowledge frame.

Returns:
checksum as unsigned short

toString

public java.lang.String toString()
Description copied from class: RawAckBase
Returns a textual representation of the acknowledge frame information.

Overrides:
toString in class RawAckBase
Returns:
string representation of the object