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

#include <yocto_wakeupschedule.h>

Inheritance diagram for YWakeUpSchedule:
Inheritance graph
[legend]

Public Member Functions

virtual int _invokeValueCallback (string value)
 
int get_hours (void)
 
virtual s64 get_minutes (void)
 
int get_minutesA (void)
 
int get_minutesB (void)
 
int get_monthDays (void)
 
int get_months (void)
 
s64 get_nextOccurence (void)
 
int get_weekDays (void)
 
int hours (void)
 
int minutesA (void)
 
int minutesB (void)
 
int monthDays (void)
 
int months (void)
 
YWakeUpSchedulenext (void)
 
s64 nextOccurence (void)
 
YWakeUpSchedulenextWakeUpSchedule (void)
 
virtual int registerValueCallback (YWakeUpScheduleValueCallback callback)
 
int set_hours (int newval)
 
virtual int set_minutes (s64 bitmap)
 
int set_minutesA (int newval)
 
int set_minutesB (int newval)
 
int set_monthDays (int newval)
 
int set_months (int newval)
 
int set_weekDays (int newval)
 
int setHours (int newval)
 
int setMinutesA (int newval)
 
int setMinutesB (int newval)
 
int setMonthDays (int newval)
 
int setMonths (int newval)
 
int setWeekDays (int newval)
 
int weekDays (void)
 
 ~YWakeUpSchedule ()
 
- 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 YWakeUpScheduleFind (string func)
 
static YWakeUpScheduleFindWakeUpSchedule (string func)
 
static YWakeUpScheduleFirst (void)
 
static YWakeUpScheduleFirstWakeUpSchedule (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 int HOURS_INVALID = YAPI_INVALID_UINT
 
static const int MINUTESA_INVALID = YAPI_INVALID_UINT
 
static const int MINUTESB_INVALID = YAPI_INVALID_UINT
 
static const int MONTHDAYS_INVALID = YAPI_INVALID_UINT
 
static const int MONTHS_INVALID = YAPI_INVALID_UINT
 
static const s64 NEXTOCCURENCE_INVALID = YAPI_INVALID_LONG
 
static const int WEEKDAYS_INVALID = YAPI_INVALID_UINT
 
- 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)
 
 YWakeUpSchedule (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

int _hours
 
int _minutesA
 
int _minutesB
 
int _monthDays
 
int _months
 
s64 _nextOccurence
 
YWakeUpScheduleValueCallback _valueCallbackWakeUpSchedule
 
int _weekDays
 
- 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

YWakeUpScheduleyFindWakeUpSchedule (const string &func)
 
YWakeUpScheduleyFirstWakeUpSchedule (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

YWakeUpSchedule Class: WakeUpSchedule function interface

The WakeUpSchedule function implements a wake up condition. The wake up time is specified as a set of months and/or days and/or hours and/or minutes when the wake up should happen.

Definition at line 72 of file yocto_wakeupschedule.h.

Constructor & Destructor Documentation

YWakeUpSchedule::YWakeUpSchedule ( const string &  func)
protected

Definition at line 51 of file yocto_wakeupschedule.cpp.

YWakeUpSchedule::~YWakeUpSchedule ( )

Definition at line 66 of file yocto_wakeupschedule.cpp.

Member Function Documentation

int YWakeUpSchedule::_invokeValueCallback ( string  value)
virtual

Reimplemented from YFunction.

Definition at line 532 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::_parseAttr ( YJSONObject json_val)
protectedvirtual

Reimplemented from YFunction.

Definition at line 74 of file yocto_wakeupschedule.cpp.

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

Definition at line 335 of file yocto_wakeupschedule.h.

YWakeUpSchedule * YWakeUpSchedule::FindWakeUpSchedule ( string  func)
static

Retrieves a wake up schedule 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 wake up schedule is online at the time it is invoked. The returned object is nevertheless valid. Use the method YWakeUpSchedule.isOnline() to test if the wake up schedule is indeed online at a given time. In case of ambiguity when looking for a wake up schedule 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 wake up schedule
Returns
a YWakeUpSchedule object allowing you to drive the wake up schedule.

Definition at line 481 of file yocto_wakeupschedule.cpp.

static YWakeUpSchedule* YWakeUpSchedule::First ( void  )
inlinestatic

Definition at line 359 of file yocto_wakeupschedule.h.

YWakeUpSchedule * YWakeUpSchedule::FirstWakeUpSchedule ( void  )
static

Starts the enumeration of wake up schedules currently accessible. Use the method YWakeUpSchedule.nextWakeUpSchedule() to iterate on next wake up schedules.

Returns
a pointer to a YWakeUpSchedule object, corresponding to the first wake up schedule currently online, or a NULL pointer if there are none.

Definition at line 581 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::get_hours ( void  )

Returns the hours scheduled for wake up.

Returns
an integer corresponding to the hours scheduled for wake up

On failure, throws an exception or returns Y_HOURS_INVALID.

Definition at line 216 of file yocto_wakeupschedule.cpp.

s64 YWakeUpSchedule::get_minutes ( void  )
virtual

Returns all the minutes of each hour that are scheduled for wake up.

Definition at line 545 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::get_minutesA ( void  )

Returns the minutes in the 00-29 interval of each hour scheduled for wake up.

Returns
an integer corresponding to the minutes in the 00-29 interval of each hour scheduled for wake up

On failure, throws an exception or returns Y_MINUTESA_INVALID.

Definition at line 108 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::get_minutesB ( void  )

Returns the minutes in the 30-59 intervalof each hour scheduled for wake up.

Returns
an integer corresponding to the minutes in the 30-59 intervalof each hour scheduled for wake up

On failure, throws an exception or returns Y_MINUTESB_INVALID.

Definition at line 162 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::get_monthDays ( void  )

Returns the days of the month scheduled for wake up.

Returns
an integer corresponding to the days of the month scheduled for wake up

On failure, throws an exception or returns Y_MONTHDAYS_INVALID.

Definition at line 324 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::get_months ( void  )

Returns the months scheduled for wake up.

Returns
an integer corresponding to the months scheduled for wake up

On failure, throws an exception or returns Y_MONTHS_INVALID.

Definition at line 378 of file yocto_wakeupschedule.cpp.

s64 YWakeUpSchedule::get_nextOccurence ( void  )

Returns the date/time (seconds) of the next wake up occurence.

Returns
an integer corresponding to the date/time (seconds) of the next wake up occurence

On failure, throws an exception or returns Y_NEXTOCCURENCE_INVALID.

Definition at line 432 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::get_weekDays ( void  )

Returns the days of the week scheduled for wake up.

Returns
an integer corresponding to the days of the week scheduled for wake up

On failure, throws an exception or returns Y_WEEKDAYS_INVALID.

Definition at line 270 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::hours ( void  )
inline

Definition at line 170 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::minutesA ( void  )
inline

Definition at line 120 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::minutesB ( void  )
inline

Definition at line 145 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::monthDays ( void  )
inline

Definition at line 220 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::months ( void  )
inline

Definition at line 245 of file yocto_wakeupschedule.h.

YWakeUpSchedule* YWakeUpSchedule::next ( void  )
inline

Definition at line 346 of file yocto_wakeupschedule.h.

s64 YWakeUpSchedule::nextOccurence ( void  )
inline

Definition at line 270 of file yocto_wakeupschedule.h.

YWakeUpSchedule * YWakeUpSchedule::nextWakeUpSchedule ( void  )

Continues the enumeration of wake up schedules started using yFirstWakeUpSchedule().

Returns
a pointer to a YWakeUpSchedule object, corresponding to a wake up schedule currently online, or a NULL pointer if there are no more wake up schedules to enumerate.

Definition at line 571 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::registerValueCallback ( YWakeUpScheduleValueCallback  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 513 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::set_hours ( int  newval)

Changes the hours when a wake up must take place.

Parameters
newval: an integer corresponding to the hours when a wake up must take place
Returns
YAPI_SUCCESS if the call succeeds.

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

Definition at line 247 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::set_minutes ( s64  bitmap)
virtual

Changes all the minutes where a wake up must take place.

Parameters
bitmap: Minutes 00-59 of each hour scheduled for wake up.
Returns
YAPI_SUCCESS if the call succeeds.

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

Definition at line 564 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::set_minutesA ( int  newval)

Changes the minutes in the 00-29 interval when a wake up must take place.

Parameters
newval: an integer corresponding to the minutes in the 00-29 interval when a wake up must take place
Returns
YAPI_SUCCESS if the call succeeds.

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

Definition at line 139 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::set_minutesB ( int  newval)

Changes the minutes in the 30-59 interval when a wake up must take place.

Parameters
newval: an integer corresponding to the minutes in the 30-59 interval when a wake up must take place
Returns
YAPI_SUCCESS if the call succeeds.

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

Definition at line 193 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::set_monthDays ( int  newval)

Changes the days of the month when a wake up must take place.

Parameters
newval: an integer corresponding to the days of the month when a wake up must take place
Returns
YAPI_SUCCESS if the call succeeds.

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

Definition at line 355 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::set_months ( int  newval)

Changes the months when a wake up must take place.

Parameters
newval: an integer corresponding to the months when a wake up must take place
Returns
YAPI_SUCCESS if the call succeeds.

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

Definition at line 409 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::set_weekDays ( int  newval)

Changes the days of the week when a wake up must take place.

Parameters
newval: an integer corresponding to the days of the week when a wake up must take place
Returns
YAPI_SUCCESS if the call succeeds.

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

Definition at line 301 of file yocto_wakeupschedule.cpp.

int YWakeUpSchedule::setHours ( int  newval)
inline

Definition at line 183 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::setMinutesA ( int  newval)
inline

Definition at line 133 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::setMinutesB ( int  newval)
inline

Definition at line 158 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::setMonthDays ( int  newval)
inline

Definition at line 233 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::setMonths ( int  newval)
inline

Definition at line 258 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::setWeekDays ( int  newval)
inline

Definition at line 208 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::weekDays ( void  )
inline

Definition at line 195 of file yocto_wakeupschedule.h.

Friends And Related Function Documentation

YWakeUpSchedule* yFindWakeUpSchedule ( const string &  func)
friend

Retrieves a wake up schedule 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 wake up schedule is online at the time it is invoked. The returned object is nevertheless valid. Use the method YWakeUpSchedule.isOnline() to test if the wake up schedule is indeed online at a given time. In case of ambiguity when looking for a wake up schedule 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 wake up schedule
Returns
a YWakeUpSchedule object allowing you to drive the wake up schedule.

Definition at line 396 of file yocto_wakeupschedule.h.

YWakeUpSchedule* yFirstWakeUpSchedule ( void  )
friend

Starts the enumeration of wake up schedules currently accessible. Use the method YWakeUpSchedule.nextWakeUpSchedule() to iterate on next wake up schedules.

Returns
a pointer to a YWakeUpSchedule object, corresponding to the first wake up schedule currently online, or a NULL pointer if there are none.

Definition at line 407 of file yocto_wakeupschedule.h.

Member Data Documentation

int YWakeUpSchedule::_hours
protected

Definition at line 82 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::_minutesA
protected

Definition at line 80 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::_minutesB
protected

Definition at line 81 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::_monthDays
protected

Definition at line 84 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::_months
protected

Definition at line 85 of file yocto_wakeupschedule.h.

s64 YWakeUpSchedule::_nextOccurence
protected

Definition at line 86 of file yocto_wakeupschedule.h.

YWakeUpScheduleValueCallback YWakeUpSchedule::_valueCallbackWakeUpSchedule
protected

Definition at line 87 of file yocto_wakeupschedule.h.

int YWakeUpSchedule::_weekDays
protected

Definition at line 83 of file yocto_wakeupschedule.h.

const int YWakeUpSchedule::HOURS_INVALID = YAPI_INVALID_UINT
static

Definition at line 105 of file yocto_wakeupschedule.h.

const int YWakeUpSchedule::MINUTESA_INVALID = YAPI_INVALID_UINT
static

Definition at line 103 of file yocto_wakeupschedule.h.

const int YWakeUpSchedule::MINUTESB_INVALID = YAPI_INVALID_UINT
static

Definition at line 104 of file yocto_wakeupschedule.h.

const int YWakeUpSchedule::MONTHDAYS_INVALID = YAPI_INVALID_UINT
static

Definition at line 107 of file yocto_wakeupschedule.h.

const int YWakeUpSchedule::MONTHS_INVALID = YAPI_INVALID_UINT
static

Definition at line 108 of file yocto_wakeupschedule.h.

const s64 YWakeUpSchedule::NEXTOCCURENCE_INVALID = YAPI_INVALID_LONG
static

Definition at line 109 of file yocto_wakeupschedule.h.

const int YWakeUpSchedule::WEEKDAYS_INVALID = YAPI_INVALID_UINT
static

Definition at line 106 of file yocto_wakeupschedule.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