tuwien.auto.calimero.knxnetip.servicetype
Class DescriptionRequest

java.lang.Object
  extended by tuwien.auto.calimero.knxnetip.servicetype.DescriptionRequest

public class DescriptionRequest
extends java.lang.Object

Represents a KNXnet/IP description request.

A request for self description is mainly used by a client after discovery of a new remote device endpoint. It is sent to the control endpoint of the server device. The counterpart to this request is the description response.

Objects of this type are immutable.

See Also:
DescriptionResponse, Discoverer

Constructor Summary
DescriptionRequest(byte[] data, int offset)
          Creates a description request out of a byte array.
DescriptionRequest(HPAI ctrlEndpoint)
          Creates a new description request with the given client control endpoint for a description response.
DescriptionRequest(java.net.InetSocketAddress responseAddr)
          Creates a new description request with the client address used for a description response.
DescriptionRequest(int responsePort)
          Convenience constructor to create a new description request using the UDP transport protocol and the system default local host with the supplied client port.
 
Method Summary
 HPAI getEndpoint()
          Returns the client control endpoint.
 byte[] toByteArray()
          Returns the service type structure formatted into a byte array.
 java.lang.String toString()
          Returns the service type name of this service type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DescriptionRequest

public DescriptionRequest(byte[] data,
                          int offset)
                   throws KNXFormatException
Creates a description request out of a byte array.

Parameters:
data - byte array containing a description request structure
offset - start offset of request in data
Throws:
KNXFormatException - if no description request was found or invalid structure

DescriptionRequest

public DescriptionRequest(HPAI ctrlEndpoint)
Creates a new description request with the given client control endpoint for a description response.

Parameters:
ctrlEndpoint - client control endpoint used for response

DescriptionRequest

public DescriptionRequest(java.net.InetSocketAddress responseAddr)
Creates a new description request with the client address used for a description response.

This request uses the UDP transport protocol.

Parameters:
responseAddr - address of client control endpoint used for response, use null if NAT is used on the IP network

DescriptionRequest

public DescriptionRequest(int responsePort)
Convenience constructor to create a new description request using the UDP transport protocol and the system default local host with the supplied client port.

Parameters:
responsePort - port number of the client control endpoint used for response, 0 <= port <= 0xFFFF
Method Detail

getEndpoint

public final HPAI getEndpoint()
Returns the client control endpoint.

Returns:
control endpoint in a HPAI

toByteArray

public final byte[] toByteArray()
Returns the service type structure formatted into a byte array.

Returns:
service type structure as byte array
See Also:
PacketHelper

toString

public java.lang.String toString()
Returns the service type name of this service type.

Overrides:
toString in class java.lang.Object
Returns:
service type as string