|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.knxnetip.util.CRI
public class CRI
Immutable container for a connection request information (CRI).
The CRI structure is used for the additional information in a connection request.
It is built up of host protocol independent data and host protocol dependent data, both
optional. Refer to the available subtypes for more specific type information.
For now, a plain CRI is returned for management connections, since this connection type doesn't require any additional host protocol data.
Factory methods are provided for creation of CRI objects.
ConnectRequest
Constructor Summary | |
---|---|
protected |
CRI(byte[] data,
int offset)
Creates a new CRI out of a byte array. |
protected |
CRI(short connectionType,
byte[] optionalData)
Creates a new CRI for the given connection type. |
Method Summary | |
---|---|
static CRI |
createRequest(byte[] data,
int offset)
Creates a new CRI out of a byte array. |
static CRI |
createRequest(short connectionType,
byte[] optionalData)
Creates a CRI for the given connection type. |
short |
getConnectionType()
Returns the used connection type code. |
byte[] |
getOptionalData()
Returns a copy of the optional data field. |
short |
getStructLength()
Returns the structure length of this CR in bytes. |
byte[] |
toByteArray()
Returns the byte representation of the whole CR structure. |
java.lang.String |
toString()
Returns a textual representation of the connection type, length and optional data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected CRI(byte[] data, int offset) throws KNXFormatException
data
- byte array containing a CRI structureoffset
- start offset of CRI in data
KNXFormatException
- if no CRI found or invalid structureprotected CRI(short connectionType, byte[] optionalData)
The array of optionalData
is not copied for internal storage. No
additional checks regarding content are done.
connectionType
- connection type the CRI is used for (e.g. tunnel connection)optionalData
- byte array containing optional host protocol independent and
dependent data, this information is located starting at offset 2 in the CRI
structure, optionalData.length
< 254Method Detail |
---|
public static CRI createRequest(byte[] data, int offset) throws KNXFormatException
If possible, a matching, more specific, CRI subtype is returned. Note, that CRIs
for specific communication types might expect certain characteristics on
data
(regarding contained data).
data
- byte array containing the CRI structureoffset
- start offset of CRI in data
KNXFormatException
- if no CRI found or invalid structurepublic static CRI createRequest(short connectionType, byte[] optionalData)
If possible, a matching, more specific, CRI subtype is returned. Note, that CRIs
for specific communication types might expect certain characteristics on
optionalData
(regarding length and/or content).
connectionType
- connection type this CRI is used for (e.g. tunnel connection)optionalData
- byte array containing optional host protocol independent and
dependent data, this information is located starting at offset 2 in the CRI
structure, optionalData.length
< 254, may be
null
for no optional data
public final short getConnectionType()
public final byte[] getOptionalData()
Optional data starts at offset 2 in the CR structure.
public final short getStructLength()
public byte[] toByteArray()
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 |