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
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_AWAKE
Specifies the awake property name.
|
static String |
PROPERTY_WAKE_UP_INTERVAL
Specifies the wake up interval.
|
SERVICE_DESCRIPTION, SERVICE_DEVICE_UID, SERVICE_OPERATION_NAMES, SERVICE_PROPERTY_NAMES, SERVICE_REFERENCE_UIDS, SERVICE_TYPE, SERVICE_UID, SERVICE_VERSION
Modifier and Type | Method and Description |
---|---|
LevelData |
getWakeUpInterval()
Returns the current wake up interval.
|
void |
setWakeUpInterval(BigDecimal interval,
String unit)
Sets wake up interval according to the specified unit.
|
getOperationMetadata, getPropertyMetadata, getServiceProperty, getServicePropertyKeys
static final String PROPERTY_AWAKE
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.
static final String PROPERTY_WAKE_UP_INTERVAL
getWakeUpInterval()
and can be modified with setWakeUpInterval(BigDecimal, String)
.LevelData getWakeUpInterval() throws DeviceException
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.
IllegalStateException
- If this function service object has already
been unregistered.DeviceException
- If an operation error is available.LevelData
void setWakeUpInterval(BigDecimal interval, String unit) throws DeviceException
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.interval
- The new wake up interval.unit
- The interval unit. If the unit is null
, 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.Copyright © Contributors to the Eclipse Foundation Licensed under the Eclipse Foundation Specification License – v1.0