Top Description Fields Methods
org.osgi.service.enocean.descriptions

public Interface EnOceanChannelDescription

Known Direct Subinterfaces
org.osgi.service.enocean.descriptions.EnOceanDataChannelDescription, org.osgi.service.enocean.descriptions.EnOceanEnumChannelDescription, org.osgi.service.enocean.descriptions.EnOceanFlagChannelDescription

Public and registered description interface for a channel. Encompasses all the possible subtypes for a channel.
Author
$Id: 61b21375118e33bd04c3ede4f4d8374e927ce076 $
Version
1.0

Field Summary

Modifier and TypeField and Description
public static final String
CHANNEL_ID

The unique ID of this EnOceanChannelDescription object.

public static final String
TYPE_DATA

A DATA channel maps itself to a Double value representing a physical measure.

public static final String
TYPE_ENUM

An ENUM channel maps itself to one between a list of discrete EnOceanChannelEnumValue "value objects".

public static final String
TYPE_FLAG

A FLAG channel maps itself to a Boolean value.

public static final String
TYPE_RAW

A RAW channel is only made of bytes.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

a value object.
deserialize
(byte[]
the right-aligned raw bytes.
bytes
)

Tries to deserialize a series of bytes into a documented value object (raw bytes, Double or EnOceanChannelEnumValue.

public String

Returns:

one of the above-described types.
getType
()

Retrieves the type of the channel.

public byte[]

Returns:

the right-aligned value, in raw bytes, of the channel.
serialize
(Object
the value of the channel.
obj
)

Tries to serialize the channel into a series of bytes.

Field Detail

CHANNEL_IDback to summary
public static final String CHANNEL_ID

The unique ID of this EnOceanChannelDescription object.

TYPE_DATAback to summary
public static final String TYPE_DATA

A DATA channel maps itself to a Double value representing a physical measure.

TYPE_ENUMback to summary
public static final String TYPE_ENUM

An ENUM channel maps itself to one between a list of discrete EnOceanChannelEnumValue "value objects".

TYPE_FLAGback to summary
public static final String TYPE_FLAG

A FLAG channel maps itself to a Boolean value.

TYPE_RAWback to summary
public static final String TYPE_RAW

A RAW channel is only made of bytes.

Method Detail

deserializeback to summary
public Object deserialize(byte[] bytes)

Tries to deserialize a series of bytes into a documented value object (raw bytes, Double or EnOceanChannelEnumValue. Of course this method will be specialized for each EnOceanChannelDescription subinterface, depending on the type of this channel.

Parameters
bytes:byte[]

the right-aligned raw bytes.

Returns:Object

a value object.

getTypeback to summary
public String getType()

Retrieves the type of the channel.

Returns:String

one of the above-described types.

serializeback to summary
public byte[] serialize(Object obj)

Tries to serialize the channel into a series of bytes.

Parameters
obj:Object

the value of the channel.

Returns:byte[]

the right-aligned value, in raw bytes, of the channel.