41 #define _CRT_SECURE_NO_DEPRECATE //do not use windows secure crt 49 #define __FILE_ID__ "wakeupschedule" 53 ,_minutesA(MINUTESA_INVALID)
54 ,_minutesB(MINUTESB_INVALID)
55 ,_hours(HOURS_INVALID)
56 ,_weekDays(WEEKDAYS_INVALID)
57 ,_monthDays(MONTHDAYS_INVALID)
58 ,_months(MONTHS_INVALID)
59 ,_nextOccurence(NEXTOCCURENCE_INVALID)
60 ,_valueCallbackWakeUpSchedule(NULL)
76 if(json_val->
has(
"minutesA")) {
79 if(json_val->
has(
"minutesB")) {
82 if(json_val->
has(
"hours")) {
85 if(json_val->
has(
"weekDays")) {
88 if(json_val->
has(
"monthDays")) {
91 if(json_val->
has(
"months")) {
94 if(json_val->
has(
"nextOccurence")) {
122 }
catch (std::exception) {
145 char buf[32]; sprintf(buf,
"%d", newval); rest_val = string(buf);
146 res =
_setAttr(
"minutesA", rest_val);
147 }
catch (std::exception) {
176 }
catch (std::exception) {
199 char buf[32]; sprintf(buf,
"%d", newval); rest_val = string(buf);
200 res =
_setAttr(
"minutesB", rest_val);
201 }
catch (std::exception) {
230 }
catch (std::exception) {
253 char buf[32]; sprintf(buf,
"%d", newval); rest_val = string(buf);
255 }
catch (std::exception) {
284 }
catch (std::exception) {
307 char buf[32]; sprintf(buf,
"%d", newval); rest_val = string(buf);
308 res =
_setAttr(
"weekDays", rest_val);
309 }
catch (std::exception) {
338 }
catch (std::exception) {
361 char buf[32]; sprintf(buf,
"%d", newval); rest_val = string(buf);
362 res =
_setAttr(
"monthDays", rest_val);
363 }
catch (std::exception) {
392 }
catch (std::exception) {
415 char buf[32]; sprintf(buf,
"%d", newval); rest_val = string(buf);
417 }
catch (std::exception) {
446 }
catch (std::exception) {
494 }
catch (std::exception) {
516 if (callback != NULL) {
523 if (callback != NULL && this->
isOnline()) {
550 res = ((res) << (30));
567 bitmap = ((bitmap) >> (30));
568 return this->
set_minutesB((
int)(((bitmap) & (0x3fffffff))));
583 vector<YFUN_DESCR> v_fundescr;
585 string serial, funcId, funcName, funcVal, errmsg;
588 v_fundescr.size() == 0 ||
static YWakeUpSchedule * FindWakeUpSchedule(string func)
yCRITICAL_SECTION _this_cs
virtual int _invokeValueCallback(string value)
YRETCODE _load_unsafe(int msValidity)
virtual s64 get_minutes(void)
YWakeUpScheduleValueCallback _valueCallbackWakeUpSchedule
static int DefaultCacheValidity
int set_minutesB(int newval)
void yLeaveCriticalSection(yCRITICAL_SECTION *cs)
static const s64 NEXTOCCURENCE_INVALID
static YRETCODE getFunctionInfo(YFUN_DESCR fundesc, YDEV_DESCR &devdescr, string &serial, string &funcId, string &funcName, string &funcVal, string &errmsg)
static const int MINUTESB_INVALID
virtual int _parseAttr(YJSONObject *json_val)
virtual int registerValueCallback(YWakeUpScheduleValueCallback callback)
YWakeUpSchedule * nextWakeUpSchedule(void)
int getInt(const string &key)
static u64 GetTickCount(void)
static void _AddToCache(const string &classname, const string &func, YFunction *obj)
void(* YWakeUpScheduleValueCallback)(YWakeUpSchedule *func, const string &functionValue)
static YFunction * _FindFromCache(const string &classname, const string &func)
static const int MONTHS_INVALID
int set_minutesA(int newval)
int set_months(int newval)
void yEnterCriticalSection(yCRITICAL_SECTION *cs)
static yCRITICAL_SECTION _global_cs
int set_weekDays(int newval)
static const int HOURS_INVALID
static int getFunctionsByClass(const string &class_str, YFUN_DESCR prevfundesc, vector< YFUN_DESCR > &buffer, int maxsize, string &errmsg)
int set_hours(int newval)
s64 getLong(const string &key)
YWakeUpSchedule(const string &func)
static const int WEEKDAYS_INVALID
int set_monthDays(int newval)
static YWakeUpSchedule * FirstWakeUpSchedule(void)
static bool _apiInitialized
YRETCODE _nextFunction(string &hwId)
virtual int _parseAttr(YJSONObject *json_val)
virtual int set_minutes(s64 bitmap)
static void _UpdateValueCallbackList(YFunction *func, bool add)
static const int MINUTESA_INVALID
bool has(const string &key)
YRETCODE _setAttr(string attrname, string newvalue)
static const int MONTHDAYS_INVALID
s64 get_nextOccurence(void)
virtual int _invokeValueCallback(string value)