|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.cemi.CEMIFactory
public final class CEMIFactory
Factory helper for creating and copying cEMI messages.
Method Summary | |
---|---|
static CEMI |
copy(CEMI original)
Does a lazy copy of the supplied cEMI frame. |
static CEMI |
create(byte[] data,
int offset,
int length)
Creates a new cEMI message out of the given data byte stream. |
static CEMI |
create(IndividualAddress src,
KNXAddress dst,
CEMILData original,
boolean extended)
Creates a new cEMI L-Data message with information provided by original , and adjusts source and destination address to match the
supplied addresses. |
static CEMI |
create(int msgCode,
byte[] data,
CEMI original)
Creates a new cEMI message with information provided by original ,
and adjusts it to match the supplied msgCode and data . |
static CEMI |
createFromEMI(byte[] frame)
Creates a new cEMI message out of the supplied EMI frame. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static CEMI copy(CEMI original)
Only for cEMI frames which are not immutable a copy is created, for all
other frames original
is returned.
original
- the frame to copy
original
frame if immutable, a copy of it otherwisepublic static CEMI create(byte[] data, int offset, int length) throws KNXFormatException
data
byte stream.
data
- byte stream containing a cEMI message frame structureoffset
- start offset of cEMI message in data
length
- length in bytes of the whole cEMI message in data
KNXFormatException
- if no (valid) cEMI structure was found or unsupported
cEMI message codepublic static CEMI create(IndividualAddress src, KNXAddress dst, CEMILData original, boolean extended)
original
, and adjusts source and destination address to match the
supplied addresses.
src
- the new KNX source address for the message, use null
to
use original addressdst
- the new KNX destination address for the message, use null
to use original addressoriginal
- the original frame providing all missing information for the
adjusted messageextended
- true
to always created an extended frame,
false
to create type according to original
public static CEMI create(int msgCode, byte[] data, CEMI original) throws KNXFormatException
original
,
and adjusts it to match the supplied msgCode
and data
.
The message code has to correspond to the type of cEMI frame supplied with
original
. The byte length of data has to fit the cEMI frame type
supplied with original
.
The data
argument varies according to the supplied message code. For
L-Data frames, this is the tpdu, for busmonitor frames, this is the raw frame, for
device management frames, this is the data part or error information.
msgCode
- the message code for the new cEMI framedata
- the data for the frameoriginal
- the original frame providing all necessary information for the new
frame
KNXFormatException
- if cEMI message code is unsupported or frame creation
failedpublic static CEMI createFromEMI(byte[] frame) throws KNXFormatException
frame
- EMI frame
KNXFormatException
- if no (valid) EMI structure was found or unsupported EMI
message code
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |