tuwien.auto.eicl.struct.eibnetip.util

Class CRI_CRD


public class CRI_CRD
extends java.lang.Object

CRI_CRD = connection request information / connection response data. This class is able to parse a CRI or CRD structure. All encapsulated information can be accessed and set by get and set methods. The data body is restricted to two bytes. (Enough for our purpose)
See Also:
Connect_Request, Connect_Response

Constructor Summary

CRI_CRD(byte[] _Data)
Creates a new instance from a byte array
CRI_CRD(short _Connectiontypecode, short[] _Data)
Creates a new instance with the given parameters.

Method Summary

short
getConnectionTypeCode()
Extracts the structure connection type code.
short[]
getData()
Get the data bytes included
short
getStructLength()
Returns the message structure length.
byte[]
toByteArray()
Get the structure byte array representation.

Constructor Details

CRI_CRD

public CRI_CRD(byte[] _Data)
            throws EICLException
Creates a new instance from a byte array
Parameters:
_Data - the byte array
Throws:
EICLException - if the byte array has the wrong length this exception is thrown

CRI_CRD

public CRI_CRD(short _Connectiontypecode,
               short[] _Data)
Creates a new instance with the given parameters.
Parameters:
_Connectiontypecode - The connection type code.
_Data - The connection type dependent data bytes.

Method Details

getConnectionTypeCode

public short getConnectionTypeCode()
Extracts the structure connection type code.
Returns:
The structure connection type.

getData

public short[] getData()
Get the data bytes included
Returns:
The data byte array

getStructLength

public short getStructLength()
Returns the message structure length.
Returns:
The structure length

toByteArray

public byte[] toByteArray()
Get the structure byte array representation.
Returns:
byte array The structure as byte array.