Package org.osgi.service.dal.functions
Interface WakeUp
- All Superinterfaces:
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.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Specifies the awake property name.static final String
Specifies the wake up interval.Fields inherited from interface org.osgi.service.dal.Function
SERVICE_DESCRIPTION, SERVICE_DEVICE_UID, SERVICE_OPERATION_NAMES, SERVICE_PROPERTY_NAMES, SERVICE_REFERENCE_UIDS, SERVICE_TYPE, SERVICE_UID, SERVICE_VERSION
-
Method Summary
Modifier and TypeMethodDescriptionReturns the current wake up interval.void
setWakeUpInterval
(BigDecimal interval, String unit) Sets wake up interval according to the specified unit.Methods inherited from interface org.osgi.service.dal.Function
getOperationMetadata, getPropertyMetadata, getServiceProperty, getServicePropertyKeys
-
Field Details
-
PROPERTY_AWAKE
Specifies the awake property name. The property access type can bePropertyMetadata.ACCESS_EVENTABLE
. If the device is awake, it will trigger a property event.The property value type is
BooleanData
. The boolean data is alwaystrue
. It marks that the device is awake.- See Also:
-
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 withgetWakeUpInterval()
and can be modified withsetWakeUpInterval(BigDecimal, String)
.- See Also:
-
-
Method Details
-
getWakeUpInterval
Returns the current wake up interval. It's a getter method forPROPERTY_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:
- The current wake up interval.
- Throws:
IllegalStateException
- If this function service object has already been unregistered.DeviceException
- If an operation error is available.- See Also:
-
setWakeUpInterval
Sets wake up interval according to the specified unit. It's a setter method forPROPERTY_WAKE_UP_INTERVAL
property. The device can periodically wake up and receive command based on this interval. The unit can benull
, then the interval is measured in milliseconds.- Parameters:
interval
- The new wake up interval.unit
- The interval unit. If the unit isnull
, the interval is measured in milliseconds.- Throws:
IllegalStateException
- If this function service object has already been unregistered.DeviceException
- If an operation error is available.IllegalArgumentException
- If there is an invalid argument.
-