Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
YWatchdog Class Reference

#include <yocto_watchdog.h>

Inheritance diagram for YWatchdog:
Inheritance graph
[legend]

Public Member Functions

virtual int _invokeValueCallback (string value)
 
Y_AUTOSTART_enum autoStart (void)
 
s64 countdown (void)
 
int delayedPulse (int ms_delay, int ms_duration)
 
YDelayedPulse delayedPulseTimer (void)
 
Y_AUTOSTART_enum get_autoStart (void)
 
s64 get_countdown (void)
 
YDelayedPulse get_delayedPulseTimer (void)
 
s64 get_maxTimeOnStateA (void)
 
s64 get_maxTimeOnStateB (void)
 
Y_OUTPUT_enum get_output (void)
 
s64 get_pulseTimer (void)
 
Y_RUNNING_enum get_running (void)
 
Y_STATE_enum get_state (void)
 
Y_STATEATPOWERON_enum get_stateAtPowerOn (void)
 
s64 get_triggerDelay (void)
 
s64 get_triggerDuration (void)
 
s64 maxTimeOnStateA (void)
 
s64 maxTimeOnStateB (void)
 
YWatchdognext (void)
 
YWatchdognextWatchdog (void)
 
Y_OUTPUT_enum output (void)
 
int pulse (int ms_duration)
 
s64 pulseTimer (void)
 
virtual int registerValueCallback (YWatchdogValueCallback callback)
 
int resetWatchdog (void)
 
Y_RUNNING_enum running (void)
 
int set_autoStart (Y_AUTOSTART_enum newval)
 
int set_delayedPulseTimer (YDelayedPulse newval)
 
int set_maxTimeOnStateA (s64 newval)
 
int set_maxTimeOnStateB (s64 newval)
 
int set_output (Y_OUTPUT_enum newval)
 
int set_pulseTimer (s64 newval)
 
int set_running (Y_RUNNING_enum newval)
 
int set_state (Y_STATE_enum newval)
 
int set_stateAtPowerOn (Y_STATEATPOWERON_enum newval)
 
int set_triggerDelay (s64 newval)
 
int set_triggerDuration (s64 newval)
 
int setAutoStart (Y_AUTOSTART_enum newval)
 
int setDelayedPulseTimer (YDelayedPulse newval)
 
int setMaxTimeOnStateA (s64 newval)
 
int setMaxTimeOnStateB (s64 newval)
 
int setOutput (Y_OUTPUT_enum newval)
 
int setPulseTimer (s64 newval)
 
int setRunning (Y_RUNNING_enum newval)
 
int setState (Y_STATE_enum newval)
 
int setStateAtPowerOn (Y_STATEATPOWERON_enum newval)
 
int setTriggerDelay (s64 newval)
 
int setTriggerDuration (s64 newval)
 
Y_STATE_enum state (void)
 
Y_STATEATPOWERON_enum stateAtPowerOn (void)
 
s64 triggerDelay (void)
 
s64 triggerDuration (void)
 
 ~YWatchdog ()
 
- Public Member Functions inherited from YFunction
void _clearDataStreamCache ()
 
string _decode_json_string (const string &json)
 
string _download (const string &url)
 
YDataStream_findDataStream (YDataSet &dataset, const string &def)
 
string _get_json_path (const string &json, const string &path)
 
vector< string > _json_get_array (const string &json)
 
string _json_get_key (const string &json, const string &data)
 
string _json_get_string (const string &json)
 
int _parseEx (yJsonStateMachine &j)
 
virtual int _parserHelper (void)
 
string _parseString (yJsonStateMachine &j)
 
string _request (const string &request)
 
string _requestEx (int tcpchan, const string &request, yapiRequestProgressCallback callback, void *context)
 
void _throw (YRETCODE errType, string errMsg)
 
YRETCODE _upload (const string &path, const string &content)
 
YRETCODE _uploadWithProgress (const string &path, const string &content, yapiRequestProgressCallback callback, void *context)
 
string advertisedValue (void)
 
void clearCache ()
 
string describe (void)
 
string errMessage (void)
 
string errorMessage (void)
 
YRETCODE errorType (void)
 
YRETCODE errType (void)
 
YFUN_DESCR functionDescriptor (void)
 
string get_advertisedValue (void)
 
string get_errorMessage (void)
 
YRETCODE get_errorType (void)
 
virtual string get_friendlyName (void)
 
YFUN_DESCR get_functionDescriptor (void)
 
string get_functionId (void)
 
string get_hardwareId (void)
 
string get_hubSerial ()
 
string get_logicalName (void)
 
YModuleget_module (void)
 
void * get_userData (void)
 
bool isOnline (void)
 
YRETCODE load (int msValidity)
 
virtual string loadAttribute (string attrName)
 
string logicalName (void)
 
YModulemodule (void)
 
virtual int muteValueCallbacks (void)
 
YFunctionnext (void)
 
YFunctionnextFunction (void)
 
virtual int registerValueCallback (YFunctionValueCallback callback)
 
int set_advertisedValue (const string &newval)
 
int set_logicalName (const string &newval)
 
void set_userData (void *data)
 
int setAdvertisedValue (const string &newval)
 
int setLogicalName (const string &newval)
 
void setUserData (void *data)
 
virtual int unmuteValueCallbacks (void)
 
void * userData (void)
 
virtual ~YFunction ()
 

Static Public Member Functions

static YWatchdogFind (string func)
 
static YWatchdogFindWatchdog (string func)
 
static YWatchdogFirst (void)
 
static YWatchdogFirstWatchdog (void)
 
- Static Public Member Functions inherited from YFunction
static void _ClearCache (void)
 
static YFunctionFind (string func)
 
static YFunctionFindFunction (string func)
 
static YFunctionFirst (void)
 
static YFunctionFirstFunction (void)
 

Static Public Attributes

static const Y_AUTOSTART_enum AUTOSTART_INVALID = Y_AUTOSTART_INVALID
 
static const Y_AUTOSTART_enum AUTOSTART_OFF = Y_AUTOSTART_OFF
 
static const Y_AUTOSTART_enum AUTOSTART_ON = Y_AUTOSTART_ON
 
static const s64 COUNTDOWN_INVALID = YAPI_INVALID_LONG
 
static const YDelayedPulse DELAYEDPULSETIMER_INVALID = YDelayedPulse()
 
static const s64 MAXTIMEONSTATEA_INVALID = YAPI_INVALID_LONG
 
static const s64 MAXTIMEONSTATEB_INVALID = YAPI_INVALID_LONG
 
static const Y_OUTPUT_enum OUTPUT_INVALID = Y_OUTPUT_INVALID
 
static const Y_OUTPUT_enum OUTPUT_OFF = Y_OUTPUT_OFF
 
static const Y_OUTPUT_enum OUTPUT_ON = Y_OUTPUT_ON
 
static const s64 PULSETIMER_INVALID = YAPI_INVALID_LONG
 
static const Y_RUNNING_enum RUNNING_INVALID = Y_RUNNING_INVALID
 
static const Y_RUNNING_enum RUNNING_OFF = Y_RUNNING_OFF
 
static const Y_RUNNING_enum RUNNING_ON = Y_RUNNING_ON
 
static const Y_STATE_enum STATE_A = Y_STATE_A
 
static const Y_STATE_enum STATE_B = Y_STATE_B
 
static const Y_STATE_enum STATE_INVALID = Y_STATE_INVALID
 
static const Y_STATEATPOWERON_enum STATEATPOWERON_A = Y_STATEATPOWERON_A
 
static const Y_STATEATPOWERON_enum STATEATPOWERON_B = Y_STATEATPOWERON_B
 
static const Y_STATEATPOWERON_enum STATEATPOWERON_INVALID = Y_STATEATPOWERON_INVALID
 
static const Y_STATEATPOWERON_enum STATEATPOWERON_UNCHANGED = Y_STATEATPOWERON_UNCHANGED
 
static const s64 TRIGGERDELAY_INVALID = YAPI_INVALID_LONG
 
static const s64 TRIGGERDURATION_INVALID = YAPI_INVALID_LONG
 
- Static Public Attributes inherited from YFunction
static const string ADVERTISEDVALUE_INVALID = YAPI_INVALID_STRING
 
static const string FRIENDLYNAME_INVALID = YAPI_INVALID_STRING
 
static const YFUN_DESCR FUNCTIONDESCRIPTOR_INVALID = Y_FUNCTIONDESCRIPTOR_INVALID
 
static const string FUNCTIONID_INVALID = YAPI_INVALID_STRING
 
static const string HARDWAREID_INVALID = YAPI_INVALID_STRING
 
static const string LOGICALNAME_INVALID = YAPI_INVALID_STRING
 

Protected Member Functions

virtual int _parseAttr (YJSONObject *json_val)
 
 YWatchdog (const string &func)
 
- Protected Member Functions inherited from YFunction
YRETCODE _buildSetRequest (const string &changeattr, const string *changeval, string &request, string &errmsg)
 
string _escapeAttr (const string &changeval)
 
YRETCODE _getDescriptor (YFUN_DESCR &fundescr, string &errMsg)
 
YRETCODE _getDevice (YDevice *&dev, string &errMsg)
 
YRETCODE _load_unsafe (int msValidity)
 
YRETCODE _nextFunction (string &hwId)
 
int _parse (YJSONObject *j)
 
YRETCODE _setAttr (string attrname, string newvalue)
 
 YFunction (const string &func)
 

Protected Attributes

Y_AUTOSTART_enum _autoStart
 
s64 _countdown
 
YDelayedPulse _delayedPulseTimer
 
s64 _maxTimeOnStateA
 
s64 _maxTimeOnStateB
 
Y_OUTPUT_enum _output
 
s64 _pulseTimer
 
Y_RUNNING_enum _running
 
Y_STATE_enum _state
 
Y_STATEATPOWERON_enum _stateAtPowerOn
 
s64 _triggerDelay
 
s64 _triggerDuration
 
YWatchdogValueCallback _valueCallbackWatchdog
 
- Protected Attributes inherited from YFunction
string _advertisedValue
 
u64 _cacheExpiration
 
string _className
 
std::map< string, YDataStream * > _dataStreams
 
string _func
 
YFUN_DESCR _fundescr
 
string _funId
 
string _hwId
 
string _lastErrorMsg
 
YRETCODE _lastErrorType
 
string _logicalName
 
string _serial
 
yCRITICAL_SECTION _this_cs
 
void * _userData
 
YFunctionValueCallback _valueCallbackFunction
 

Friends

YWatchdogyFindWatchdog (const string &func)
 
YWatchdogyFirstWatchdog (void)
 

Additional Inherited Members

- Static Protected Member Functions inherited from YFunction
static void _AddToCache (const string &classname, const string &func, YFunction *obj)
 
static YFunction_FindFromCache (const string &classname, const string &func)
 
static void _UpdateTimedReportCallbackList (YFunction *func, bool add)
 
static void _UpdateValueCallbackList (YFunction *func, bool add)
 
- Static Protected Attributes inherited from YFunction
static std::map< string, YFunction * > _cache
 

Detailed Description

YWatchdog Class: Watchdog function interface

The watchog function works like a relay and can cause a brief power cut to an appliance after a preset delay to force this appliance to reset. The Watchdog must be called from time to time to reset the timer and prevent the appliance reset. The watchdog can be driven direcly with pulse and delayedpulse methods to switch off an appliance for a given duration.

Definition at line 132 of file yocto_watchdog.h.

Constructor & Destructor Documentation

YWatchdog::YWatchdog ( const string &  func)
protected

Definition at line 51 of file yocto_watchdog.cpp.

YWatchdog::~YWatchdog ( )

Definition at line 71 of file yocto_watchdog.cpp.

Member Function Documentation

int YWatchdog::_invokeValueCallback ( string  value)
virtual

Reimplemented from YFunction.

Definition at line 879 of file yocto_watchdog.cpp.

int YWatchdog::_parseAttr ( YJSONObject json_val)
protectedvirtual

Reimplemented from YFunction.

Definition at line 80 of file yocto_watchdog.cpp.

Y_AUTOSTART_enum YWatchdog::autoStart ( void  )
inline

Definition at line 405 of file yocto_watchdog.h.

s64 YWatchdog::countdown ( void  )
inline

Definition at line 393 of file yocto_watchdog.h.

int YWatchdog::delayedPulse ( int  ms_delay,
int  ms_duration 
)

Schedules a pulse.

Parameters
ms_delay: waiting time before the pulse, in millisecondes
ms_duration: pulse duration, in millisecondes
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 527 of file yocto_watchdog.cpp.

YDelayedPulse YWatchdog::delayedPulseTimer ( void  )
inline

Definition at line 363 of file yocto_watchdog.h.

static YWatchdog* YWatchdog::Find ( string  func)
inlinestatic

Definition at line 557 of file yocto_watchdog.h.

YWatchdog * YWatchdog::FindWatchdog ( string  func)
static

Retrieves a watchdog for a given identifier. The identifier can be specified using several formats:

  • FunctionLogicalName
  • ModuleSerialNumber.FunctionIdentifier
  • ModuleSerialNumber.FunctionLogicalName
  • ModuleLogicalName.FunctionIdentifier
  • ModuleLogicalName.FunctionLogicalName

This function does not require that the watchdog is online at the time it is invoked. The returned object is nevertheless valid. Use the method YWatchdog.isOnline() to test if the watchdog is indeed online at a given time. In case of ambiguity when looking for a watchdog by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

Parameters
func: a string that uniquely characterizes the watchdog
Returns
a YWatchdog object allowing you to drive the watchdog.

Definition at line 828 of file yocto_watchdog.cpp.

static YWatchdog* YWatchdog::First ( void  )
inlinestatic

Definition at line 581 of file yocto_watchdog.h.

YWatchdog * YWatchdog::FirstWatchdog ( void  )
static

Starts the enumeration of watchdog currently accessible. Use the method YWatchdog.nextWatchdog() to iterate on next watchdog.

Returns
a pointer to a YWatchdog object, corresponding to the first watchdog currently online, or a NULL pointer if there are none.

Definition at line 899 of file yocto_watchdog.cpp.

Y_AUTOSTART_enum YWatchdog::get_autoStart ( void  )

Returns the watchdog runing state at module power on.

Returns
either Y_AUTOSTART_OFF or Y_AUTOSTART_ON, according to the watchdog runing state at module power on

On failure, throws an exception or returns Y_AUTOSTART_INVALID.

Definition at line 572 of file yocto_watchdog.cpp.

s64 YWatchdog::get_countdown ( void  )

Returns the number of milliseconds remaining before a pulse (delayedPulse() call) When there is no scheduled pulse, returns zero.

Returns
an integer corresponding to the number of milliseconds remaining before a pulse (delayedPulse() call) When there is no scheduled pulse, returns zero

On failure, throws an exception or returns Y_COUNTDOWN_INVALID.

Definition at line 543 of file yocto_watchdog.cpp.

YDelayedPulse YWatchdog::get_delayedPulseTimer ( void  )

Definition at line 479 of file yocto_watchdog.cpp.

s64 YWatchdog::get_maxTimeOnStateA ( void  )

Retourne the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state A before automatically switching back in to B state. Zero means no maximum time.

Returns
an integer

On failure, throws an exception or returns Y_MAXTIMEONSTATEA_INVALID.

Definition at line 254 of file yocto_watchdog.cpp.

s64 YWatchdog::get_maxTimeOnStateB ( void  )

Retourne the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state B before automatically switching back in to A state. Zero means no maximum time.

Returns
an integer

On failure, throws an exception or returns Y_MAXTIMEONSTATEB_INVALID.

Definition at line 310 of file yocto_watchdog.cpp.

Y_OUTPUT_enum YWatchdog::get_output ( void  )

Returns the output state of the watchdog, when used as a simple switch (single throw).

Returns
either Y_OUTPUT_OFF or Y_OUTPUT_ON, according to the output state of the watchdog, when used as a simple switch (single throw)

On failure, throws an exception or returns Y_OUTPUT_INVALID.

Definition at line 366 of file yocto_watchdog.cpp.

s64 YWatchdog::get_pulseTimer ( void  )

Returns the number of milliseconds remaining before the watchdog is returned to idle position (state A), during a measured pulse generation. When there is no ongoing pulse, returns zero.

Returns
an integer corresponding to the number of milliseconds remaining before the watchdog is returned to idle position (state A), during a measured pulse generation

On failure, throws an exception or returns Y_PULSETIMER_INVALID.

Definition at line 424 of file yocto_watchdog.cpp.

Y_RUNNING_enum YWatchdog::get_running ( void  )

Returns the watchdog running state.

Returns
either Y_RUNNING_OFF or Y_RUNNING_ON, according to the watchdog running state

On failure, throws an exception or returns Y_RUNNING_INVALID.

Definition at line 628 of file yocto_watchdog.cpp.

Y_STATE_enum YWatchdog::get_state ( void  )

Returns the state of the watchdog (A for the idle position, B for the active position).

Returns
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)

On failure, throws an exception or returns Y_STATE_INVALID.

Definition at line 139 of file yocto_watchdog.cpp.

Y_STATEATPOWERON_enum YWatchdog::get_stateAtPowerOn ( void  )

Returns the state of the watchdog at device startup (A for the idle position, B for the active position, UNCHANGED for no change).

Returns
a value among Y_STATEATPOWERON_UNCHANGED, Y_STATEATPOWERON_A and Y_STATEATPOWERON_B corresponding to the state of the watchdog at device startup (A for the idle position, B for the active position, UNCHANGED for no change)

On failure, throws an exception or returns Y_STATEATPOWERON_INVALID.

Definition at line 197 of file yocto_watchdog.cpp.

s64 YWatchdog::get_triggerDelay ( void  )

Returns the waiting duration before a reset is automatically triggered by the watchdog, in milliseconds.

Returns
an integer corresponding to the waiting duration before a reset is automatically triggered by the watchdog, in milliseconds

On failure, throws an exception or returns Y_TRIGGERDELAY_INVALID.

Definition at line 699 of file yocto_watchdog.cpp.

s64 YWatchdog::get_triggerDuration ( void  )

Returns the duration of resets caused by the watchdog, in milliseconds.

Returns
an integer corresponding to the duration of resets caused by the watchdog, in milliseconds

On failure, throws an exception or returns Y_TRIGGERDURATION_INVALID.

Definition at line 754 of file yocto_watchdog.cpp.

s64 YWatchdog::maxTimeOnStateA ( void  )
inline

Definition at line 259 of file yocto_watchdog.h.

s64 YWatchdog::maxTimeOnStateB ( void  )
inline

Definition at line 286 of file yocto_watchdog.h.

YWatchdog* YWatchdog::next ( void  )
inline

Definition at line 568 of file yocto_watchdog.h.

YWatchdog * YWatchdog::nextWatchdog ( void  )

Continues the enumeration of watchdog started using yFirstWatchdog().

Returns
a pointer to a YWatchdog object, corresponding to a watchdog currently online, or a NULL pointer if there are no more watchdog to enumerate.

Definition at line 889 of file yocto_watchdog.cpp.

Y_OUTPUT_enum YWatchdog::output ( void  )
inline

Definition at line 313 of file yocto_watchdog.h.

int YWatchdog::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).

Parameters
ms_duration: pulse duration, in millisecondes
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 472 of file yocto_watchdog.cpp.

s64 YWatchdog::pulseTimer ( void  )
inline

Definition at line 342 of file yocto_watchdog.h.

int YWatchdog::registerValueCallback ( YWatchdogValueCallback  callback)
virtual

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of ySleep or yHandleEvents. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a NULL pointer as argument.

Parameters
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.

Definition at line 860 of file yocto_watchdog.cpp.

int YWatchdog::resetWatchdog ( void  )

Resets the watchdog. When the watchdog is running, this function must be called on a regular basis to prevent the watchog to trigger

Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 684 of file yocto_watchdog.cpp.

Y_RUNNING_enum YWatchdog::running ( void  )
inline

Definition at line 432 of file yocto_watchdog.h.

int YWatchdog::set_autoStart ( Y_AUTOSTART_enum  newval)

Changes the watchdog runningsttae at module power on. Remember to call the saveToFlash() method and then to reboot the module to apply this setting.

Parameters
newval: either Y_AUTOSTART_OFF or Y_AUTOSTART_ON, according to the watchdog runningsttae at module power on
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 605 of file yocto_watchdog.cpp.

int YWatchdog::set_delayedPulseTimer ( YDelayedPulse  newval)

Definition at line 501 of file yocto_watchdog.cpp.

int YWatchdog::set_maxTimeOnStateA ( s64  newval)

Sets the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state A before automatically switching back in to B state. Use zero for no maximum time.

Parameters
newval: an integer
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 286 of file yocto_watchdog.cpp.

int YWatchdog::set_maxTimeOnStateB ( s64  newval)

Sets the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state B before automatically switching back in to A state. Use zero for no maximum time.

Parameters
newval: an integer
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 342 of file yocto_watchdog.cpp.

int YWatchdog::set_output ( Y_OUTPUT_enum  newval)

Changes the output state of the watchdog, when used as a simple switch (single throw).

Parameters
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)
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 398 of file yocto_watchdog.cpp.

int YWatchdog::set_pulseTimer ( s64  newval)

Definition at line 446 of file yocto_watchdog.cpp.

int YWatchdog::set_running ( Y_RUNNING_enum  newval)

Changes the running state of the watchdog.

Parameters
newval: either Y_RUNNING_OFF or Y_RUNNING_ON, according to the running state of the watchdog
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 659 of file yocto_watchdog.cpp.

int YWatchdog::set_state ( Y_STATE_enum  newval)

Changes the state of the watchdog (A for the idle position, B for the active position).

Parameters
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)
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 171 of file yocto_watchdog.cpp.

int YWatchdog::set_stateAtPowerOn ( Y_STATEATPOWERON_enum  newval)

Preset the state of the watchdog at device startup (A for the idle position, B for the active position, UNCHANGED for no modification). Remember to call the matching module saveToFlash() method, otherwise this call will have no effect.

Parameters
newval: a value among Y_STATEATPOWERON_UNCHANGED, Y_STATEATPOWERON_A and Y_STATEATPOWERON_B
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 230 of file yocto_watchdog.cpp.

int YWatchdog::set_triggerDelay ( s64  newval)

Changes the waiting delay before a reset is triggered by the watchdog, in milliseconds.

Parameters
newval: an integer corresponding to the waiting delay before a reset is triggered by the watchdog, in milliseconds
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 731 of file yocto_watchdog.cpp.

int YWatchdog::set_triggerDuration ( s64  newval)

Changes the duration of resets caused by the watchdog, in milliseconds.

Parameters
newval: an integer corresponding to the duration of resets caused by the watchdog, in milliseconds
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 785 of file yocto_watchdog.cpp.

int YWatchdog::setAutoStart ( Y_AUTOSTART_enum  newval)
inline

Definition at line 420 of file yocto_watchdog.h.

int YWatchdog::setDelayedPulseTimer ( YDelayedPulse  newval)
inline

Definition at line 367 of file yocto_watchdog.h.

int YWatchdog::setMaxTimeOnStateA ( s64  newval)
inline

Definition at line 273 of file yocto_watchdog.h.

int YWatchdog::setMaxTimeOnStateB ( s64  newval)
inline

Definition at line 300 of file yocto_watchdog.h.

int YWatchdog::setOutput ( Y_OUTPUT_enum  newval)
inline

Definition at line 327 of file yocto_watchdog.h.

int YWatchdog::setPulseTimer ( s64  newval)
inline

Definition at line 346 of file yocto_watchdog.h.

int YWatchdog::setRunning ( Y_RUNNING_enum  newval)
inline

Definition at line 445 of file yocto_watchdog.h.

int YWatchdog::setState ( Y_STATE_enum  newval)
inline

Definition at line 216 of file yocto_watchdog.h.

int YWatchdog::setStateAtPowerOn ( Y_STATEATPOWERON_enum  newval)
inline

Definition at line 246 of file yocto_watchdog.h.

int YWatchdog::setTriggerDelay ( s64  newval)
inline

Definition at line 483 of file yocto_watchdog.h.

int YWatchdog::setTriggerDuration ( s64  newval)
inline

Definition at line 508 of file yocto_watchdog.h.

Y_STATE_enum YWatchdog::state ( void  )
inline

Definition at line 202 of file yocto_watchdog.h.

Y_STATEATPOWERON_enum YWatchdog::stateAtPowerOn ( void  )
inline

Definition at line 231 of file yocto_watchdog.h.

s64 YWatchdog::triggerDelay ( void  )
inline

Definition at line 469 of file yocto_watchdog.h.

s64 YWatchdog::triggerDuration ( void  )
inline

Definition at line 495 of file yocto_watchdog.h.

Friends And Related Function Documentation

YWatchdog* yFindWatchdog ( const string &  func)
friend

Retrieves a watchdog for a given identifier. The identifier can be specified using several formats:

  • FunctionLogicalName
  • ModuleSerialNumber.FunctionIdentifier
  • ModuleSerialNumber.FunctionLogicalName
  • ModuleLogicalName.FunctionIdentifier
  • ModuleLogicalName.FunctionLogicalName

This function does not require that the watchdog is online at the time it is invoked. The returned object is nevertheless valid. Use the method YWatchdog.isOnline() to test if the watchdog is indeed online at a given time. In case of ambiguity when looking for a watchdog by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

Parameters
func: a string that uniquely characterizes the watchdog
Returns
a YWatchdog object allowing you to drive the watchdog.

Definition at line 618 of file yocto_watchdog.h.

YWatchdog* yFirstWatchdog ( void  )
friend

Starts the enumeration of watchdog currently accessible. Use the method YWatchdog.nextWatchdog() to iterate on next watchdog.

Returns
a pointer to a YWatchdog object, corresponding to the first watchdog currently online, or a NULL pointer if there are none.

Definition at line 629 of file yocto_watchdog.h.

Member Data Documentation

Y_AUTOSTART_enum YWatchdog::_autoStart
protected

Definition at line 148 of file yocto_watchdog.h.

s64 YWatchdog::_countdown
protected

Definition at line 147 of file yocto_watchdog.h.

YDelayedPulse YWatchdog::_delayedPulseTimer
protected

Definition at line 146 of file yocto_watchdog.h.

s64 YWatchdog::_maxTimeOnStateA
protected

Definition at line 142 of file yocto_watchdog.h.

s64 YWatchdog::_maxTimeOnStateB
protected

Definition at line 143 of file yocto_watchdog.h.

Y_OUTPUT_enum YWatchdog::_output
protected

Definition at line 144 of file yocto_watchdog.h.

s64 YWatchdog::_pulseTimer
protected

Definition at line 145 of file yocto_watchdog.h.

Y_RUNNING_enum YWatchdog::_running
protected

Definition at line 149 of file yocto_watchdog.h.

Y_STATE_enum YWatchdog::_state
protected

Definition at line 140 of file yocto_watchdog.h.

Y_STATEATPOWERON_enum YWatchdog::_stateAtPowerOn
protected

Definition at line 141 of file yocto_watchdog.h.

s64 YWatchdog::_triggerDelay
protected

Definition at line 150 of file yocto_watchdog.h.

s64 YWatchdog::_triggerDuration
protected

Definition at line 151 of file yocto_watchdog.h.

YWatchdogValueCallback YWatchdog::_valueCallbackWatchdog
protected

Definition at line 152 of file yocto_watchdog.h.

const Y_AUTOSTART_enum YWatchdog::AUTOSTART_INVALID = Y_AUTOSTART_INVALID
static

Definition at line 185 of file yocto_watchdog.h.

const Y_AUTOSTART_enum YWatchdog::AUTOSTART_OFF = Y_AUTOSTART_OFF
static

Definition at line 183 of file yocto_watchdog.h.

const Y_AUTOSTART_enum YWatchdog::AUTOSTART_ON = Y_AUTOSTART_ON
static

Definition at line 184 of file yocto_watchdog.h.

const s64 YWatchdog::COUNTDOWN_INVALID = YAPI_INVALID_LONG
static

Definition at line 182 of file yocto_watchdog.h.

const YDelayedPulse YWatchdog::DELAYEDPULSETIMER_INVALID = YDelayedPulse()
static

Definition at line 181 of file yocto_watchdog.h.

const s64 YWatchdog::MAXTIMEONSTATEA_INVALID = YAPI_INVALID_LONG
static

Definition at line 175 of file yocto_watchdog.h.

const s64 YWatchdog::MAXTIMEONSTATEB_INVALID = YAPI_INVALID_LONG
static

Definition at line 176 of file yocto_watchdog.h.

const Y_OUTPUT_enum YWatchdog::OUTPUT_INVALID = Y_OUTPUT_INVALID
static

Definition at line 179 of file yocto_watchdog.h.

const Y_OUTPUT_enum YWatchdog::OUTPUT_OFF = Y_OUTPUT_OFF
static

Definition at line 177 of file yocto_watchdog.h.

const Y_OUTPUT_enum YWatchdog::OUTPUT_ON = Y_OUTPUT_ON
static

Definition at line 178 of file yocto_watchdog.h.

const s64 YWatchdog::PULSETIMER_INVALID = YAPI_INVALID_LONG
static

Definition at line 180 of file yocto_watchdog.h.

const Y_RUNNING_enum YWatchdog::RUNNING_INVALID = Y_RUNNING_INVALID
static

Definition at line 188 of file yocto_watchdog.h.

const Y_RUNNING_enum YWatchdog::RUNNING_OFF = Y_RUNNING_OFF
static

Definition at line 186 of file yocto_watchdog.h.

const Y_RUNNING_enum YWatchdog::RUNNING_ON = Y_RUNNING_ON
static

Definition at line 187 of file yocto_watchdog.h.

const Y_STATE_enum YWatchdog::STATE_A = Y_STATE_A
static

Definition at line 168 of file yocto_watchdog.h.

const Y_STATE_enum YWatchdog::STATE_B = Y_STATE_B
static

Definition at line 169 of file yocto_watchdog.h.

const Y_STATE_enum YWatchdog::STATE_INVALID = Y_STATE_INVALID
static

Definition at line 170 of file yocto_watchdog.h.

const Y_STATEATPOWERON_enum YWatchdog::STATEATPOWERON_A = Y_STATEATPOWERON_A
static

Definition at line 172 of file yocto_watchdog.h.

const Y_STATEATPOWERON_enum YWatchdog::STATEATPOWERON_B = Y_STATEATPOWERON_B
static

Definition at line 173 of file yocto_watchdog.h.

const Y_STATEATPOWERON_enum YWatchdog::STATEATPOWERON_INVALID = Y_STATEATPOWERON_INVALID
static

Definition at line 174 of file yocto_watchdog.h.

const Y_STATEATPOWERON_enum YWatchdog::STATEATPOWERON_UNCHANGED = Y_STATEATPOWERON_UNCHANGED
static

Definition at line 171 of file yocto_watchdog.h.

const s64 YWatchdog::TRIGGERDELAY_INVALID = YAPI_INVALID_LONG
static

Definition at line 189 of file yocto_watchdog.h.

const s64 YWatchdog::TRIGGERDURATION_INVALID = YAPI_INVALID_LONG
static

Definition at line 190 of file yocto_watchdog.h.


The documentation for this class was generated from the following files:


yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:14