public class YWatchdog extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YWatchdog.TimedReportCallback
TimedReportCallback for Watchdog
|
static interface |
YWatchdog.UpdateCallback
Deprecated UpdateCallback for Watchdog
|
static class |
YWatchdog.YDelayedPulse |
Modifier and Type | Field and Description |
---|---|
protected int |
_autoStart |
protected long |
_countdown |
protected YWatchdog.YDelayedPulse |
_delayedPulseTimer |
protected long |
_maxTimeOnStateA |
protected long |
_maxTimeOnStateB |
protected int |
_output |
protected long |
_pulseTimer |
protected int |
_running |
protected int |
_state |
protected int |
_stateAtPowerOn |
protected long |
_triggerDelay |
protected long |
_triggerDuration |
protected YWatchdog.UpdateCallback |
_valueCallbackWatchdog |
static int |
AUTOSTART_INVALID |
static int |
AUTOSTART_OFF
invalid autoStart value
|
static int |
AUTOSTART_ON |
static long |
COUNTDOWN_INVALID
invalid countdown value
|
static YWatchdog.YDelayedPulse |
DELAYEDPULSETIMER_INVALID |
static long |
MAXTIMEONSTATEA_INVALID
invalid maxTimeOnStateA value
|
static long |
MAXTIMEONSTATEB_INVALID
invalid maxTimeOnStateB value
|
static int |
OUTPUT_INVALID |
static int |
OUTPUT_OFF
invalid output value
|
static int |
OUTPUT_ON |
static long |
PULSETIMER_INVALID
invalid pulseTimer value
|
static int |
RUNNING_INVALID |
static int |
RUNNING_OFF
invalid running value
|
static int |
RUNNING_ON |
static int |
STATE_A
invalid state value
|
static int |
STATE_B |
static int |
STATE_INVALID |
static int |
STATEATPOWERON_A |
static int |
STATEATPOWERON_B |
static int |
STATEATPOWERON_INVALID |
static int |
STATEATPOWERON_UNCHANGED
invalid stateAtPowerOn value
|
static long |
TRIGGERDELAY_INVALID
invalid triggerDelay value
|
static long |
TRIGGERDURATION_INVALID
invalid triggerDuration 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 |
YWatchdog(String func) |
protected |
YWatchdog(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
int |
delayedPulse(int ms_delay,
int ms_duration)
Schedules a pulse.
|
static YWatchdog |
FindWatchdog(String func)
Retrieves a watchdog for a given identifier.
|
static YWatchdog |
FindWatchdogInContext(YAPIContext yctx,
String func)
Retrieves a watchdog for a given identifier in a YAPI context.
|
static YWatchdog |
FirstWatchdog()
Starts the enumeration of watchdog currently accessible.
|
static YWatchdog |
FirstWatchdogInContext(YAPIContext yctx)
Starts the enumeration of watchdog currently accessible.
|
int |
get_autoStart()
Returns the watchdog runing state at module power on.
|
long |
get_countdown()
Returns the number of milliseconds remaining before a pulse (delayedPulse() call)
When there is no scheduled pulse, returns zero.
|
YWatchdog.YDelayedPulse |
get_delayedPulseTimer() |
long |
get_maxTimeOnStateA()
Retourne the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state A before automatically
switching back in to B state.
|
long |
get_maxTimeOnStateB()
Retourne the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state B before automatically
switching back in to A state.
|
int |
get_output()
Returns the output state of the watchdog, when used as a simple switch (single throw).
|
long |
get_pulseTimer()
Returns the number of milliseconds remaining before the watchdog is returned to idle position
(state A), during a measured pulse generation.
|
int |
get_running()
Returns the watchdog running state.
|
int |
get_state()
Returns the state of the watchdog (A for the idle position, B for the active position).
|
int |
get_stateAtPowerOn()
Returns the state of the watchdog at device startup (A for the idle position, B for the active
position, UNCHANGED for no change).
|
long |
get_triggerDelay()
Returns the waiting duration before a reset is automatically triggered by the watchdog, in milliseconds.
|
long |
get_triggerDuration()
Returns the duration of resets caused by the watchdog, in milliseconds.
|
int |
getAutoStart()
Returns the watchdog runing state at module power on.
|
long |
getCountdown()
Returns the number of milliseconds remaining before a pulse (delayedPulse() call)
When there is no scheduled pulse, returns zero.
|
long |
getMaxTimeOnStateA()
Retourne the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state A before automatically
switching back in to B state.
|
long |
getMaxTimeOnStateB()
Retourne the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state B before automatically
switching back in to A state.
|
int |
getOutput()
Returns the output state of the watchdog, when used as a simple switch (single throw).
|
long |
getPulseTimer()
Returns the number of milliseconds remaining before the watchdog is returned to idle position
(state A), during a measured pulse generation.
|
int |
getRunning()
Returns the watchdog running state.
|
int |
getState()
Returns the state of the watchdog (A for the idle position, B for the active position).
|
int |
getStateAtPowerOn()
Returns the state of the watchdog at device startup (A for the idle position, B for the active
position, UNCHANGED for no change).
|
long |
getTriggerDelay()
Returns the waiting duration before a reset is automatically triggered by the watchdog, in milliseconds.
|
long |
getTriggerDuration()
Returns the duration of resets caused by the watchdog, in milliseconds.
|
YWatchdog |
nextWatchdog()
Continues the enumeration of watchdog started using yFirstWatchdog().
|
int |
pulse(int ms_duration)
Sets the relay to output B (active) for a specified duration, then brings it
automatically back to output A (idle state).
|
int |
registerValueCallback(YWatchdog.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
resetWatchdog()
Resets the watchdog.
|
int |
set_autoStart(int newval)
Changes the watchdog runningsttae at module power on.
|
int |
set_delayedPulseTimer(YWatchdog.YDelayedPulse newval) |
int |
set_maxTimeOnStateA(long newval)
Sets the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state A before automatically
switching back in to B state.
|
int |
set_maxTimeOnStateB(long newval)
Sets the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state B before automatically
switching back in to A state.
|
int |
set_output(int newval)
Changes the output state of the watchdog, when used as a simple switch (single throw).
|
int |
set_pulseTimer(long newval) |
int |
set_running(int newval)
Changes the running state of the watchdog.
|
int |
set_state(int newval)
Changes the state of the watchdog (A for the idle position, B for the active position).
|
int |
set_stateAtPowerOn(int newval)
Preset the state of the watchdog at device startup (A for the idle position,
B for the active position, UNCHANGED for no modification).
|
int |
set_triggerDelay(long newval)
Changes the waiting delay before a reset is triggered by the watchdog, in milliseconds.
|
int |
set_triggerDuration(long newval)
Changes the duration of resets caused by the watchdog, in milliseconds.
|
int |
setAutoStart(int newval)
Changes the watchdog runningsttae at module power on.
|
int |
setMaxTimeOnStateA(long newval)
Sets the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state A before automatically
switching back in to B state.
|
int |
setMaxTimeOnStateB(long newval)
Sets the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state B before automatically
switching back in to A state.
|
int |
setOutput(int newval)
Changes the output state of the watchdog, when used as a simple switch (single throw).
|
int |
setRunning(int newval)
Changes the running state of the watchdog.
|
int |
setState(int newval)
Changes the state of the watchdog (A for the idle position, B for the active position).
|
int |
setStateAtPowerOn(int newval)
Preset the state of the watchdog at device startup (A for the idle position,
B for the active position, UNCHANGED for no modification).
|
int |
setTriggerDelay(long newval)
Changes the waiting delay before a reset is triggered by the watchdog, in milliseconds.
|
int |
setTriggerDuration(long newval)
Changes the duration of resets caused by the watchdog, in milliseconds.
|
_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 STATE_A
public static final int STATE_B
public static final int STATE_INVALID
public static final int STATEATPOWERON_UNCHANGED
public static final int STATEATPOWERON_A
public static final int STATEATPOWERON_B
public static final int STATEATPOWERON_INVALID
public static final long MAXTIMEONSTATEA_INVALID
public static final long MAXTIMEONSTATEB_INVALID
public static final int OUTPUT_OFF
public static final int OUTPUT_ON
public static final int OUTPUT_INVALID
public static final long PULSETIMER_INVALID
public static final long COUNTDOWN_INVALID
public static final int AUTOSTART_OFF
public static final int AUTOSTART_ON
public static final int AUTOSTART_INVALID
public static final int RUNNING_OFF
public static final int RUNNING_ON
public static final int RUNNING_INVALID
public static final long TRIGGERDELAY_INVALID
public static final long TRIGGERDURATION_INVALID
public static final YWatchdog.YDelayedPulse DELAYEDPULSETIMER_INVALID
protected int _state
protected int _stateAtPowerOn
protected long _maxTimeOnStateA
protected long _maxTimeOnStateB
protected int _output
protected long _pulseTimer
protected YWatchdog.YDelayedPulse _delayedPulseTimer
protected long _countdown
protected int _autoStart
protected int _running
protected long _triggerDelay
protected long _triggerDuration
protected YWatchdog.UpdateCallback _valueCallbackWatchdog
protected YWatchdog(YAPIContext ctx, String func)
func
- : functionidprotected YWatchdog(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YFunction
Exception
public int get_state() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getState() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_state(int newval) throws YAPI_Exception
newval
- : either YWatchdog.STATE_A or YWatchdog.STATE_B, according to the state of the
watchdog (A for the idle position, B for the active position)YAPI_Exception
- on errorpublic int setState(int newval) throws YAPI_Exception
newval
- : either Y_STATE_A or Y_STATE_B, according to the state of the watchdog (A for the
idle position, B for the active position)YAPI_Exception
- on errorpublic int get_stateAtPowerOn() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getStateAtPowerOn() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_stateAtPowerOn(int newval) throws YAPI_Exception
newval
- : a value among YWatchdog.STATEATPOWERON_UNCHANGED, YWatchdog.STATEATPOWERON_A and
YWatchdog.STATEATPOWERON_BYAPI_Exception
- on errorpublic int setStateAtPowerOn(int newval) throws YAPI_Exception
newval
- : a value among Y_STATEATPOWERON_UNCHANGED, Y_STATEATPOWERON_A and Y_STATEATPOWERON_BYAPI_Exception
- on errorpublic long get_maxTimeOnStateA() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getMaxTimeOnStateA() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_maxTimeOnStateA(long newval) throws YAPI_Exception
newval
- : an integerYAPI_Exception
- on errorpublic int setMaxTimeOnStateA(long newval) throws YAPI_Exception
newval
- : an integerYAPI_Exception
- on errorpublic long get_maxTimeOnStateB() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getMaxTimeOnStateB() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_maxTimeOnStateB(long newval) throws YAPI_Exception
newval
- : an integerYAPI_Exception
- on errorpublic int setMaxTimeOnStateB(long newval) throws YAPI_Exception
newval
- : an integerYAPI_Exception
- on errorpublic int get_output() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getOutput() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_output(int newval) throws YAPI_Exception
newval
- : either YWatchdog.OUTPUT_OFF or YWatchdog.OUTPUT_ON, according to the output state
of the watchdog, when used as a simple switch (single throw)YAPI_Exception
- on errorpublic int setOutput(int newval) throws YAPI_Exception
newval
- : either Y_OUTPUT_OFF or Y_OUTPUT_ON, according to the output state of the watchdog,
when used as a simple switch (single throw)YAPI_Exception
- on errorpublic long get_pulseTimer() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getPulseTimer() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_pulseTimer(long newval) throws YAPI_Exception
YAPI_Exception
public int pulse(int ms_duration) throws YAPI_Exception
ms_duration
- : pulse duration, in millisecondesYAPI_Exception
- on errorpublic YWatchdog.YDelayedPulse get_delayedPulseTimer() throws YAPI_Exception
YAPI_Exception
public int set_delayedPulseTimer(YWatchdog.YDelayedPulse newval) throws YAPI_Exception
YAPI_Exception
public int delayedPulse(int ms_delay, int ms_duration) throws YAPI_Exception
ms_delay
- : waiting time before the pulse, in millisecondesms_duration
- : pulse duration, in millisecondesYAPI_Exception
- on errorpublic long get_countdown() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getCountdown() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_autoStart() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getAutoStart() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_autoStart(int newval) throws YAPI_Exception
newval
- : either YWatchdog.AUTOSTART_OFF or YWatchdog.AUTOSTART_ON, according to the watchdog
runningsttae at module power onYAPI_Exception
- on errorpublic int setAutoStart(int newval) throws YAPI_Exception
newval
- : either Y_AUTOSTART_OFF or Y_AUTOSTART_ON, according to the watchdog runningsttae at
module power onYAPI_Exception
- on errorpublic int get_running() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getRunning() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_running(int newval) throws YAPI_Exception
newval
- : either YWatchdog.RUNNING_OFF or YWatchdog.RUNNING_ON, according to the running
state of the watchdogYAPI_Exception
- on errorpublic int setRunning(int newval) throws YAPI_Exception
newval
- : either Y_RUNNING_OFF or Y_RUNNING_ON, according to the running state of the watchdogYAPI_Exception
- on errorpublic int resetWatchdog() throws YAPI_Exception
YAPI_Exception
- on errorpublic long get_triggerDelay() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getTriggerDelay() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_triggerDelay(long newval) throws YAPI_Exception
newval
- : an integer corresponding to the waiting delay before a reset is triggered by the
watchdog, in millisecondsYAPI_Exception
- on errorpublic int setTriggerDelay(long newval) throws YAPI_Exception
newval
- : an integer corresponding to the waiting delay before a reset is triggered by the
watchdog, in millisecondsYAPI_Exception
- on errorpublic long get_triggerDuration() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getTriggerDuration() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_triggerDuration(long newval) throws YAPI_Exception
newval
- : an integer corresponding to the duration of resets caused by the watchdog, in millisecondsYAPI_Exception
- on errorpublic int setTriggerDuration(long newval) throws YAPI_Exception
newval
- : an integer corresponding to the duration of resets caused by the watchdog, in millisecondsYAPI_Exception
- on errorpublic static YWatchdog FindWatchdog(String func)
func
- : a string that uniquely characterizes the watchdogpublic static YWatchdog FindWatchdogInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the watchdogpublic int registerValueCallback(YWatchdog.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 YWatchdog nextWatchdog()
public static YWatchdog FirstWatchdog()
public static YWatchdog FirstWatchdogInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2018. All rights reserved.