|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.cemi.CEMIBusMon
public class CEMIBusMon
A cEMI busmonitor indication message.
The data part of the busmonitor message structure contains the raw frame on medium (the
data link layer PDU + FCS), it accepts up to 23 bytes in length.
So the raw frame consists of 22 byte LPDU + 1 byte FCS.
Objects of this type are immutable.
Field Summary | |
---|---|
static short |
MC_BUSMON_IND
Message code for busmonitor indication, code = 43. |
static short |
TYPEID_STATUSINFO
Additional information type ID for status info, ID = 3. |
static short |
TYPEID_TIMESTAMP
Additional information type ID for timestamp, ID = 4. |
static short |
TYPEID_TIMESTAMP_EXT
Additional information type ID for extended timestamp, ID = 6. |
Constructor Summary | |
---|---|
CEMIBusMon(boolean frameError,
boolean bitError,
boolean parityError,
boolean lost,
byte seqNumber,
long timestamp,
boolean extTimestamp,
byte[] rawFrame)
Creates a new busmonitor message. |
|
CEMIBusMon(byte[] data,
int offset,
int length)
Creates a new busmonitor message from a byte stream. |
|
CEMIBusMon(byte seqNumber,
long timestamp,
boolean extTimestamp,
byte[] rawFrame)
Creates a new busmonitor message. |
|
CEMIBusMon(int status,
long timestamp,
boolean extTimestamp,
byte[] rawFrame)
Creates a new busmonitor message. |
Method Summary | |
---|---|
boolean |
getBitError()
Returns the bit error flag state set in the status information. |
boolean |
getFrameError()
Returns the frame error flag state set in the status information. |
boolean |
getLost()
Returns the lost flag state set in the status information. |
short |
getMessageCode()
Returns the cEMI message code. |
boolean |
getParityError()
Returns the parity error flag state set in the status information. |
byte[] |
getPayload()
Returns the raw frame on medium (the data link PDU inclusive FCS) contained in this busmonitor indication message. |
byte |
getSequenceNumber()
Returns the sequence number set in the status information. |
short |
getStructLength()
Returns the length of this cEMI message frame. |
long |
getTimestamp()
Returns the timestamp value of the monitoring frame contained in the additional information. |
short |
getTimestampType()
Returns the type of timestamp contained in the additional information. |
byte[] |
toByteArray()
Returns the byte representation of the whole cEMI message structure. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final short MC_BUSMON_IND
public static final short TYPEID_STATUSINFO
public static final short TYPEID_TIMESTAMP
public static final short TYPEID_TIMESTAMP_EXT
Constructor Detail |
---|
public CEMIBusMon(boolean frameError, boolean bitError, boolean parityError, boolean lost, byte seqNumber, long timestamp, boolean extTimestamp, byte[] rawFrame)
Allows to specify every status flag in detail.
frameError
- true
if a frame error was detected in the message,
false
otherwisebitError
- true
if an invalid bit was detected in one or
several of the frame characters, false
otherwiseparityError
- true
if an invalid parity bit was detected,
false
otherwiselost
- true
if at least one frame or frame piece was lost by
the Data Link Layer, false
otherwiseseqNumber
- sequence number in the status field (bits 2..0), 0 <=
seqNumber
<= 7timestamp
- relative timestamp as specified by cEMI, it might either be a
normal (2 byte range) timestamp for TYPEID_TIMESTAMP
, or an
extended (4 byte range) timestamp of type TYPEID_TIMESTAMP_EXT
extTimestamp
- true
if timestamp
is an extended
timestamp value, false
otherwiserawFrame
- byte array holding the raw frame on the medium (inclusive FCS),
also referred to as the data part in the message structure
rawFrame.length
<= 23public CEMIBusMon(byte[] data, int offset, int length) throws KNXFormatException
data
- byte stream containing a cEMI busmonitor messageoffset
- start offset of cEMI frame in data
length
- length in bytes of the whole bus monitor message
KNXFormatException
- if no busmonitor frame found or invalid frame structurepublic CEMIBusMon(byte seqNumber, long timestamp, boolean extTimestamp, byte[] rawFrame)
In the status field of the additional information block, only the sequence number can be chosen, all other status flags remain 0 (i.e. indicating no error, no frame loss)
seqNumber
- sequence number in the status field (bits 2..0), 0 <=
seqNumber
<= 7timestamp
- relative timestamp as specified by cEMI, it might either be a
normal (2 byte range) timestamp for TYPEID_TIMESTAMP
, or an
extended (4 byte range) timestamp of type TYPEID_TIMESTAMP_EXT
extTimestamp
- true
if timestamp
is an extended
timestamp value, false
otherwiserawFrame
- byte array holding the raw frame on the medium (inclusive FCS),
also referred to as the data part in the message structure
rawFrame.length
<= 23public CEMIBusMon(int status, long timestamp, boolean extTimestamp, byte[] rawFrame)
status
- the status information field (busmonitor error flags) as specified by
cEMI, located in the additional information type TYPEID_STATUSINFO
,
0 <= status <= 0xFFtimestamp
- relative timestamp as specified by cEMI, it might either be a
normal (2 byte range) timestamp for TYPEID_TIMESTAMP
, or an
extended (4 byte range) timestamp of type TYPEID_TIMESTAMP_EXT
extTimestamp
- true
if timestamp
is an extended
timestamp value, false
otherwiserawFrame
- byte array holding the raw frame on the medium (inclusive FCS),
also referred to as the data part in the message structure,
rawFrame.length
<= 23Method Detail |
---|
public final boolean getBitError()
If true
, an invalid bit was detected in one or several of the frame
characters.
public final boolean getFrameError()
If true
, a frame error was detected in the message.
public final boolean getLost()
If true
, at least one frame (piece) was lost by the Data Link
Layer.
public final short getMessageCode()
CEMI
The codes of the different cEMI message types can be looked up in the according subtype implementations.
getMessageCode
in interface CEMI
public final boolean getParityError()
If true
, an invalid parity bit was detected in the frame bits.
public final byte[] getPayload()
getPayload
in interface CEMI
public final byte getSequenceNumber()
public final short getStructLength()
CEMI
getStructLength
in interface CEMI
public final long getTimestamp()
The type of timestamp returned is according to getTimestampType()
.
public final short getTimestampType()
public byte[] toByteArray()
CEMI
toByteArray
in interface CEMI
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |