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 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 Detail

      • PROPERTY_AWAKE

        static final java.lang.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.

        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 with getWakeUpInterval() and can be modified with setWakeUpInterval(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 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:
        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 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 - The new wake up interval.
        unit - The interval unit. If the unit is null, 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.