|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.cemi.CEMILData
tuwien.auto.calimero.cemi.CEMILDataEx
public class CEMILDataEx
A cEMI link layer data message (L-Data).
Extended frame formats are supported, with a transport layer protocol data unit of 255 bytes maximum. Additional information might be specified.
Objects of this L-Data type are not immutable.
Nested Class Summary | |
---|---|
static class |
CEMILDataEx.AddInfo
Holds an additional info type with corresponding information data. |
Field Summary | |
---|---|
static int |
ADDINFO_BIBAT
Additional information type for BiBat information. |
static int |
ADDINFO_PLMEDIUM
Additional information type for PL medium information. |
static int |
ADDINFO_RFMEDIUM
Additional information type for RF medium information. |
static int |
ADDINFO_TIMEDELAY
Additional information type for time delay until sending information. |
static int |
ADDINFO_TIMESTAMP
Additional information type for relative timestamp information. |
static int |
ADDINFO_TIMESTAMP_EXT
Additional information type for extended relative timestamp information. |
Fields inherited from class tuwien.auto.calimero.cemi.CEMILData |
---|
ctrl1, ctrl2, mc, MC_LDATA_CON, MC_LDATA_IND, MC_LDATA_REQ |
Constructor Summary | |
---|---|
CEMILDataEx(byte[] data,
int offset)
Creates a new L-Data message from a byte stream. |
|
CEMILDataEx(int msgCode,
IndividualAddress src,
KNXAddress dst,
byte[] tpdu,
Priority p)
Creates a L-Data message with most control information set to default values. |
|
CEMILDataEx(int msgCode,
IndividualAddress src,
KNXAddress dst,
byte[] tpdu,
Priority p,
boolean confirm)
Creates a L-Data message, mainly for confirmation. |
|
CEMILDataEx(int msgCode,
IndividualAddress src,
KNXAddress dst,
byte[] tpdu,
Priority p,
boolean repeat,
boolean broadcast,
boolean ack,
int hopCount)
Creates a L-Data message with full customization for control information. |
|
CEMILDataEx(int msgCode,
IndividualAddress src,
KNXAddress dst,
byte[] tpdu,
Priority p,
boolean repeat,
int hopCount)
Creates a L-Data message, mainly for TP1 media. |
Method Summary | |
---|---|
void |
addAdditionalInfo(int infoType,
byte[] info)
Adds additional information to the message. |
java.lang.Object |
clone()
|
java.util.List |
getAdditionalInfo()
Returns all additional information currently set. |
byte[] |
getAdditionalInfo(int infoType)
Returns additional information data corresponding to the supplied type ID, if it is contained in the message. |
short |
getStructLength()
Returns the length of this cEMI message frame. |
boolean |
isDomainBroadcast()
Returns the kind of broadcast set for this message. |
boolean |
isExtendedFrame()
Returns whether the message assembles an extended frame format. |
void |
removeAdditionalInfo(int infoType)
Removes the additional information with the supplied type ID. |
void |
setBroadcast(boolean domainOnly)
Specifies the kind of broadcast to use for sending. |
void |
setHopCount(int hobbes)
|
void |
setPriority(Priority p)
|
byte[] |
toByteArray()
Returns the byte representation of the whole cEMI message structure. |
java.lang.String |
toString()
|
Methods inherited from class tuwien.auto.calimero.cemi.CEMILData |
---|
getDestination, getHopCount, getMessageCode, getPayload, getPriority, getSource, isAckRequested, isPositiveConfirmation, isRepetition |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ADDINFO_BIBAT
public static final int ADDINFO_PLMEDIUM
public static final int ADDINFO_RFMEDIUM
public static final int ADDINFO_TIMEDELAY
public static final int ADDINFO_TIMESTAMP
public static final int ADDINFO_TIMESTAMP_EXT
Constructor Detail |
---|
public CEMILDataEx(byte[] data, int offset) throws KNXFormatException
data
- byte stream containing a cEMI L-Data messageoffset
- start offset of cEMI frame in data
KNXFormatException
- if no (valid) frame was foundpublic CEMILDataEx(int msgCode, IndividualAddress src, KNXAddress dst, byte[] tpdu, Priority p)
The initialized message has send repetitions according to default medium behavior
(for indication message this equals "not repeated frame"), broadcast is "don't
care", acknowledge request is default medium behavior, hop count is 6 and
confirmation request is "don't care" in the control field.
msgCode
- a message code value specified in the L-Data typesrc
- individual address of sourcedst
- destination addresstpdu
- data array, starting with the TPCI / APCI (transport / application
layer protocol control information), i.e. the NPDU without the length field,
tpdu.length <= 255p
- message priority, priority set in the control fieldpublic CEMILDataEx(int msgCode, IndividualAddress src, KNXAddress dst, byte[] tpdu, Priority p, boolean confirm)
The message hop count is set to 6, send repetitions according to default medium
behavior, broadcast and acknowledge request are set to "don't care" in the control
field.
msgCode
- a message code value specified in the L-Data typesrc
- individual address of sourcedst
- destination addresstpdu
- data array, starting with the TPCI / APCI (transport / application
layer protocol control information); i.e. the NPDU without the length field,
tpdu.length <= 255p
- message priority, priority set in the control fieldconfirm
- confirm flag in the control field, true
to set error,
false
for no errorpublic CEMILDataEx(int msgCode, IndividualAddress src, KNXAddress dst, byte[] tpdu, Priority p, boolean repeat, boolean broadcast, boolean ack, int hopCount)
The confirmation flag of the control field is left out, since it is mutual
exclusive with the rest of the control information and set to "don't care" (refer
to CEMILDataEx(int, IndividualAddress, KNXAddress, byte[], Priority,
boolean)
).
msgCode
- a message code value specified in the L-Data typesrc
- individual address of sourcedst
- destination addresstpdu
- data array, starting with the TPCI / APCI (transport / application
layer protocol control information), i.e. the NPDU without the length field,
tpdu.length <= 255p
- message priority, priority set in the control fieldrepeat
- for request messages send repetitions on the medium -
false
for do not repeat if error, true
for
default repeat behavior;true
if is repeated frame,
false
otherwisebroadcast
- system / domain broadcast behavior, applicable on open media only:
false
for system broadcast, true
for
broadcast; on closed media set true
for "don't care"ack
- acknowledge request, true
if acknowledge is requested,
false
for default behavior;hopCount
- hop count starting value set in control field, in the range 0 <=
value <= 7public CEMILDataEx(int msgCode, IndividualAddress src, KNXAddress dst, byte[] tpdu, Priority p, boolean repeat, int hopCount)
msgCode
- a message code value specified in the L-Data typesrc
- individual address of sourcedst
- destination addresstpdu
- data array, starting with the TPCI / APCI (transport / application
layer protocol control information), i.e. the NPDU without the length field,
tpdu.length <= 255p
- message priority, priority set in the control fieldrepeat
- for request message, send repetitions on the medium -
false
for do not repeat if error, true
for
default repeat behavior;true
if is repeated frame,
false
otherwisehopCount
- hop count starting value set in control field, in the range 0 <=
value <= 7Method Detail |
---|
public void addAdditionalInfo(int infoType, byte[] info)
It replaces additional information of the same type, if any was previously added.
infoType
- type ID of additional informationinfo
- additional information datapublic java.lang.Object clone()
clone
in class java.lang.Object
public java.util.List getAdditionalInfo()
CEMILDataEx.AddInfo
objectspublic byte[] getAdditionalInfo(int infoType)
infoType
- type ID of the request additional information
null
if no such information
is availablepublic short getStructLength()
CEMI
getStructLength
in interface CEMI
getStructLength
in class CEMILData
public boolean isDomainBroadcast()
By default, true
is returned, indicating "domain-only" broadcast on
open media or "don't care" on closed media.
true
if broadcast only within domain or "don't care" mode,
false
for system broadcastpublic boolean isExtendedFrame()
true
if this is an extended frame, false
otherwisepublic void removeAdditionalInfo(int infoType)
infoType
- type ID of additional information to removepublic void setBroadcast(boolean domainOnly)
domainOnly
- true
for doing a broadcast only within the domain,
false
for a system broadcastpublic final void setHopCount(int hobbes)
public final void setPriority(Priority p)
public byte[] toByteArray()
CEMI
toByteArray
in interface CEMI
toByteArray
in class CEMILData
public java.lang.String toString()
toString
in class CEMILData
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |