tuwien.auto.calimero.mgmt
Class Description

java.lang.Object
  extended by tuwien.auto.calimero.mgmt.Description

public final class Description
extends java.lang.Object

Holds description information of a KNX interface object property.

The supported description information and the expected description structure layout is according to the application layer property description read service.
This Description type also supports the property object type and the number of current elements.

When used together with local device management, not all description information will be available.

Objects of this type are immutable.


Constructor Summary
Description(int objType, byte[] data)
          Creates a new description object for a property out of a byte array.
Description(int objType, int currentElements, byte[] data)
          Creates a new description object for a property out of a data byte array, together with object type and number of current elements.
Description(int objIndex, int objType, int pid, int propIndex, int pdt, boolean writeEnable, int currentElements, int maxElements, int readLevel, int writeLevel)
          Creates a new description object for a property using the given parameters.
 
Method Summary
 int getCurrentElements()
          Returns the current number of elements in the property.
 int getMaxElements()
          Returns the maximum number of elements allowed in the property.
 short getObjectIndex()
          Returns the device unique object index contained the property.
 int getObjectType()
          Returns the object type to which the property belongs to.
 byte getPDT()
          Returns the property data type.
 short getPID()
          Returns the property identifier.
 short getPropIndex()
          Returns the property index.
 byte getReadLevel()
          Returns the read access level for the property.
 byte getWriteLevel()
          Returns the write access level for the property.
 boolean isWriteEnabled()
          Returns whether the property is write-enabled or read only.
 java.lang.String toString()
          Returns the property description in textual representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Description

public Description(int objType,
                   byte[] data)
Creates a new description object for a property out of a byte array.

The description structure layout of data is according to the application layer property description read service.

Parameters:
objType - interface object type the property belongs to
data - byte array containing property description, starting at data[0]

Description

public Description(int objType,
                   int currentElements,
                   byte[] data)
Creates a new description object for a property out of a data byte array, together with object type and number of current elements.

Parameters:
objType - interface object type the property belongs to
currentElements - current number of elements in the property
data - byte array holding the description information, the structure is according to the ASDU of a property description service response

Description

public Description(int objIndex,
                   int objType,
                   int pid,
                   int propIndex,
                   int pdt,
                   boolean writeEnable,
                   int currentElements,
                   int maxElements,
                   int readLevel,
                   int writeLevel)
Creates a new description object for a property using the given parameters.

Parameters:
objIndex - index of the object in the device, starting with 0
objType - interface object type the property belongs to
pid - property identifier, a 6 Bit identifier
propIndex - property index in the object, starting with 0
pdt - property data type
writeEnable - specifies if the property is write-enabled or read only
currentElements - current number of elements in the property
maxElements - maximum number of elements allowed in the property
readLevel - read access level, 0 <= level <= 15
writeLevel - write access level, 0 <= level <= 15
Method Detail

getCurrentElements

public int getCurrentElements()
Returns the current number of elements in the property.

Returns:
current elements

getMaxElements

public int getMaxElements()
Returns the maximum number of elements allowed in the property.

With local device management, this attribute is not available and 0 is returned.

Returns:
maximum elements, or 0

getObjectIndex

public short getObjectIndex()
Returns the device unique object index contained the property.

Returns:
the object index

getObjectType

public int getObjectType()
Returns the object type to which the property belongs to.

Returns:
the object type

getPDT

public byte getPDT()
Returns the property data type.

With local device management, the PDT is not available and -1 is returned.

Returns:
the PDT or -1 for no PDT

getPID

public short getPID()
Returns the property identifier.

Returns:
the PID

getPropIndex

public short getPropIndex()
Returns the property index.

Returns:
the property index

getReadLevel

public byte getReadLevel()
Returns the read access level for the property.

The level is between 0 (maximum access rights) and 15 (minimum access rights).

Returns:
the read level as 4 bit value

getWriteLevel

public byte getWriteLevel()
Returns the write access level for the property.

The level is between 0 (maximum access rights) and 15 (minimum access rights).

Returns:
the write level as 4 bit value

isWriteEnabled

public boolean isWriteEnabled()
Returns whether the property is write-enabled or read only.

Returns:
true if write enabled, false otherwise

toString

public java.lang.String toString()
Returns the property description in textual representation.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the description