tuwien.auto.eicl.struct.eibnetip

Class Disconnect_Response


public class Disconnect_Response
extends java.lang.Object

A EIBnet/IP disconnect response is sent in answer to a disconnect request. This class holds all necessary data, and is able to parse or create a new disconnect response.
See Also:
Disconnect_Request

Constructor Summary

Disconnect_Response(byte[] buffer)
Use this constructor to parse a disconnect response from a byte array.
Disconnect_Response(short _Channelid, short _Status)
Use this constructor to create a new disconnect response.

Method Summary

short
getChannelid()
This method returns the channel identifier byte.
short
getStatus()
Use this method to get the message status(error code) as byte.
String
getStatusString()
This method returns a human readable status message.
byte[]
toByteArray()
Get the message as byte array.

Constructor Details

Disconnect_Response

public Disconnect_Response(byte[] buffer)
Use this constructor to parse a disconnect response from a byte array. The data fields can then be accessed through the get methods. Pass everything after the EIBnet/IP header to this constructor.
Parameters:
buffer - the byte array

Disconnect_Response

public Disconnect_Response(short _Channelid,
                           short _Status)
Use this constructor to create a new disconnect response.
Parameters:
_Channelid - The channel ID of the connection being closed
_Status - The error code, indicating whether the connection was closed successfully.

Method Details

getChannelid

public short getChannelid()
This method returns the channel identifier byte.
Returns:
The channelid of the connection being closed.

getStatus

public short getStatus()
Use this method to get the message status(error code) as byte.
Returns:
status short

getStatusString

public String getStatusString()
This method returns a human readable status message.
Returns:
status string

toByteArray

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