|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.knxnetip.servicetype.KNXnetIPHeader
public class KNXnetIPHeader
The common KNXnet/IP header used at the first position in every KNXnet/IP frame.
It contains the protocol version, length of this header, the total frame length and the service type identifier of the service carried by the frame. The header, most certainly, is followed by a KNXnet/IP body, depending on the service type, i.e. every KNXnet/IP frame consists at least of this header.
The header itself, however, only consists of the pure header structure, it will not
store or read any frame body content.
It is used for KNXnet/IP frame to retrieve general information in the first place,
followed by processing of the frame through more specific service types.
Most service type identifiers are listed as public constants in this header interface.
The KNXnet/IP implementation status is 1.0.
Objects of this type are immutable.
Field Summary | |
---|---|
static int |
CONNECT_REQ
Service type identifier for a connect request. |
static int |
CONNECT_RES
Service type identifier for a connect response. |
static int |
CONNECTIONSTATE_REQ
Service type identifier for a connection state request. |
static int |
CONNECTIONSTATE_RES
Service type identifier for a connection state response. |
static int |
DESCRIPTION_REQ
Service type identifier for a description request. |
static int |
DESCRIPTION_RES
Service type identifier for a description response. |
static int |
DEVICE_CONFIGURATION_ACK
Service type identifier to confirm the reception of the configuration request. |
static int |
DEVICE_CONFIGURATION_REQ
Service type identifier for configuration request (read / write device configuration data, interface properties). |
static int |
DISCONNECT_REQ
Service type identifier for a disconnect request. |
static int |
DISCONNECT_RES
Service type identifier for a disconnect response. |
static short |
KNXNETIP_VERSION_10
Version identifier for KNXnet/IP protocol version 1.0. |
static int |
ROUTING_IND
Service type identifier for sending KNX telegrams over IP networks with multicast. |
static int |
ROUTING_LOST_MSG
Service type identifier to indicate the loss of routing messages with multicast. |
static int |
SEARCH_REQ
Service type identifier for a search request. |
static int |
SEARCH_RES
Service type identifier for a search response. |
static int |
TUNNELING_ACK
Service type identifier to confirm the reception of a tunneling request. |
static int |
TUNNELING_REQ
Service type identifier to send and receive single KNX frames between client and server. |
Constructor Summary | |
---|---|
KNXnetIPHeader(byte[] frame,
int offset)
Creates a new KNXnet/IP header by reading in the header of a KNXnet/IP frame. |
|
KNXnetIPHeader(int serviceType,
int bodyLength)
Creates a new KNXnet/IP header for the given service and frame body length. |
Method Summary | |
---|---|
int |
getServiceType()
Returns the service type identifier. |
int |
getStructLength()
Returns the length of the KNXnet/IP header structure. |
int |
getTotalLength()
Returns the total length of the KNXnet/IP frame the header is part of. |
int |
getVersion()
Returns the KNXnet/IP protocol version of the frame. |
byte[] |
toByteArray()
Returns the byte representation of the KNXnet/IP header structure. |
java.lang.String |
toString()
Returns a textual representation of this KNXnet/IP header. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CONNECT_REQ
public static final int CONNECT_RES
public static final int CONNECTIONSTATE_REQ
public static final int CONNECTIONSTATE_RES
public static final int DESCRIPTION_REQ
public static final int DESCRIPTION_RES
public static final int DEVICE_CONFIGURATION_ACK
public static final int DEVICE_CONFIGURATION_REQ
public static final int DISCONNECT_REQ
public static final int DISCONNECT_RES
public static final short KNXNETIP_VERSION_10
public static final int ROUTING_IND
public static final int ROUTING_LOST_MSG
public static final int SEARCH_REQ
public static final int SEARCH_RES
public static final int TUNNELING_ACK
public static final int TUNNELING_REQ
Constructor Detail |
---|
public KNXnetIPHeader(byte[] frame, int offset) throws KNXFormatException
frame
- byte array with contained KNXnet/IP frameoffset
- start offset of KNXnet/IP header structure in frame
KNXFormatException
- if frame
is too short for header, on
wrong header size or not supported KNXnet/IP protocol versionpublic KNXnetIPHeader(int serviceType, int bodyLength)
serviceType
- service type identifier specifying the service followed after
the header, 0 <= type <= 0xFFFFbodyLength
- length of the frame body, i.e. byte length of the following
service structureMethod Detail |
---|
public final int getServiceType()
public int getStructLength()
public final int getTotalLength()
The total length is calculated by adding the header length and the length of the service contained in the frame.
public int getVersion()
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 |