41 #define _CRT_SECURE_NO_DEPRECATE //do not use windows secure crt 49 #define __FILE_ID__ "carbondioxide" 53 ,_abcPeriod(ABCPERIOD_INVALID)
54 ,_command(COMMAND_INVALID)
55 ,_valueCallbackCarbonDioxide(NULL)
56 ,_timedReportCallbackCarbonDioxide(NULL)
73 if(json_val->
has(
"abcPeriod")) {
76 if(json_val->
has(
"command")) {
105 }
catch (std::exception) {
132 char buf[32]; sprintf(buf,
"%d", newval); rest_val = string(buf);
133 res =
_setAttr(
"abcPeriod", rest_val);
134 }
catch (std::exception) {
156 }
catch (std::exception) {
171 res =
_setAttr(
"command", rest_val);
172 }
catch (std::exception) {
220 }
catch (std::exception) {
242 if (callback != NULL) {
249 if (callback != NULL && this->
isOnline()) {
283 if (callback != NULL) {
364 vector<YFUN_DESCR> v_fundescr;
366 string serial, funcId, funcName, funcVal, errmsg;
369 v_fundescr.size() == 0 ||
YCarbonDioxide(const string &func)
yCRITICAL_SECTION _this_cs
static void _UpdateTimedReportCallbackList(YFunction *func, bool add)
virtual int _invokeValueCallback(string value)
YRETCODE _load_unsafe(int msValidity)
virtual int _parseAttr(YJSONObject *json_val)
int set_command(const string &newval)
static YCarbonDioxide * FindCarbonDioxide(string func)
static int DefaultCacheValidity
string getString(const string &key)
void yLeaveCriticalSection(yCRITICAL_SECTION *cs)
virtual int _invokeTimedReportCallback(YMeasure value)
static YRETCODE getFunctionInfo(YFUN_DESCR fundesc, YDEV_DESCR &devdescr, string &serial, string &funcId, string &funcName, string &funcVal, string &errmsg)
#define YAPI_INVALID_STRING
YCarbonDioxide * nextCarbonDioxide(void)
int getInt(const string &key)
virtual int triggerZeroCalibration(void)
static u64 GetTickCount(void)
static void _AddToCache(const string &classname, const string &func, YFunction *obj)
int set_abcPeriod(int newval)
virtual int _invokeTimedReportCallback(YMeasure value)
virtual int _invokeValueCallback(string value)
virtual int triggetBaselineCalibration(void)
static YFunction * _FindFromCache(const string &classname, const string &func)
virtual int registerTimedReportCallback(YCarbonDioxideTimedReportCallback callback)
virtual int registerValueCallback(YCarbonDioxideValueCallback callback)
static const int ABCPERIOD_INVALID
void yEnterCriticalSection(yCRITICAL_SECTION *cs)
static yCRITICAL_SECTION _global_cs
virtual int _parseAttr(YJSONObject *json_val)
static const string COMMAND_INVALID
static int getFunctionsByClass(const string &class_str, YFUN_DESCR prevfundesc, vector< YFUN_DESCR > &buffer, int maxsize, string &errmsg)
static YCarbonDioxide * FirstCarbonDioxide(void)
void(* YCarbonDioxideValueCallback)(YCarbonDioxide *func, const string &functionValue)
virtual int triggerBaselineCalibration(void)
virtual int triggetZeroCalibration(void)
static bool _apiInitialized
YRETCODE _nextFunction(string &hwId)
static void _UpdateValueCallbackList(YFunction *func, bool add)
YCarbonDioxideValueCallback _valueCallbackCarbonDioxide
bool has(const string &key)
YRETCODE _setAttr(string attrname, string newvalue)
YCarbonDioxideTimedReportCallback _timedReportCallbackCarbonDioxide
void(* YCarbonDioxideTimedReportCallback)(YCarbonDioxide *func, YMeasure measure)