tuwien.auto.calimero.link.medium
Class RawFrameBase

java.lang.Object
  extended by tuwien.auto.calimero.link.medium.RawFrameBase
All Implemented Interfaces:
RawFrame
Direct Known Subclasses:
PL110LData, PL132LData, TP1LData, TP1LPollData

public abstract class RawFrameBase
extends java.lang.Object
implements RawFrame

Implementation for raw frames with common used functionality in L-data and L-polldata frames.

For now, implementation is only done to accommodate reception of raw frame (contained in byte arrays), not to build raw frames out of information parts required to assemble a new raw frame.

Objects of this type are considered immutable.


Field Summary
protected  KNXAddress dst
          Destination address.
protected  boolean ext
          Is this an extended (true) or a standard frame (false).
protected  int fcs
          Frame checksum.
protected  int hopcount
          Frame hop count.
protected  Priority p
          Frame priority.
protected  boolean repetition
          Frame repetition flag.
protected  IndividualAddress src
          Source address.
protected  byte[] tpdu
          Transport layer protocol data unit.
protected  int type
          Frame type identifier.
 
Fields inherited from interface tuwien.auto.calimero.link.medium.RawFrame
ACK_FRAME, LDATA_FRAME, LPOLLDATA_FRAME
 
Constructor Summary
RawFrameBase()
           
 
Method Summary
 int getChecksum()
          Returns the frame checksum as contained in the frame.
 KNXAddress getDestination()
          Returns the KNX destination address.
 int getFrameType()
          Returns the type of this frame.
 byte getHopcount()
          Returns the hop count of this frame.
 Priority getPriority()
          Returns the message priority used for this frame.
 IndividualAddress getSource()
          Returns the KNX individual source address.
 byte[] getTPDU()
          Returns a copy of the TPDU, if available.
 boolean isRepetition()
          Returns whether frame repetition is requested, or this is a repeated frame.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dst

protected KNXAddress dst
Destination address.


ext

protected boolean ext
Is this an extended (true) or a standard frame (false).


fcs

protected int fcs
Frame checksum.


hopcount

protected int hopcount
Frame hop count.


p

protected Priority p
Frame priority.


repetition

protected boolean repetition
Frame repetition flag.


src

protected IndividualAddress src
Source address.


tpdu

protected byte[] tpdu
Transport layer protocol data unit.

In L-polldata frame tpdu is not used.


type

protected int type
Frame type identifier.

Constructor Detail

RawFrameBase

public RawFrameBase()
Method Detail

getChecksum

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

The returned checksum is taken from the frame "as is", it is not recalculated for validation nor checked for correctness.
The length and structure of the returned checksum depends on the communication medium.

Returns:
frame checksum

getDestination

public final KNXAddress getDestination()
Returns the KNX destination address.

Returns:
destination address of type KNXAddress

getFrameType

public final int getFrameType()
Description copied from interface: RawFrame
Returns the type of this frame.

Specified by:
getFrameType in interface RawFrame
Returns:
unsigned frame type identifier

getHopcount

public final byte getHopcount()
Returns the hop count of this frame.

Returns:
hop count in the range 0 <= count <= 7

getPriority

public final Priority getPriority()
Returns the message priority used for this frame.

Returns:
the used Priority

getSource

public final IndividualAddress getSource()
Returns the KNX individual source address.

Returns:
address of type IndividualAddress

getTPDU

public final byte[] getTPDU()
Returns a copy of the TPDU, if available.

Returns:
tpdu as byte array or null for L-polldata frames

isRepetition

public final boolean isRepetition()
Returns whether frame repetition is requested, or this is a repeated frame.

A request for repetition or repeated frame is indicated with true, otherwise false is returned.

Returns:
repeat state as boolean

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object