tuwien.auto.eicl.struct.cemi
Class CEMI_L_DATA
java.lang.Object
tuwien.auto.eicl.struct.cemi.CEMI_L_DATA
- CEMI
public class CEMI_L_DATA
extends java.lang.Object
This class encapsulates a CEMI_L_DATA message. It has all necessary get and
set methods for creating or extracting a CEMI_L_DATA message. Note that this
class handles only standard frame formats, with application layer data up to
16 bytes. Frames with additional information are not supported. CEMI_L_DATA
messages are typically sent and received through tunnelling connections.
MC_L_DATACON
public static final short MC_L_DATACON
cEMI L_DATA_Confirmation
MC_L_DATAIND
public static final short MC_L_DATAIND
cEMI L_DATA_Indication
MC_L_DATAREQ
public static final short MC_L_DATAREQ
cEMI L_DATA_Request
PRIORITY_LOW
public static final byte PRIORITY_LOW
cEMI Message with low priority
PRIORITY_NORMAL
public static final byte PRIORITY_NORMAL
cEMI Message with normal priority
PRIORITY_SYSTEM
public static final byte PRIORITY_SYSTEM
cEMI Message with system priority
PRIORITY_URGENT
public static final byte PRIORITY_URGENT
cEMI Message with urgent priority
CEMI_L_DATA
public CEMI_L_DATA(byte[] _CEMI)
throws EICLException
Creates and parses a new CEMI_L_DATA frame out of a byte array. Only
standard frames are supported
EICLException
- If the provided frame is not a standard frame an exception
is thrown.
CEMI_L_DATA
public CEMI_L_DATA(short _Messagecode,
EIB_Address _Source,
EIB_Address _Dest,
byte[] _Data)
throws EICLException
Creates a new CEMI_L_DATA frame. Only standard frames are accepted.
_Messagecode
- CEMI_L_DATA message code_Source
- individual Source address_Dest
- destination address_Data
- message body (starting with transport layer control
information)
getAcknowledgeRequested
public boolean getAcknowledgeRequested()
Checks whether the message was acknowledged by an endpoint.
getData
public byte[] getData()
Get the CEMI_L_DATA application layer data (Message body).
- getData in interface CEMI
getDestinationAddress
public EIB_Address getDestinationAddress()
Get the CEMI_L_DATA destination address.
- Returns the destination address.
getHopCount
public byte getHopCount()
Get the message hop count.
getMessageCode
public short getMessageCode()
Returns the CEMI_L_DATA message code. See constants.
- getMessageCode in interface CEMI
- CEMI_L_DATA message code.
getPriority
public byte getPriority()
Get the message priority
- Returns the message priority
getSourceAddress
public EIB_Address getSourceAddress()
Get the CEMI_L_DATA source address.
- Returns the source address
getStructLength
public int getStructLength()
Get the length of the message in bytes
- getStructLength in interface CEMI
isExtendedFrame
public boolean isExtendedFrame()
Checks whether the frame is an extended or normal frame. In the current
implementation this method always returns false.
- Is the current frame in extended frame format?
isPositiveConfirmation
public boolean isPositiveConfirmation()
Returns bit 0 of control field 1 inverted. Check this for a L_DATA_CON,
to see whether the associated request was processed successfully.
isRepeatedFrame
public boolean isRepeatedFrame()
Returns the state of the repeat flag. Especially relevant for L_Data
indications. Note that a cEMI server should not pass incoming repeated
frames to clients when it has already received (and passed on) the
corresponding original, non-repeated frame.
- True if the repeat flag is 0 (zero), false otherwise.
setAcknowledgeRequest
public void setAcknowledgeRequest(boolean _Boolean)
Sets the acknowledge requesting flag
_Boolean
- The flag value.
setHopCount
public void setHopCount(byte _hopcount)
Set the message hop count.
_hopcount
- The routing counter value.
setPriority
public void setPriority(byte _Priority)
Set the message priority. See constants.
_Priority
- Sets the message priority.
setRepeatFlag
public void setRepeatFlag(boolean _Repeat)
Sets the repeat flag. The repeat flag is considered a request for
automatic retransmission on L_Data requests.
_Repeat
- True to set the repeat flag 0 (repeated on medium/do not
repeat on error). False to set the repeat flag 1 (not repeated
on medium/don't care).
toByteArray
public byte[] toByteArray()
throws EICLException
Returns the byte representation of this message. If an IOException
occurred the EICLExcepiton is thrown.
- toByteArray in interface CEMI