Top Description Fields Methods
org.osgi.service.dal.functions

public Interface WakeUp

extends Function
Imports
java.math.BigDecimal, org.osgi.service.dal.DeviceException, .Function, .PropertyMetadata, org.osgi.service.dal.functions.data.BooleanData, .LevelData

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.

See Also
LevelData, BooleanData

Field Summary

Modifier and TypeField and Description
public static final String
PROPERTY_AWAKE

Specifies the awake property name.

public static final String
PROPERTY_WAKE_UP_INTERVAL

Specifies the wake up interval.

Inherited from org.osgi.service.dal.Function:
SERVICE_DESCRIPTIONSERVICE_DEVICE_UIDSERVICE_OPERATION_NAMESSERVICE_PROPERTY_NAMESSERVICE_REFERENCE_UIDSSERVICE_TYPESERVICE_UIDSERVICE_VERSION

Method Summary

Modifier and TypeMethod and Description
public LevelData

Returns:

The current wake up interval.
getWakeUpInterval
()

Returns the current wake up interval.

public void
setWakeUpInterval(BigDecimal
The new wake up interval.
interval
,
String
The interval unit. If the unit is null, the interval is measured in milliseconds.
unit
)

Sets wake up interval according to the specified unit.

Inherited from org.osgi.service.dal.Function:
getOperationMetadatagetPropertyMetadatagetServicePropertygetServicePropertyKeys

Field Detail

PROPERTY_AWAKEback to summary
public static final String PROPERTY_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.

PROPERTY_WAKE_UP_INTERVALback to summary
public static final String PROPERTY_WAKE_UP_INTERVAL

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).

Method Detail

getWakeUpIntervalback to summary
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.

Returns:LevelData

The current wake up interval.

Exceptions
DeviceException:
If an operation error is available.
IllegalStateException:
If this function service object has already been unregistered.
See Also
LevelData
setWakeUpIntervalback to summary
public void setWakeUpInterval(BigDecimal interval, String unit) throws DeviceException

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.

Parameters
interval:BigDecimal

The new wake up interval.

unit:String

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

Exceptions
DeviceException:
If an operation error is available.
IllegalStateException:
If this function service object has already been unregistered.
IllegalArgumentException:
If there is an invalid argument.