public class YWakeUpMonitor extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YWakeUpMonitor.TimedReportCallback
TimedReportCallback for WakeUpMonitor
|
static interface |
YWakeUpMonitor.UpdateCallback
Deprecated UpdateCallback for WakeUpMonitor
|
Modifier and Type | Field and Description |
---|---|
static int |
_endOfTime |
protected long |
_nextWakeUp |
protected int |
_powerDuration |
protected long |
_rtcTime |
protected int |
_sleepCountdown |
protected YWakeUpMonitor.UpdateCallback |
_valueCallbackWakeUpMonitor |
protected int |
_wakeUpReason |
protected int |
_wakeUpState |
static long |
NEXTWAKEUP_INVALID
invalid nextWakeUp value
|
static int |
POWERDURATION_INVALID
invalid powerDuration value
|
static long |
RTCTIME_INVALID
invalid rtcTime value
|
static int |
SLEEPCOUNTDOWN_INVALID
invalid sleepCountdown value
|
static int |
WAKEUPREASON_ENDOFSLEEP |
static int |
WAKEUPREASON_EXTPOWER |
static int |
WAKEUPREASON_EXTSIG1 |
static int |
WAKEUPREASON_INVALID |
static int |
WAKEUPREASON_SCHEDULE1 |
static int |
WAKEUPREASON_SCHEDULE2 |
static int |
WAKEUPREASON_USBPOWER
invalid wakeUpReason value
|
static int |
WAKEUPSTATE_AWAKE |
static int |
WAKEUPSTATE_INVALID |
static int |
WAKEUPSTATE_SLEEPING
invalid wakeUpState value
|
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, _yapi, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YWakeUpMonitor(String func) |
protected |
YWakeUpMonitor(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YWakeUpMonitor |
FindWakeUpMonitor(String func)
Retrieves a monitor for a given identifier.
|
static YWakeUpMonitor |
FindWakeUpMonitorInContext(YAPIContext yctx,
String func)
Retrieves a monitor for a given identifier in a YAPI context.
|
static YWakeUpMonitor |
FirstWakeUpMonitor()
Starts the enumeration of monitors currently accessible.
|
static YWakeUpMonitor |
FirstWakeUpMonitorInContext(YAPIContext yctx)
Starts the enumeration of monitors currently accessible.
|
long |
get_nextWakeUp()
Returns the next scheduled wake up date/time (UNIX format).
|
int |
get_powerDuration()
Returns the maximal wake up time (in seconds) before automatically going to sleep.
|
long |
get_rtcTime() |
int |
get_sleepCountdown()
Returns the delay before the next sleep period.
|
int |
get_wakeUpReason()
Returns the latest wake up reason.
|
int |
get_wakeUpState()
Returns the current state of the monitor.
|
long |
getNextWakeUp()
Returns the next scheduled wake up date/time (UNIX format).
|
int |
getPowerDuration()
Returns the maximal wake up time (in seconds) before automatically going to sleep.
|
int |
getSleepCountdown()
Returns the delay before the next sleep period.
|
int |
getWakeUpReason()
Returns the latest wake up reason.
|
int |
getWakeUpState()
Returns the current state of the monitor.
|
YWakeUpMonitor |
nextWakeUpMonitor()
Continues the enumeration of monitors started using yFirstWakeUpMonitor().
|
int |
registerValueCallback(YWakeUpMonitor.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
resetSleepCountDown()
Resets the sleep countdown.
|
int |
set_nextWakeUp(long newval)
Changes the days of the week when a wake up must take place.
|
int |
set_powerDuration(int newval)
Changes the maximal wake up time (seconds) before automatically going to sleep.
|
int |
set_sleepCountdown(int newval)
Changes the delay before the next sleep period.
|
int |
set_wakeUpState(int newval) |
int |
setNextWakeUp(long newval)
Changes the days of the week when a wake up must take place.
|
int |
setPowerDuration(int newval)
Changes the maximal wake up time (seconds) before automatically going to sleep.
|
int |
setSleepCountdown(int newval)
Changes the delay before the next sleep period.
|
int |
sleep(int secBeforeSleep)
Goes to sleep until the next wake up condition is met, the
RTC time must have been set before calling this function.
|
int |
sleepFor(int secUntilWakeUp,
int secBeforeSleep)
Goes to sleep for a specific duration or until the next wake up condition is met, the
RTC time must have been set before calling this function.
|
int |
sleepUntil(int wakeUpTime,
int secBeforeSleep)
Go to sleep until a specific date is reached or until the next wake up condition is met, the
RTC time must have been set before calling this function.
|
int |
wakeUp()
Forces a wake up.
|
_AddToCache, _clearDataStreamCache, _devRequest, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, clearCache, describe, errMessage, errorMessage, errorType, errType, FindFunction, FindFunctionInContext, FirstFunction, FirstFunctionInContext, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userData
public static final int POWERDURATION_INVALID
public static final int SLEEPCOUNTDOWN_INVALID
public static final long NEXTWAKEUP_INVALID
public static final int WAKEUPREASON_USBPOWER
public static final int WAKEUPREASON_EXTPOWER
public static final int WAKEUPREASON_ENDOFSLEEP
public static final int WAKEUPREASON_EXTSIG1
public static final int WAKEUPREASON_SCHEDULE1
public static final int WAKEUPREASON_SCHEDULE2
public static final int WAKEUPREASON_INVALID
public static final int WAKEUPSTATE_SLEEPING
public static final int WAKEUPSTATE_AWAKE
public static final int WAKEUPSTATE_INVALID
public static final long RTCTIME_INVALID
protected int _powerDuration
protected int _sleepCountdown
protected long _nextWakeUp
protected int _wakeUpReason
protected int _wakeUpState
protected long _rtcTime
public static final int _endOfTime
protected YWakeUpMonitor.UpdateCallback _valueCallbackWakeUpMonitor
protected YWakeUpMonitor(YAPIContext ctx, String func)
func
- : functionidprotected YWakeUpMonitor(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YFunction
Exception
public int get_powerDuration() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getPowerDuration() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_powerDuration(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the maximal wake up time (seconds) before automatically
going to sleepYAPI_Exception
- on errorpublic int setPowerDuration(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the maximal wake up time (seconds) before automatically
going to sleepYAPI_Exception
- on errorpublic int get_sleepCountdown() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getSleepCountdown() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_sleepCountdown(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the delay before the next sleep periodYAPI_Exception
- on errorpublic int setSleepCountdown(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the delay before the next sleep periodYAPI_Exception
- on errorpublic long get_nextWakeUp() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getNextWakeUp() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_nextWakeUp(long newval) throws YAPI_Exception
newval
- : an integer corresponding to the days of the week when a wake up must take placeYAPI_Exception
- on errorpublic int setNextWakeUp(long newval) throws YAPI_Exception
newval
- : an integer corresponding to the days of the week when a wake up must take placeYAPI_Exception
- on errorpublic int get_wakeUpReason() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getWakeUpReason() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_wakeUpState() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getWakeUpState() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_wakeUpState(int newval) throws YAPI_Exception
YAPI_Exception
public long get_rtcTime() throws YAPI_Exception
YAPI_Exception
public static YWakeUpMonitor FindWakeUpMonitor(String func)
func
- : a string that uniquely characterizes the monitorpublic static YWakeUpMonitor FindWakeUpMonitorInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the monitorpublic int registerValueCallback(YWakeUpMonitor.UpdateCallback callback)
callback
- : the callback function to call, or a null pointer. The callback function should take two
arguments: the function object of which the value has changed, and the character string describing
the new advertised value.public int _invokeValueCallback(String value)
_invokeValueCallback
in class YFunction
public int wakeUp() throws YAPI_Exception
YAPI_Exception
public int sleep(int secBeforeSleep) throws YAPI_Exception
secBeforeSleep
- : number of seconds before going into sleep mode,YAPI_Exception
- on errorpublic int sleepFor(int secUntilWakeUp, int secBeforeSleep) throws YAPI_Exception
secUntilWakeUp
- : number of seconds before next wake upsecBeforeSleep
- : number of seconds before going into sleep modeYAPI_Exception
- on errorpublic int sleepUntil(int wakeUpTime, int secBeforeSleep) throws YAPI_Exception
wakeUpTime
- : wake-up datetime (UNIX format)secBeforeSleep
- : number of seconds before going into sleep modeYAPI_Exception
- on errorpublic int resetSleepCountDown() throws YAPI_Exception
YAPI_Exception
- on errorpublic YWakeUpMonitor nextWakeUpMonitor()
public static YWakeUpMonitor FirstWakeUpMonitor()
public static YWakeUpMonitor FirstWakeUpMonitorInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2017. All rights reserved.