Package org.osgi.service.dal.functions
Interface WakeUp
-
- All Superinterfaces:
Function
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 aPROPERTY_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
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_AWAKE
Specifies the awake property name.static java.lang.String
PROPERTY_WAKE_UP_INTERVAL
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LevelData
getWakeUpInterval()
Returns the current wake up interval.void
setWakeUpInterval(java.math.BigDecimal interval, java.lang.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 Detail
-
PROPERTY_AWAKE
static final java.lang.String 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:
- Constant Field Values
-
PROPERTY_WAKE_UP_INTERVAL
static final java.lang.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 withgetWakeUpInterval()
and can be modified withsetWakeUpInterval(BigDecimal, String)
.- See Also:
- Constant Field Values
-
-
Method Detail
-
getWakeUpInterval
LevelData getWakeUpInterval() throws DeviceException
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:
java.lang.IllegalStateException
- If this function service object has already been unregistered.DeviceException
- If an operation error is available.- See Also:
LevelData
-
setWakeUpInterval
void setWakeUpInterval(java.math.BigDecimal interval, java.lang.String unit) throws DeviceException
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:
java.lang.IllegalStateException
- If this function service object has already been unregistered.DeviceException
- If an operation error is available.java.lang.IllegalArgumentException
- If there is an invalid argument.
-
-