142 Device Abstraction Layer Functions Specification

142.1 Introduction

Concrete function interfaces are used to unify the access and the control of the basic device operations and the related properties. The current section specifies the minimal set of such functionalities. They can be extended or replaced to cover domain specific scenarios. The set is not closed and can be incorporated with vendor specific functions. There is support for: control, monitoring and metering information.

142.2 Functions

142.2.1 BooleanControl

BooleanControl function provides a binary control support. The property eventing must follow the definition of Device Abstraction Layer, Function Property Events. The full function definition is available in the next tables.

Table 142.1 BooleanControl Operations

Name Description
inverse Reverses the BooleanControl state. If the current state represents true value, it'll be changed to false. If the current state represents false value, it'll be changed to true.
setTrue Sets the BooleanControl state to true value.
setFalse Sets the BooleanControl state to false value.

Table 142.2 BooleanControl Properties

Name Description
data Contains the current state of BooleanControl. The property access is readable, writable and eventable.

Different types can be used as a value of SERVICE_TYPE service property. The next list contains some suitable to BooleanControl:

  • LIGHT - indicates that there is a light device control. true state means that the light device will be turned on. false state means that the light device will be turned off.

  • DOOR - indicates that there is a door position control. true state means that the door will be opened. false state means that the door will be closed.

  • WINDOW - indicates that there is a window position control. true state means that the window will be opened. false state means that the window will be closed.

  • POWER - indicates that there is electricity control. true state means that the power will be restored. false state means that the power will be cut.

  • other type defined in Types

  • vendor specific

The function is using BooleanData data structure to provide the control state.

The next code snippet sets to true all BooleanControl functions, which control the light.

ServiceReference[] booleanControlSRefs = context.getServiceReferences(
      BooleanControl.class.getName(),
      '(' + Function.SERVICE_TYPE + '=' + Types.LIGHT + ')');
if (booleanControlSRefs != null) {
  for (int i = 0; i < booleanControlSRefs.length; i++) {
    BooleanControl booleanControl = (BooleanControl) context.getService(
        booleanControlSRefs[i]);
    if (booleanControl != null) {
      booleanControl.setTrue();
      context.ungetService(booleanControlSRefs[i]);
    }
  }
}

142.2.2 BooleanSensor

BooleanSensor function provides binary sensor monitoring. It reports the state when an important event is available. There are no operations. The property eventing must follow the definition of Device Abstraction Layer, Function Property Events. The full function definition is available in the next table.

Table 142.3 BooleanSensor Properties

Name Description
data Contains the current state of BooleanSensor. The property access is readable and eventable.

Different types can be used as a value of SERVICE_TYPE service property. The next list contains some suitable to BooleanSensor:

  • LIGHT - indicates that the BooleanSensor can detected light. true state means that there is light. false state means that there is no light.

  • GAS - indicates that the BooleanSensor supports gas detection. true state means there is gas. false state means that there is no gas.

  • SMOKE - indicates that the BooleanSensor can detect smoke. true state means that there is smoke. false state means that there is no smoke.

  • DOOR - indicates that the BooleanSensor can detect the door state. true state means that the door is opened. false state means that the door is closed.

  • WINDOW - indicates that the BooleanSensor can window state. true state means that the window is opened. false state means that the window is closed.

  • POWER - indicates that the BooleanSensor can detect power/no power. true state means that there is power. false state means that there is no power.

  • RAIN - indicates that the BooleanSensor can detect rain. true state means that there is rain. false state means that there is no rain.

  • CONTACT - indicates that the BooleanSensor can detect contact. true state means that there is contact. false state means that there is no contact.

  • FIRE - indicates that the BooleanSensor can detect fire. true state means that there is fire. false state means that there is no fire.

  • OCCUPANCY - indicates that the BooleanSensor can detect presence. true state means that someone is detected. false state means that nobody is detected.

  • WATER - indicates that the BooleanSensor can detect water leak. true state means that there is water leak. false state means that there is no water leak.

  • MOTION - indicates that the BooleanSensor can detect motion. true state means that there is motion detection. false state means that there is no motion detection.

  • other type defined in Types

  • vendor specific

The function is using BooleanData data structure to provide the sensor state.

142.2.3 MultiLevelControl

MultiLevelControl function provides multi-level control support. The property eventing must follow the definition of Device Abstraction Layer, Function Property Events. The full function definition is available in the next table.

Table 142.4 MultiLevelControl Properties

Name Description
data Contains the current state of MultiLevelControl. The property access is readable, writable and eventable.

Different types can be used as a value of SERVICE_TYPE service property. The next list contains some suitable to MultiLevelControl:

  • LIGHT - indicates that the MultiLevelControl can control light devices. Usually, such devices are called dimmable. MultiLevelControl minimum value can switch off the device and MultiLevelControl maximum value can increase the device light to the maximum possible value.

  • TEMPERATURE - indicates that the MultiLevelControl can control temperature devices. For example, such device can be thermostat. MultiLevelControl minimum value is the lowest supported temperature. MultiLevelControl maximum value is the highest supported temperature.

  • FLOW - indicates that the MultiLevelControl can control the flow level. MultiLevelControl minimum value is the minimum supported flow level. MultiLevelControl maximum value is the maximum supported flow level.

  • PRESSURE - indicates that the MultiLevelControl can control the pressure level. MultiLevelControl minimum value is the lowest supported pressure level. MultiLevelControl maximum value is the highest supported pressure level.

  • HUMIDITY - indicates that the MultiLevelControl can control the humidity level. It's typical functionality for HVAC (heating, ventilation, and air conditioning) devices. MultiLevelControl minimum value is the lowest supported humidity level. MultiLevelControl maximum value is the highest supported humidity level.

  • GAS - indicates that the MultiLevelControl can control the gas level. MultiLevelControl minimum value is the lowest supported gas level. MultiLevelControl maximum value is the highest supported gas level.

  • SMOKE - indicates that the MultiLevelControl can control the smoke level. MultiLevelControl minimum value is the lowest supported smoke level. MultiLevelControl maximum value is the highest supported smoke level.

  • DOOR - indicates that the MultiLevelControl can control the door position. MultiLevelControl minimum value can completely close the door. MultiLevelControl maximum value can open the door to the maximum allowed position.

  • WINDOW - indicates that the MultiLevelControl can control the window position. MultiLevelControl minimum value can completely close the window. MultiLevelControl maximum value can open the window to the maximum allowed position.

  • LIQUID - indicates that the MultiLevelControl can control the liquid level. MultiLevelControl minimum value is the lowest supported liquid level. MultiLevelControl maximum value is the highest supported liquid level.

  • POWER - indicates that the MultiLevelControl can control the power level. MultiLevelControl minimum value is the lowest supported power level. MultiLevelControl maximum value is the highest supported power level.

  • NOISINESS - indicates that the MultiLevelControl can control the noise level. MultiLevelControl minimum value is the lowest supported noise level. MultiLevelControl maximum value is the highest supported noise level.

  • other type defined in Types

  • vendor specific

The function is using LevelData data structure to provide the level.

142.2.4 MultiLevelSensor

MultiLevelSensor function provides multi-level sensor monitoring. It reports its state when an important event is available. There are no operations. The property eventing must follow the definition of Device Abstraction Later, Function Property Events. The full function definition is available in the next table.

Table 142.5 MultiLevelSensor Properties

Name Description
data Contains the current state of MultiLevelSensor. The property access is readable and eventable.

Different types can be used as a value of SERVICE_TYPE service property. The next list contains some suitable to MultiLevelSensor:

  • LIGHT - indicates that the sensor can monitor the light level.

  • TEMPERATURE - indicates that the sensor can monitor the temperature.

  • FLOW - indicates that the sensor can monitor the flow level.

  • PRESSURE - indicates that the sensor can monitor the pressure level.

  • HUMIDITY - indicates that the sensor can monitor the humidity level.

  • GAS - indicates that the sensor can monitor the gas level.

  • SMOKE - indicates that the sensor can monitor the smoke level.

  • DOOR - indicates that the sensor can monitor the door position.

  • WINDOW - indicates that the sensor can monitor the window position.

  • LIQUID - indicates that the sensor can monitor the liquid level.

  • POWER - indicates that the sensor can monitor the power level.

  • NOISINESS - indicates that the sensor can monitor the noise level.

  • RAIN - indicates that the MultiLevelSensor can monitor the rain rate.

  • other type defined in Types

  • vendor specific

The function is using LevelData data structure to provide the level.

142.2.5 Meter

Meter function can measure metering information. It provides the current and total consumptions or generations. The property eventing must follow the definition of Device Abstraction Later, Function Property Events. The full function definition is available in the next tables.

Table 142.6 Meter Properties

Name Description
total Contains the total consumption or production. The property access is readable and eventable.
current Contains the current consumption or production. The property access is readable and eventable.

Different types can be used as a value of SERVICE_TYPE service property. The next list contains some suitable to Meter:

  • PRESSURE - indicates that the Meter measures pressure.

  • GAS - indicates that the Meter measures the gas consumption.

  • POWER - indicates that the Meter measures the power consumption.

  • WATER - indicates that the Meter measures water consumption.

  • HEAT - indicates that the Meter measures thermal energy provided by a source.

  • COLD - indicates that the Meter measures thermal energy provided by a source.

  • other type defined in Types

  • vendor specific

The function is using LevelData data structure to provide metering information.

Meter function service can be optionally registered with SERVICE_FLOW service property. The value type is java.lang.String. It contains the metering flow. Currently, the flow can be FLOW_IN for a consumption or FLOW_OUT for a production.

142.2.6 Alarm

Alarm function provides alarm sensor support. There is only one eventable property and no operations. The property eventing must follow the definition of Device Abstraction Layer, Function Property Events. The full function definition is available in the next table.

Table 142.7 BooleanSensor Properties

Name Description
alarm Specifies the alarm property name. The property is eventable.

The function is using AlarmData data structure to report the alarm. The property eventing must follow the definition of Device Abstraction Layer, Function Property Events.

142.2.7 Keypad

Keypad function provides support for keypad control. The keypad typically consists of one or more keys/buttons, which can be discerned. Different types of key presses like short and long press can typically also be detected. Each key pressed event is followed by a key released event. It's not possible to have two consecutive key pressed or key released events. There is only one eventable property and no operations. The property eventing must follow the definition of Device Abstraction Layer, Function Property Events. The full function definition is available in the next table.

Table 142.8 Keypad Properties

Name Description
key Specifies a property name for a key from the keypad. The property is eventable.

The function is using KeypadData data structure to report the keys.

142.2.8 WakeUp

WakeUp function provides device awake monitoring. It's especially applicable to battery-operated devices. Such device can notify the system that it's awake and can receive commands with a PROPERTY_AWAKE property event. The property eventing must follow the definition of Device Abstraction Layer, Function Property Events.

The device can periodically wake up for commands. The interval can be managed with PROPERTY_WAKE_UP_INTERVAL property.

Table 142.9 WakeUp Properties

Name Description
awake Specifies the awake eventable property name. If the device is awake, it will trigger a property event. The property value type is BooleanData.
wakeUpInterval Specifies the wake up interval. The device can periodically wake up and receive commands. That interval is managed by this property. The property access is readable, writable and eventable. The property value type is LevelData.

142.3 Functions Data

FunctionData subclasses are wrappers on top of the java types to cover the requirements of the Device Abstraction Layer section. They can be received with the getter methods, can be set with the setter methods and can be reported with FunctionEvent. The value can be described with different properties like:

  • timestamp - the timestamp is the difference between the value collecting time and midnight, January 1, 1970 UTC. It's measured in milliseconds. The device driver is responsible to generate that value when the value is received from the device.

  • unit - represents the value unit as it's defined in Function Properties.

  • description - represents a human readable description of the value.

142.3.1 BooleanData

BooleanData is used by BooleanControl, BooleanSensor and WakeUp.

It provides information about the function state. That data object contains boolean value, the value collecting time and additional metadata. The value field is accessible with getValue() getter. Other fields are inherited from the parent class FunctionData.

Two BooleanData instances are equal if they contain equal metadata, timestamp and boolean value.

compareTo(Object) method compares BooleanData instance with the given argument of the same type and returns:

  • -1 if the instance field is less than a field of the specified argument.

  • 0 if all fields are equivalent.

  • 1 if the instance field is greater than a field of the specified argument.

The fields are compared in this order: timestamp, metadata, value.

142.3.2 LevelData

LevelData is used by MultiLevelControl, MultiLevelSensor, Meter and WakeUp.

It provides information about the function level. That data object contains BigDecimal value and the value unit. The measurement unit is used as it's defined in Function Properties. The unit field is accessible with getUnit() getter. The level field is accessible with getLevel() getter.

Two LevelData instances are equal if they contain equal metadata, timestamp, unit and level.

compareTo(Object) method compares LevelData instance with the given argument of the same type and returns:

  • -1 if the instance field is less than a field of the specified argument.

  • 0 if all fields are equivalent.

  • 1 if the instance field is greater than a field of the specified argument.

The fields are compared in this order: timestamp, metadata, level, unit.

142.3.3 AlarmData

AlarmData is used by Alarm.

AlarmData data structure is used to provide information about the available alarm. That data object contains:

  • alarm type - indicates the meaning of the alarm like smoke, power fail, etc.

  • alarm severity - indicates the alarm importance level like minor, critical, etc.

The severity field is accessible with getSeverity() getter. The type field is accessible with getType() getter.

Two AlarmData instances are equal if they contain equal metadata, timestamp, type and severity.

compareTo(Object) method compares AlarmData instance with the given argument of the same type and returns:

  • -1 if the instance field is less than a field of the specified argument.

  • 0 if all fields are equivalent.

  • 1 if the instance field is greater than a field of the specified argument.

The fields are compared in this order: timestamp, metadata, type, severity.

142.3.4 KeypadData

KeypadData is used by Keypad.

KeypadData data structure is used to provide information when a change with some key from the keypad has occurred. That data object contains the event type, sub-type, key code and key name. Currently, there are two predefined event types:

Predefined event sub-types are:

  • SUB_TYPE_PRESSED_NORMAL – used for a normal key pressed event. Usually, there is a single press and the key is not held down. This sub-type is used with TYPE_PRESSED type.

  • SUB_TYPE_PRESSED_LONG – used for a long key pressed event. Usually, there is a single press and the key is held down. This sub-type is used with TYPE_PRESSED type.

  • SUB_TYPE_PRESSED_DOUBLE – used for a double key pressed event. Usually, there are two press actions and the key is not held down after the second press. This sub-type is used with TYPE_PRESSED type.

  • SUB_TYPE_PRESSED_DOUBLE_LONG – used for a double long key pressed event. Usually, there are two press actions and the key is held down after the second press. This sub-type is used with TYPE_PRESSED type.

The type field is accessible with getType() getter. The subType field is accessible with getSubType() getter. The keyCode field is accessible with getKeyCode() getter. The keyName field is accessible with getKeyName() getter.

Two KeypadData instances are equal if they contain equal metadata, timestamp, event type, sub-type, key code and key name.

compareTo(Object) method compares KeypadData instance with the given argument of the same type and returns:

  • -1 if the instance field is less than a field of the specified argument.

  • 0 if all fields are equivalent.

  • 1 if the instance field is greater than a field of the specified argument.

The fields are compared in this order: timestamp, metadata, type, sub-type, key code, key name.

142.4 org.osgi.service.dal.functions

Version 1.0

Device Abstraction Layer Functions Package 1.0.

Bundles wishing to use this package must list the package in the Import-Package header of the bundle's manifest. This package has two types of users: the consumers that use the API in this package and the providers that implement the API in this package.

Example import for consumers using the API in this package:

Import-Package: org.osgi.service.dal.functions; version="[1.0,2.0)"

Example import for providers implementing the API in this package:

Import-Package: org.osgi.service.dal.functions; version="[1.0,1.1)"

142.4.1 Summary

  • Alarm - Alarm function provides alarm sensor support.

  • BooleanControl - BooleanControl function provides a boolean control support.

  • BooleanSensor - BooleanSensor function provides boolean sensor monitoring.

  • Keypad - Keypad function provides support for keypad control.

  • Meter - Meter function can measure metering information.

  • MultiLevelControl - MultiLevelControl function provides multi-level control support.

  • MultiLevelSensor - MultiLevelSensor function provides multi-level sensor monitoring.

  • Types - Shares common constants for all functions defined in this package.

  • WakeUp - WakeUp function provides device awake monitoring.

142.4.2 public interface Alarm
extends Function

Alarm function provides alarm sensor support. There is only one eventable property and no operations.

AlarmData

142.4.2.1 public static final String PROPERTY_ALARM = "alarm"

Specifies the alarm property name. The property is eventable.

AlarmData

142.4.3 public interface BooleanControl
extends Function

BooleanControl function provides a boolean control support. The eventable function state is accessible with getData() getter and setData(boolean) setter. The state can be reversed with inverse() method, can be set to true value with setTrue() method and can be set to false value with setFalse() method.

The control type can be:

BooleanData

142.4.3.1 public static final String OPERATION_INVERSE = "inverse"

Specifies the inverse operation name. The operation can be executed with inverse() method.

142.4.3.2 public static final String OPERATION_SET_FALSE = "setFalse"

Specifies the operation name, which sets the control state to false value. The operation can be executed with setFalse() method.

142.4.3.3 public static final String OPERATION_SET_TRUE = "setTrue"

Specifies the operation name, which sets the control state to true value. The operation can be executed with setTrue() method.

142.4.3.4 public static final String PROPERTY_DATA = "data"

Specifies the state property name. The eventable property value is accessible with getData() method.

BooleanData

142.4.3.5 public BooleanData getData() throws DeviceException

Returns the current state of BooleanControl. It's a getter method for PROPERTY_DATA property.

The current state of BooleanControl.

IllegalStateException– If this function service object has already been unregistered.

DeviceException– If an operation error is available.

BooleanData, BooleanControl.PROPERTY_DATA

142.4.3.6 public void inverse() throws DeviceException

Reverses the BooleanControl state. If the current state represents true value, it'll be changed to false. If the current state represents false value, it'll be changed to true. The operation name is OPERATION_INVERSE.

IllegalStateException– If this function service object has already been unregistered.

DeviceException– If an operation error is available.

142.4.3.7 public void setData(boolean data) throws DeviceException

The new function value.

Sets the BooleanControl state to the specified value. It's setter method for PROPERTY_DATA property.

IllegalStateException– If this function service object has already been unregistered.

DeviceException– If an operation error is available.

IllegalArgumentException– If there is an invalid argument.

BooleanControl.PROPERTY_DATA

142.4.3.8 public void setFalse() throws DeviceException

Sets the BooleanControl state to false value. The operation name is OPERATION_SET_FALSE.

IllegalStateException– If this function service object has already been unregistered.

DeviceException– If an operation error is available.

142.4.3.9 public void setTrue() throws DeviceException

Sets the BooleanControl state to true value. The operation name is OPERATION_SET_TRUE.

IllegalStateException– If this function service object has already been unregistered.

DeviceException– If an operation error is available.

142.4.4 public interface BooleanSensor
extends Function

BooleanSensor function provides boolean sensor monitoring. It reports its state when an important event is available. The eventable state is accessible with getData() getter. There are no operations.

The sensor type can be:

BooleanData

142.4.4.1 public static final String PROPERTY_DATA = "data"

Specifies the state property name. The eventable property value is accessible with getData() getter.

142.4.4.2 public BooleanData getData() throws DeviceException

Returns the BooleanSensor current state. It's a getter method for PROPERTY_DATA property.

The BooleanSensor current state.

IllegalStateException– If this function service object has already been unregistered.

DeviceException– If an operation error is available.

BooleanData

142.4.5 public interface Keypad
extends Function

Keypad function provides support for keypad control. The keypad typically consists of one or more keys/buttons, which can be discerned. Different types of key presses like short and long press can typically also be detected. Each key pressed event is followed by a key released event. It's not possible to have two consecutive key pressed or key released events. There is only one eventable property and no operations.

Keypad can enumerate all supported keys in the key property metadata, PropertyMetadata.getEnumValues(String).

KeypadData

142.4.5.1 public static final String PROPERTY_KEY = "key"

Specifies a property name for a key from the keypad. The property is eventable.

KeypadData

142.4.6 public interface Meter
extends Function

Meter function can measure metering information. The function provides these properties:

The sensor type can be:

LevelData

142.4.6.1 public static final String FLOW_IN = "in"

Represents the metering consumption flow. It can be used as SERVICE_FLOW property value.

142.4.6.2 public static final String FLOW_OUT = "out"

Represents the metering production flow. It can be used as SERVICE_FLOW property value.

142.4.6.3 public static final String PROPERTY_CURRENT = "current"

Specifies the current consumption or production property name. The eventable property can be read with getCurrent() getter.

142.4.6.4 public static final String PROPERTY_TOTAL = "total"

Specifies the total consumption or production property name. The eventable property can be read with getTotal() getter.

142.4.6.5 public static final String SERVICE_FLOW = "dal.meter.flow"

The service property value contains the metering flow. It's an optional property and available only if it's supported by the meter. The value type is java.lang.String. Possible property values:

142.4.6.6 public LevelData getCurrent() throws DeviceException

Returns the current metering info. It's a getter method for PROPERTY_CURRENT property.

The current metering info.

IllegalStateException– If this function service object has already been unregistered.

DeviceException– If an operation error is available.

LevelData

142.4.6.7 public LevelData getTotal() throws DeviceException

Returns the total metering info. It's a getter method for PROPERTY_TOTAL property.

The total metering info.

IllegalStateException– If this function service object has already been unregistered.

DeviceException– If an operation error is available.

LevelData

142.4.7 public interface MultiLevelControl
extends Function

MultiLevelControl function provides multi-level control support. The eventable function level is accessible with getData() getter and setData(BigDecimal, String) setter.

The control type can be:

LevelData

142.4.7.1 public static final String PROPERTY_DATA = "data"

Specifies the level property name. The eventable property can be read with getData() getter and can be set with setData(BigDecimal, String) setters.

142.4.7.2 public LevelData getData() throws DeviceException

Returns MultiLevelControl level. It's a getter method for PROPERTY_DATA property.

MultiLevelControl level.

IllegalStateException– If this function service object has already been unregistered.

DeviceException– If an operation error is available.

LevelData

142.4.7.3 public void setData(BigDecimal level, String unit) throws DeviceException

The new control level.

The level unit.

Sets MultiLevelControl level according to the specified unit. It's a setter method for PROPERTY_DATA property.

IllegalStateException– If this function service object has already been unregistered.

DeviceException– If an operation error is available.

IllegalArgumentException– If there is an invalid argument.

142.4.8 public interface MultiLevelSensor
extends Function

MultiLevelSensor function provides multi-level sensor monitoring. It reports its state when an important event is available. The eventable state is accessible with getData() getter. There are no operations.

The sensor type can be:

LevelData

142.4.8.1 public static final String PROPERTY_DATA = "data"

Specifies the state property name. The eventable property can be read with getData() getter.

LevelData

142.4.8.2 public LevelData getData() throws DeviceException

Returns the MultiLevelSensor current state. It's a getter method for PROPERTY_DATA property.

The MultiLevelSensor current state.

IllegalStateException– If this function service object has already been unregistered.

DeviceException– If an operation error is available.

LevelData

142.4.9 public interface Types

Shares common constants for all functions defined in this package. The defined function types are mapped as follow:

The mapping is not mandatory. The function can use custom defined types.

142.4.9.1 public static final String COLD = "cold"

The function type is applicable to:

  • Meter - indicates that the Meter measures thermal energy provided by a source.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.2 public static final String CONTACT = "contact"

The function type is applicable to:

  • BooleanSensor - indicates that the BooleanSensor can detect contact. true state means that there is contact. false state means that there is no contact.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.3 public static final String DOOR = "door"

The function type is applicable to:

  • MultiLevelControl - indicates that the MultiLevelControl can control the door position. MultiLevelControl minimum value can completely close the door. MultiLevelControl maximum value can open the door to the maximum allowed position.

  • MultiLevelSensor - indicates that the sensor can monitor the door position.

  • BooleanSensor - indicates that the BooleanSensor can detect the door state. true state means that the door is opened. false state means that the door is closed.

  • BooleanControl - indicates that there is a door position control. true state means that the door will be opened. false state means that the door will be closed.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.4 public static final String FIRE = "fire"

The function type is applicable to:

  • BooleanSensor - indicates that the BooleanSensor can detect fire. true state means that there is fire. false state means that there is no fire.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.5 public static final String FLOW = "flow"

The function type is applicable to:

  • MultiLevelControl - indicates that the MultiLevelControl can control the flow level. MultiLevelControl minimum value is the minimum supported flow level. MultiLevelControl maximum value is the maximum supported flow level.

  • MultiLevelSensor - indicates that the sensor can monitor the flow level.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.6 public static final String GAS = "gas"

The function type is applicable to:

  • MultiLevelControl - indicates that the MultiLevelControl can control the gas level. MultiLevelControl minimum value is the lowest supported gas level. MultiLevelControl maximum value is the highest supported gas level.

  • MultiLevelSensor - indicates that the sensor can monitor the gas level.

  • BooleanSensor - indicates that the BooleanSensor supports gas detection. true state means there is gas. false state means that there is no gas.

  • Meter - indicates that the Meter measures the gas consumption.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.7 public static final String HEAT = "heat"

The function type is applicable to:

  • Meter - indicates that the Meter measures thermal energy provided by a source.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.8 public static final String HUMIDITY = "humidity"

The function type is applicable to:

  • MultiLevelControl - indicates that the MultiLevelControl can control the humidity level. It's typical functionality for HVAC (heating, ventilation, and air conditioning) devices. MultiLevelControl minimum value is the lowest supported humidity level. MultiLevelControl maximum value is the highest supported humidity level.

  • MultiLevelSensor - indicates that the sensor can monitor the humidity level.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.9 public static final String LIGHT = "light"

The function type is applicable to:

  • MultiLevelControl - indicates that the MultiLevelControl can control light devices. Usually, such devices are called dimmable. MultiLevelControl minimum value can switch off the device and MultiLevelControl maximum value can increase the device light to the maximum possible value.

  • MultiLevelSensor - indicates that the sensor can monitor the light level.

  • BooleanSensor - indicates that the BooleanSensor can detected light. true state means that there is light. false state means that there is no light.

  • BooleanControl - indicates that there is a light device control. true state means that the light device will be turned on. false state means that the light device will be turned off.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.10 public static final String LIQUID = "liquid"

The function type is applicable to:

  • MultiLevelControl - indicates that the MultiLevelControl can control the liquid level. MultiLevelControl minimum value is the lowest supported liquid level. MultiLevelControl maximum value is the highest supported liquid level.

  • MultiLevelSensor - indicates that the sensor can monitor the liquid level.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.11 public static final String MOTION = "motion"

The function type is applicable to:

  • BooleanSensor - indicates that the BooleanSensor can detect motion. true state means that there is motion detection. false state means that there is no motion detection.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.12 public static final String NOISINESS = "noisiness"

The function type is applicable to:

  • MultiLevelControl - indicates that the MultiLevelControl can control the noise level. MultiLevelControl minimum value is the lowest supported noise level. MultiLevelControl maximum value is the highest supported noise level.

  • MultiLevelSensor - indicates that the sensor can monitor the noise level.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.13 public static final String OCCUPANCY = "occupancy"

The function type is applicable to:

  • BooleanSensor - indicates that the BooleanSensor can detect presence. true state means that someone is detected. false state means that nobody is detected.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.14 public static final String POWER = "power"

The function type is applicable to:

  • MultiLevelControl - indicates that the MultiLevelControl can control the power level. MultiLevelControl minimum value is the lowest supported power level. MultiLevelControl maximum value is the highest supported power level.

  • MultiLevelSensor - indicates that the sensor can monitor the power level.

  • BooleanSensor - indicates that the BooleanSensor can detect power/no power. true state means that there is power. false state means that there is no power.

  • BooleanControl - indicates that there is electricity control. true state means that the power will be restored. false state means that the power will be cut.

  • Meter - indicates that the Meter measures the power consumption.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.15 public static final String PRESSURE = "pressure"

The function type is applicable to:

  • MultiLevelControl - indicates that the MultiLevelControl can control the pressure level. MultiLevelControl minimum value is the lowest supported pressure level. MultiLevelControl maximum value is the highest supported pressure level.

  • MultiLevelSensor - indicates that the sensor can monitor the pressure level.

  • Meter - Indicates that the Meter measures pressure.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.16 public static final String RAIN = "rain"

The function type is applicable to:

  • MultiLevelSensor - indicates that the MultiLevelSensor can monitor the rain rate. It's not applicable to MultiLevelControl.

  • BooleanSensor - indicates that the BooleanSensor can detect rain. true state means that there is rain. false state means that there is no rain.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.17 public static final String SMOKE = "smoke"

The function type is applicable to:

  • MultiLevelControl - indicates that the MultiLevelControl can control the smoke level. MultiLevelControl minimum value is the lowest supported smoke level. MultiLevelControl maximum value is the highest supported smoke level.

  • MultiLevelSensor - indicates that the sensor can monitor the smoke level.

  • BooleanSensor - indicates that the BooleanSensor can detect smoke. true state means that there is smoke. false state means that there is no smoke.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.18 public static final String TEMPERATURE = "temperature"

The function type is applicable to:

  • MultiLevelControl - indicates that the MultiLevelControl can control temperature devices. For example, such device can be thermostat. MultiLevelControl minimum value is the lowest supported temperature. MultiLevelControl maximum value is the highest supported temperature.

  • MultiLevelSensor - indicates that the sensor can monitor the temperature.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.19 public static final String WATER = "water"

The function type is applicable to:

  • BooleanSensor - indicates that the BooleanSensor can detect water leak. true state means that there is water leak. false state means that there is no water leak.

  • Meter - indicates that the Meter measures water consumption.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.9.20 public static final String WINDOW = "window"

The function type is applicable to:

  • MultiLevelControl - indicates that the MultiLevelControl can control the window position. MultiLevelControl minimum value can completely close the window. MultiLevelControl maximum value can open the window to the maximum allowed position.

  • MultiLevelSensor - indicates that the sensor can monitor the window position.

  • BooleanSensor - indicates that the BooleanSensor can window state. true state means that the window is opened. false state means that the window is closed.

  • BooleanControl - indicates that there is a window position control. true state means that the window will be opened. false state means that the window will be closed.

This type can be specified as a value of org.osgi.service.dal.Function.SERVICE_TYPE.

142.4.10 public interface WakeUp
extends Function

WakeUp function provides device awake monitoring. It's especially applicable to battery-operated devices. Such device can notify the system that it's awake and can receive commands with a PROPERTY_AWAKE property event.

The device can periodically wake up for commands. The interval can be managed with PROPERTY_WAKE_UP_INTERVAL property.

LevelData, BooleanData

142.4.10.1 public static final String PROPERTY_AWAKE = "awake"

Specifies the awake property name. The property access type can be PropertyMetadata.ACCESS_EVENTABLE. If the device is awake, it will trigger a property event.

The property value type is BooleanData. The boolean data is always true. It marks that the device is awake.

142.4.10.2 public static final String PROPERTY_WAKE_UP_INTERVAL = "wakeUpInterval"

Specifies the wake up interval. The device can periodically wake up and receive commands. That interval is managed by this eventable property. The current property value is available with getWakeUpInterval() and can be modified with setWakeUpInterval(BigDecimal, String).

142.4.10.3 public LevelData getWakeUpInterval() throws DeviceException

Returns the current wake up interval. It's a getter method for PROPERTY_WAKE_UP_INTERVAL property. The device can periodically wake up and receive command based on this interval.

The interval can be measured in different units like hours, minutes, seconds, etc. The unit is specified in LevelData instance.

The current wake up interval.

IllegalStateException– If this function service object has already been unregistered.

DeviceException– If an operation error is available.

LevelData

142.4.10.4 public void setWakeUpInterval(BigDecimal interval, String unit) throws DeviceException

The new wake up interval.

The interval unit. If the unit is null, the interval is measured in milliseconds.

Sets wake up interval according to the specified unit. It's a setter method for PROPERTY_WAKE_UP_INTERVAL property. The device can periodically wake up and receive command based on this interval. The unit can be null, then the interval is measured in milliseconds.

IllegalStateException– If this function service object has already been unregistered.

DeviceException– If an operation error is available.

IllegalArgumentException– If there is an invalid argument.

142.5 org.osgi.service.dal.functions.data

Version 1.0

Device Abstraction Layer Functions Data Package 1.0.

Bundles wishing to use this package must list the package in the Import-Package header of the bundle's manifest. This package has two types of users: the consumers that use the API in this package and the providers that implement the API in this package.

Example import for consumers using the API in this package:

Import-Package: org.osgi.service.dal.functions.data; version="[1.0,2.0)"

Example import for providers implementing the API in this package:

Import-Package: org.osgi.service.dal.functions.data; version="[1.0,1.1)"

142.5.1 Summary

  • AlarmData - Function alarm data.

  • BooleanData - Function boolean data wrapper.

  • KeypadData - Represents a keypad event data that is collected when a change with some key from the keypad has occurred.

  • LevelData - Function level data wrapper.

142.5.2 public class AlarmData
extends FunctionData

Function alarm data. It cares about the alarm type, severity, timestamp and additional metadata. It doesn't support unit. The alarm type is mapped to FunctionData value.

Alarm, FunctionData

142.5.2.1 public static final String FIELD_SEVERITY = "severity"

Represents the severity field name. The field value is available with getSeverity(). The field type is int. The constant can be used as a key to AlarmData(Map) .

142.5.2.2 public static final String FIELD_TYPE = "type"

Represents the type field name. The field value is available with getType(). The field type is int. The constant can be used as a key to AlarmData(Map).

142.5.2.3 public static final int SEVERITY_CRITICAL = 3

The severity rating indicates that there a critical alarm. The severity priority is higher than SEVERITY_MINOR and SEVERITY_MAJOR.

142.5.2.4 public static final int SEVERITY_MAJOR = 2

The severity rating indicates that there is a major alarm. The severity priority is higher than SEVERITY_MINOR and lower than SEVERITY_CRITICAL.

142.5.2.5 public static final int SEVERITY_MINOR = 1

The severity rating indicates that there is a minor alarm. The severity priority is lower than SEVERITY_MAJOR and SEVERITY_CRITICAL.

142.5.2.6 public static final int SEVERITY_UNDEFINED = 0

The severity constant indicates that there is no severity rating for this alarm.

142.5.2.7 public static final int TYPE_ACCESS_CONTROL = 1

The alarm type indicates that there is access control issue. For example, the alarm can indicate that the door is unlocked.

142.5.2.8 public static final int TYPE_BURGLAR = 2

The alarm type indicates that there is a burglar notification. For example, the alarm can indicate that the glass is broken.

142.5.2.9 public static final int TYPE_COLD = 3

The alarm type indicates that temperature is too low.

142.5.2.10 public static final int TYPE_GAS_CO = 4

The alarm type indicates that carbon monoxide (CO) is detected.

142.5.2.11 public static final int TYPE_GAS_CO2 = 5

The alarm type indicates that carbon dioxide (CO2) is detected.

142.5.2.12 public static final int TYPE_HARDWARE_FAIL = 7

The alarm type indicates that there is hardware failure.

142.5.2.13 public static final int TYPE_HEAT = 6

The alarm type indicates that temperature is too high.

142.5.2.14 public static final int TYPE_POWER_FAIL = 8

The alarm type indicates a power cut.

142.5.2.15 public static final int TYPE_SMOKE = 9

The alarm type indicates that smoke is detected.

142.5.2.16 public static final int TYPE_SOFTWARE_FAIL = 10

The alarm type indicates that there is software failure.

142.5.2.17 public static final int TYPE_TAMPER = 11

The alarm type for a tamper indication.

142.5.2.18 public static final int TYPE_UNDEFINED = 0

The alarm type indicates that the type is not specified.

142.5.2.19 public static final int TYPE_WATER = 12

The alarm type indicates that a water leak is detected.

142.5.2.20 public AlarmData(Map<String, ?> fields)

Contains the new AlarmData instance field values.

Constructs new AlarmData instance with the specified field values. The map keys must match to the field names. The map values will be assigned to the appropriate class fields. For example, the maps can be: {"severity"=Integer(1)...}. That map will initialize the FIELD_SEVERITY field with 1. If severity is missing, SEVERITY_UNDEFINED is used.

  • FIELD_SEVERITY - optional field. The value type must be Integer.

  • FIELD_TYPE - optional field. The value type must be Integer.

ClassCastException– If the field value types are not expected.

IllegalArgumentException– If the alarm severity is invalid.

NullPointerException– If the fields map is null.

142.5.2.21 public AlarmData(long timestamp, Map<String, ?> metadata, int severity, int type)

The alarm data timestamp optional field.

The alarm data metadata optional field.

The alarm data severity optional field.

The alarm data type optional field.

Constructs new AlarmData instance with the specified arguments.

IllegalArgumentException– If the alarm severity is invalid.

142.5.2.22 public int compareTo(Object o)

AlarmData to be compared.

Compares this AlarmData instance with the given argument. If the argument is not AlarmData, it throws ClassCastException. Otherwise, this method returns:

  • -1 if this instance field is less than a field of the specified argument.

  • 0 if all fields are equivalent.

  • 1 if this instance field is greater than a field of the specified argument.

The fields are compared in this order: timestamp, metadata, type, severity.

-1, 0 or 1 depending on the comparison rules.

ClassCastException– If the method argument is not of type AlarmData.

java.lang.Comparable.compareTo(java.lang.Object)

142.5.2.23 public boolean equals(Object o)

The object to compare this data.

Two AlarmData instances are equal if they contain equal metadata, timestamp, type and severity.

true if this object is equivalent to the specified one.

org.osgi.service.dal.FunctionData.equals(java.lang.Object)

142.5.2.24 public int getSeverity()

Returns the alarm severity. The severity can be one of:

The alarm severity.

142.5.2.25 public int getType()

Returns the alarm type. The type can be one of the predefined:

Zero and positive values are reserved for this definition and further extensions of the alarm types. Custom types can be used only as negative values to prevent potential collisions.

The alarm type.

142.5.2.26 public int hashCode()

Returns the hash code for this AlarmData object. The hash code is a sum of FunctionData.hashCode(), the alarm severity and the alarm type.

The hash code of this AlarmData object.

org.osgi.service.dal.FunctionData.hashCode()

142.5.2.27 public String toString()

Returns the string representation of this alarm data.

The string representation of this alarm data.

142.5.3 public class BooleanData
extends FunctionData

Function boolean data wrapper. It can contain a boolean value, timestamp and additional metadata. It doesn't support measurement unit.

BooleanControl, BooleanSensor, FunctionData

142.5.3.1 public static final String FIELD_VALUE = "value"

Represents the value field name. The field value is available with getValue(). The field type is boolean . The constant can be used as a key to BooleanData(Map).

142.5.3.2 public BooleanData(Map<String, ?> fields)

Contains the new BooleanData instance field values.

Constructs new BooleanData instance with the specified field values. The map keys must match to the field names. The map values will be assigned to the appropriate class fields. For example, the maps can be: {"value"=Boolean(true)...}. That map will initialize the FIELD_VALUE field with true.

FIELD_VALUE - mandatory field. The value type must be Boolean.

ClassCastException– If the field value types are not expected.

IllegalArgumentException– If the value is missing.

NullPointerException– If the fields map is null.

142.5.3.3 public BooleanData(long timestamp, Map<String, ?> metadata, boolean value)

The boolean data timestamp optional field.

The boolean data metadata optional field.

The boolean value mandatory field.

Constructs new BooleanData instance with the specified arguments.

142.5.3.4 public int compareTo(Object o)

BooleanData to be compared.

Compares this BooleanData instance with the given argument. If the argument is not BooleanData, it throws ClassCastException. Otherwise, this method returns:

  • -1 if this instance field is less than a field of the specified argument.

  • 0 if all fields are equivalent.

  • 1 if this instance field is greater than a field of the specified argument.

The fields are compared in this order: timestamp, metadata, value.

-1, 0 or 1 depending on the comparison rules.

ClassCastException– If the method argument is not of type BooleanData.

java.lang.Comparable.compareTo(java.lang.Object)

142.5.3.5 public boolean equals(Object o)

The object to compare this data.

Two BooleanData instances are equal if they contain equal metadata, timestamp and boolean value.

true if this object is equivalent to the specified one.

org.osgi.service.dal.FunctionData.equals(java.lang.Object)

142.5.3.6 public boolean getValue()

Returns BooleanData value.

BooleanData value.

142.5.3.7 public int hashCode()

Returns the hash code for this BooleanData object. The hash code is a sum of FunctionData.hashCode() and Boolean.hashCode(), where Boolean.hashCode() represents the boolean value hash code.

The hash code of this BooleanData object.

org.osgi.service.dal.FunctionData.hashCode()

142.5.3.8 public String toString()

Returns the string representation of this boolean data.

The string representation of this boolean data.

142.5.4 public class KeypadData
extends FunctionData

Represents a keypad event data that is collected when a change with some key from the keypad has occurred.

The key pressed event is using TYPE_PRESSED type, while the key released event is using TYPE_RELEASED type.

Keypad, FunctionData

142.5.4.1 public static final String FIELD_KEY_CODE = "keyCode"

Represents the key code field name. The field value is available with getKeyCode(). The field type is int . The constant can be used as a key to KeypadData(Map).

142.5.4.2 public static final String FIELD_KEY_NAME = "keyName"

Represents the key name field name. The field value is available with getKeyName(). The field type is String. The constant can be used as a key to KeypadData(Map).

142.5.4.3 public static final String FIELD_SUB_TYPE = "subType"

Represents the event sub-type field name. The field value is available with getSubType(). The field type is int. The constant can be used as a key to KeypadData(Map).

142.5.4.4 public static final String FIELD_TYPE = "type"

Represents the event type field name. The field value is available with getType(). The field type is int. The constant can be used as a key to KeypadData(Map).

142.5.4.5 public static final int SUB_TYPE_PRESSED_DOUBLE = 3

Represents a keypad event sub-type for a double key pressed event. Usually, there are two press actions and the key is not held down after the second press. This sub-type is used with TYPE_PRESSED type.

142.5.4.6 public static final int SUB_TYPE_PRESSED_DOUBLE_LONG = 4

Represents a keypad event sub-type for a double long key pressed event. Usually, there are two press actions and the key is held down after the second press. This sub-type is used with TYPE_PRESSED type.

142.5.4.7 public static final int SUB_TYPE_PRESSED_LONG = 2

Represents a keypad event sub-type for a long key pressed event. Usually, there is a single press and the key is held down. This sub-type is used with TYPE_PRESSED type.

142.5.4.8 public static final int SUB_TYPE_PRESSED_NORMAL = 1

Represents a keypad event sub-type for a normal key pressed event. Usually, there is a single press and the key is not held down. This sub-type is used with TYPE_PRESSED type.

142.5.4.9 public static final int TYPE_PRESSED = 0

Represents a keypad event type for a key pressed event.

142.5.4.10 public static final int TYPE_RELEASED = 1

Represents a keypad event type for a key released event.

142.5.4.11 public KeypadData(Map<String, ?> fields)

Contains the new KeypadData instance field values.

Constructs new KeypadData instance with the specified field values. The map keys must match to the field names. The map values will be assigned to the appropriate class fields. For example, the maps can be: {"type"=Integer(1)...}. That map will initialize the FIELD_TYPE field with 1.

ClassCastException– If the field value types are not expected.

IllegalArgumentException– If the event type or key code is missing or invalid arguments are specified.

NullPointerException– If the fields map is null.

142.5.4.12 public KeypadData(long timestamp, Map<String, Object> metadata, int type, int subType, int keyCode, String keyName)

The data timestamp optional field.

The data metadata optional field.

The data event type mandatory field.

The data event sub-type optional field or 0 if there is no sub-type.

The data key code mandatory field.

The data key name optional field or null if there is no key name.

Constructs new KeypadData instance with the specified arguments.

142.5.4.13 public int compareTo(Object o)

KeypadData to be compared.

Compares this KeypadData instance with the given argument. If the argument is not KeypadData, it throws ClassCastException. Otherwise, this method returns:

  • -1 if this instance field is less than a field of the specified argument.

  • 0 if all fields are equivalent.

  • 1 if this instance field is greater than a field of the specified argument.

The fields are compared in this order: timestamp, metadata, type, sub-type, key code, key name.

-1, 0 or 1 depending on the comparison rules.

ClassCastException– If the method argument is not of type KeypadData.

java.lang.Comparable.compareTo(java.lang.Object)

142.5.4.14 public boolean equals(Object o)

The object to compare this data.

Two KeypadData instances are equal if they contain equal metadata, timestamp, event type, key code and key name.

true if this object is equivalent to the specified one.

org.osgi.service.dal.FunctionData.equals(java.lang.Object)

142.5.4.15 public int getKeyCode()

The code of the key. This field is mandatory and it holds the semantics(meaning) of the key.

The key code.

142.5.4.16 public String getKeyName()

Represents a human readable name of the corresponding key code. This field is optional and sometimes it could be missed(might be null ).

A string with the name of the key or null if not specified.

142.5.4.17 public int getSubType()

Returns the event sub-type. The sub-type provides additional details about the event. The sub-type can be one of:

Zero and positive values are reserved for this definition and further extensions of the sub-types. Custom sub-types can be used only as negative values to prevent potential collisions.

The event sub-type.

142.5.4.18 public int getType()

Returns the event type. The type represents the main reason for this event. It can be one of:

The event type.

142.5.4.19 public int hashCode()

Returns the hash code for this KeypadData object. The hash code is a sum of FunctionData.hashCode(), String.hashCode(), event type, event sub-type and key code, where String.hashCode() represents the key name hash code if available.

The hash code of this LevelData object.

org.osgi.service.dal.FunctionData.hashCode()

142.5.4.20 public String toString()

Returns the string representation of this keypad data.

The string representation of this keypad data.

142.5.5 public class LevelData
extends FunctionData

Function level data wrapper. It supports all properties defined in FunctionData.

MultiLevelControl, MultiLevelSensor, Meter, FunctionData

142.5.5.1 public static final String FIELD_LEVEL = "level"

Represents the level field name. The field value is available with getLevel(). The field type is BigDecimal. The constant can be used as a key to LevelData(Map).

142.5.5.2 public static final String FIELD_UNIT = "unit"

Represents the unit field name. The field value is available with getUnit(). The field type is String. The constant can be used as a key to LevelData(Map).

142.5.5.3 public LevelData(Map<String, ?> fields)

Contains the new LevelData instance field values.

Constructs new LevelData instance with the specified field values. The map keys must match to the field names. The map values will be assigned to the appropriate class fields. For example, the maps can be: {"level"=BigDecimal(1)...}. That map will initialize the FIELD_LEVEL field with 1.

  • FIELD_LEVEL - mandatory field. The value type must be BigDecimal.

  • FIELD_UNIT - optional field. The value type must be String.

ClassCastException– If the field value types are not expected.

IllegalArgumentException– If the level is missing.

NullPointerException– If the fields map is null.

142.5.5.4 public LevelData(long timestamp, Map<String, Object> metadata, BigDecimal level, String unit)

The data timestamp optional field.

The data metadata optional field.

The level value mandatory field.

The data unit optional field.

Constructs new LevelData instance with the specified arguments.

NullPointerException– If level is null.

142.5.5.5 public int compareTo(Object o)

LevelData to be compared.

Compares this LevelData instance with the given argument. If the argument is not LevelData, it throws ClassCastException. Otherwise, this method returns:

  • -1 if this instance field is less than a field of the specified argument.

  • 0 if all fields are equivalent.

  • 1 if this instance field is greater than a field of the specified argument.

The fields are compared in this order: timestamp, metadata, level, unit.

-1, 0 or 1 depending on the comparison rules.

ClassCastException– If the method argument is not of type LevelData.

java.lang.Comparable.compareTo(java.lang.Object)

142.5.5.6 public boolean equals(Object o)

The object to compare this data.

Two LevelData instances are equal if they contain equal metadata, timestamp, unit and level.

true if this object is equivalent to the specified one.

org.osgi.service.dal.FunctionData.equals(java.lang.Object)

142.5.5.7 public BigDecimal getLevel()

Returns LevelData value. The value type is BigDecimal instead of double to guarantee value accuracy.

The LevelData value.

142.5.5.8 public String getUnit()

Returns LevelData unit as it's specified in PropertyMetadata.UNITS or null if the unit is missing.

The value unit or null if the unit is missing.

142.5.5.9 public int hashCode()

Returns the hash code for this LevelData object. The hash code is a sum of FunctionData.hashCode(), String.hashCode() and BigDecimal.hashCode(), where String.hashCode() represents the unit hash code and BigDecimal.hashCode() represents the level hash code.

The hash code of this LevelData object.

org.osgi.service.dal.FunctionData.hashCode()

142.5.5.10 public String toString()

Returns the string representation of this level data.

The string representation of this level data.