tuwien.auto.calimero.knxnetip.util
Class SuppFamiliesDIB

java.lang.Object
  extended by tuwien.auto.calimero.knxnetip.util.DIB
      extended by tuwien.auto.calimero.knxnetip.util.SuppFamiliesDIB

public class SuppFamiliesDIB
extends DIB

Supported service families description information block.

It informs about the service families supported by the device.

Objects of this type are immutable.

See Also:
DescriptionResponse

Field Summary
 
Fields inherited from class tuwien.auto.calimero.knxnetip.util.DIB
DEVICE_INFO, MFR_DATA, SUPP_SVC_FAMILIES
 
Constructor Summary
SuppFamiliesDIB(byte[] data, int offset)
          Creates a supported families DIB out of a byte array.
 
Method Summary
 java.util.Set getFamilies()
          Returns all supported service families, each family together with the version it is implemented and supported up to.
 java.lang.String getFamilyName(short family)
          Returns the service family name for the supplied family ID.
 short getVersion(short family)
          Returns the version associated to a given supported service family.
 byte[] toByteArray()
          Returns the byte representation of the whole DIB structure.
 java.lang.String toString()
          Returns a textual representation of this supported service families DIB.
 
Methods inherited from class tuwien.auto.calimero.knxnetip.util.DIB
getDescTypeCode, getStructLength
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SuppFamiliesDIB

public SuppFamiliesDIB(byte[] data,
                       int offset)
                throws KNXFormatException
Creates a supported families DIB out of a byte array.

Parameters:
data - byte array containing the service families DIB structure
offset - start offset of DIB in data
Throws:
KNXFormatException - if no DIB found or invalid structure
Method Detail

getFamilies

public final java.util.Set getFamilies()
Returns all supported service families, each family together with the version it is implemented and supported up to.

The returned set holds Map.Entry items, with the service family of type Short being the key, and the version of type Short being the value.

Returns:
an unmodifiable set containing supported entries (family-version pair)

getFamilyName

public final java.lang.String getFamilyName(short family)
Returns the service family name for the supplied family ID.

Parameters:
family - service family ID to get name for
Returns:
family name as string, or null on no name available

getVersion

public final short getVersion(short family)
Returns the version associated to a given supported service family.

If the service family is not supported, 0 is returned.

Parameters:
family - supported service family to lookup
Returns:
version as unsigned byte, or 0

toByteArray

public byte[] toByteArray()
Description copied from class: DIB
Returns the byte representation of the whole DIB structure.

Overrides:
toByteArray in class DIB
Returns:
byte array containing structure

toString

public java.lang.String toString()
Returns a textual representation of this supported service families DIB.

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