53 #if defined(WINDOWS_API) 54 #if defined(GENERATE_DLL) || defined(YOCTOPUCEDLL_EXPORTS) 55 #define YOCTO_CLASS_EXPORT __declspec(dllexport) 56 #pragma warning(disable: 4251) 58 #define YOCTO_CLASS_EXPORT 61 #define YOCTO_CLASS_EXPORT 69 #define YAPI_INVALID_STRING "!INVALID!" 70 #define YAPI_INVALID_INT (0x7FFFFFFF) 71 #define YAPI_INVALID_UINT (-1) 72 #define YAPI_INVALID_LONG (0x7FFFFFFFFFFFFFFFLL) 73 #define YAPI_INVALID_DOUBLE (-DBL_MAX) 80 #define Y_LOGICALNAME_INVALID (YAPI_INVALID_STRING) 81 #define Y_ADVERTISEDVALUE_INVALID (YAPI_INVALID_STRING) 90 #ifndef _Y_PERSISTENTSETTINGS_ENUM 91 #define _Y_PERSISTENTSETTINGS_ENUM 99 #ifndef _Y_BEACON_ENUM 100 #define _Y_BEACON_ENUM 107 #define Y_PRODUCTNAME_INVALID (YAPI_INVALID_STRING) 108 #define Y_SERIALNUMBER_INVALID (YAPI_INVALID_STRING) 109 #define Y_PRODUCTID_INVALID (YAPI_INVALID_UINT) 110 #define Y_PRODUCTRELEASE_INVALID (YAPI_INVALID_UINT) 111 #define Y_FIRMWARERELEASE_INVALID (YAPI_INVALID_STRING) 112 #define Y_LUMINOSITY_INVALID (YAPI_INVALID_UINT) 113 #define Y_UPTIME_INVALID (YAPI_INVALID_LONG) 114 #define Y_USBCURRENT_INVALID (YAPI_INVALID_UINT) 115 #define Y_REBOOTCOUNTDOWN_INVALID (YAPI_INVALID_INT) 116 #define Y_USERVAR_INVALID (YAPI_INVALID_INT) 126 #ifndef _Y_ADVMODE_ENUM 127 #define _Y_ADVMODE_ENUM 136 #define Y_UNIT_INVALID (YAPI_INVALID_STRING) 137 #define Y_CURRENTVALUE_INVALID (YAPI_INVALID_DOUBLE) 138 #define Y_LOWESTVALUE_INVALID (YAPI_INVALID_DOUBLE) 139 #define Y_HIGHESTVALUE_INVALID (YAPI_INVALID_DOUBLE) 140 #define Y_CURRENTRAWVALUE_INVALID (YAPI_INVALID_DOUBLE) 141 #define Y_LOGFREQUENCY_INVALID (YAPI_INVALID_STRING) 142 #define Y_REPORTFREQUENCY_INVALID (YAPI_INVALID_STRING) 143 #define Y_CALIBRATIONPARAM_INVALID (YAPI_INVALID_STRING) 144 #define Y_RESOLUTION_INVALID (YAPI_INVALID_DOUBLE) 145 #define Y_SENSORSTATE_INVALID (YAPI_INVALID_INT) 164 #ifndef _Y_RECORDING_ENUM 165 #define _Y_RECORDING_ENUM 173 #ifndef _Y_AUTOSTART_ENUM 174 #define _Y_AUTOSTART_ENUM 181 #ifndef _Y_BEACONDRIVEN_ENUM 182 #define _Y_BEACONDRIVEN_ENUM 189 #ifndef _Y_CLEARHISTORY_ENUM 190 #define _Y_CLEARHISTORY_ENUM 197 #define Y_CURRENTRUNINDEX_INVALID (YAPI_INVALID_UINT) 198 #define Y_TIMEUTC_INVALID (YAPI_INVALID_LONG) 227 typedef double (*
yCalibrationHandler)(
double rawValue,
int calibType, vector<int> params, vector<double> rawValues, vector<double> refValues);
231 #define Y_FUNCTIONDESCRIPTOR_INVALID (-1) 232 #define Y_HARDWAREID_INVALID (YAPI_INVALID_STRING) 233 #define Y_FUNCTIONID_INVALID (YAPI_INVALID_STRING) 234 #define Y_FRIENDLYNAME_INVALID (YAPI_INVALID_STRING) 236 #define Y_DATA_INVALID (-DBL_MAX) 237 #define Y_DURATION_INVALID (-1) 295 s64
yatoi(
const char *c);
296 int _ystrpos(
const string& haystack,
const string& needle);
297 vector<string>
_strsplit(
const string& str,
char delimiter);
330 static YJSONContent* ParseJson(
const string& data,
int start,
int stop);
336 virtual int parse()=0;
337 static int SkipGarbage(
const string& data,
int start,
int stop);
338 string FormatError(
const string& errmsg,
int cur_pos);
339 virtual string toJSON()=0;
340 virtual string toString()=0;
347 YJSONArray(
const string& data,
int start,
int stop);
355 string getString(
int i);
360 void put(
const string& flatAttr);
361 virtual string toJSON();
362 virtual string toString();
369 YJSONString(
const string& data,
int start,
int stop);
376 virtual string toJSON();
378 virtual string toString();
379 void setContent(
const string& value);
389 YJSONNumber(
const string& data,
int start,
int stop);
395 virtual string toJSON();
399 virtual string toString();
410 YJSONObject(
const string& data,
int start,
int len);
415 bool has(
const string& key);
419 vector<string> keys();
421 string getString(
const string& key);
422 int getInt(
const string& key);
424 s64 getLong(
const string& key);
425 double getDouble(
const string& key);
426 virtual string toJSON();
427 virtual string toString();
429 string getKeyFromIdx(
int i);
448 static void _yapiLogFunctionFwd(
const char *log, u32 loglen);
449 static void _yapiDeviceArrivalCallbackFwd(
YDEV_DESCR devdesc);
450 static void _yapiDeviceRemovalCallbackFwd(
YDEV_DESCR devdesc);
451 static void _yapiDeviceChangeCallbackFwd(
YDEV_DESCR devdesc);
452 static void _yapiDeviceLogCallbackFwd(
YDEV_DESCR devdesc,
const char* line);
453 static void _yapiFunctionTimedReportCallbackFwd(
YAPI_FUNCTION fundesc,
double timestamp,
const u8 *bytes, u32 len);
454 static void _yapiHubDiscoveryCallbackFwd(
const char *serial,
const char *url);
457 static void _yapiFunctionUpdateCallbackFwd(
YFUN_DESCR fundesc,
const char *value);
458 static double _decimalToDouble(s16 val);
459 static s16 _doubleToDecimal(
double val);
461 static vector<int> _decodeWords(
string s);
462 static vector<int> _decodeFloats(
string sdat);
463 static string _bin2HexStr(
const string& data);
464 static string _hexStr2Bin(
const string& str);
465 static string _flattenJsonStruct(
string jsonbuffer);
466 static string _checkFirmware(
const string& serial,
const string& rev,
const string& path);
484 static const u32 DETECT_NONE = 0;
485 static const u32 DETECT_USB = 1;
486 static const u32 DETECT_NET = 2;
487 static const u32 RESEND_MISSING_PKT = 4;
491 static const int SUCCESS = 0;
492 static const int NOT_INITIALIZED = -1;
493 static const int INVALID_ARGUMENT = -2;
494 static const int NOT_SUPPORTED = -3;
495 static const int DEVICE_NOT_FOUND = -4;
496 static const int VERSION_MISMATCH = -5;
497 static const int DEVICE_BUSY = -6;
498 static const int TIMEOUT = -7;
499 static const int IO_ERROR = -8;
500 static const int NO_MORE_DATA = -9;
501 static const int EXHAUSTED = -10;
502 static const int DOUBLE_ACCES = -11;
503 static const int UNAUTHORIZED = -12;
504 static const int RTC_NOT_READY = -13;
505 static const int FILE_NOT_FOUND = -14;
525 static string GetAPIVersion(
void);
548 static YRETCODE InitAPI(
int mode,
string& errmsg);
558 static void FreeAPI(
void);
566 static void DisableExceptions(
void);
575 static void EnableExceptions(
void);
627 static YRETCODE TriggerHubDiscovery(
string& errmsg);
634 static void RegisterCalibrationHandler(
int calibrationType,
yCalibrationHandler calibrationHandler);
638 static double LinearCalibrationHandler(
double rawValue,
int calibType,
intArr params,
floatArr rawValues,
floatArr refValues);
655 static YRETCODE TestHub(
const string& url,
int mstimeout,
string& errmsg);
700 static YRETCODE RegisterHub(
const string& url,
string& errmsg);
717 static YRETCODE PreregisterHub(
const string& url,
string& errmsg);
726 static void UnregisterHub(
const string& url);
743 static YRETCODE UpdateDeviceList(
string& errmsg);
761 static YRETCODE HandleEvents(
string& errmsg);
781 static YRETCODE Sleep(
unsigned ms_duration,
string& errmsg);
789 static u64 GetTickCount(
void);
801 static bool CheckLogicalName(
const string& name);
808 static u16 getAPIVersion(
string& version,
string& date);
809 static YDEV_DESCR getDevice(
const string& device_str,
string& errmsg);
810 static int getAllDevices(vector<YDEV_DESCR>& buffer,
string& errmsg);
812 static YFUN_DESCR getFunction(
const string& class_str,
const string& function_str,
string& errmsg);
813 static int getFunctionsByClass(
const string& class_str,
YFUN_DESCR prevfundesc, vector<YFUN_DESCR>& buffer,
int maxsize,
string& errmsg);
814 static int getFunctionsByDevice(
YDEV_DESCR devdesc,
YFUN_DESCR prevfundesc, vector<YFUN_DESCR>& buffer,
int maxsize,
string& errmsg);
816 static YRETCODE getFunctionInfo(
YFUN_DESCR fundesc,
YDEV_DESCR& devdescr,
string& serial,
string& funcId,
string& funcName,
string& funcVal,
string& errmsg);
817 static YRETCODE getFunctionInfoEx(
YFUN_DESCR fundesc,
YDEV_DESCR& devdescr,
string& serial,
string& funcId,
string& baseType,
string& funcName,
string& funcVal,
string& errmsg);
819 static YRETCODE updateDeviceList(
bool forceupdate,
string& errmsg);
820 static YRETCODE handleEvents(
string& errmsg);
821 static string ysprintf(
const char *fmt, ...);
835 #pragma option push -w-8022 854 YFirmwareUpdate(
string serialNumber,
string path,
string settings,
bool force);
860 virtual int _processMore(
int newupdate);
869 static vector<string> GetAllBootLoaders(
void);
884 static string CheckFirmware(
string serial,
string path,
int minrelease);
896 virtual int get_progress(
void);
904 virtual string get_progressMessage(
void);
916 virtual int startUpdate(
void);
942 #pragma option push -w-8022 984 static const int DURATION_INVALID = -1;
989 virtual int _initFromDataSet(
YDataSet* dataset,vector<int> encoded);
991 virtual int _parseStream(
string sdata);
993 virtual string _get_url(
void);
995 virtual int loadStream(
void);
997 virtual double _decodeVal(
int w);
999 virtual double _decodeAvg(
int dw,
int count);
1001 virtual bool isClosed(
void);
1009 virtual int get_runIndex(
void);
1024 virtual int get_startTime(
void);
1035 virtual s64 get_startTimeUTC(
void);
1045 virtual int get_dataSamplesIntervalMs(
void);
1047 virtual double get_dataSamplesInterval(
void);
1060 virtual int get_rowCount(
void);
1075 virtual int get_columnCount(
void);
1094 virtual vector<string> get_columnNames(
void);
1106 virtual double get_minValue(
void);
1118 virtual double get_averageValue(
void);
1130 virtual double get_maxValue(
void);
1139 virtual int get_duration(
void);
1156 virtual vector< vector<double> > get_dataRows(
void);
1174 virtual double get_data(
int row,
int col);
1192 #pragma option push -w-8022 1209 YMeasure(
double start,
double end,
double minVal,
double avgVal,
double maxVal);
1212 time_t* get_startTimeUTC_asTime_t(time_t *time);
1213 time_t* get_endTimeUTC_asTime_t(time_t *time);
1226 virtual double get_startTimeUTC(
void);
1236 virtual double get_endTimeUTC(
void);
1244 virtual double get_minValue(
void);
1252 virtual double get_averageValue(
void);
1260 virtual double get_maxValue(
void);
1292 #pragma option push -w-8022 1313 YDataSet(
YFunction *parent,
const string& functionId,
const string& unit, s64 startTime, s64 endTime);
1315 int _parse(
const string& json);
1320 virtual vector<int> _get_calibration(
void);
1322 virtual int processMore(
int progress,
string data);
1324 virtual vector<YDataStream*> get_privateDataStreams(
void);
1336 virtual string get_hardwareId(
void);
1344 virtual string get_functionId(
void);
1353 virtual string get_unit(
void);
1367 virtual s64 get_startTimeUTC(
void);
1381 virtual s64 get_endTimeUTC(
void);
1391 virtual int get_progress(
void);
1402 virtual int loadMore(
void);
1418 virtual YMeasure get_summary(
void);
1438 virtual vector<YMeasure> get_preview(
void);
1453 virtual vector<YMeasure> get_measuresAt(
YMeasure measure);
1480 virtual vector<YMeasure> get_measures(
void);
1519 YRETCODE HTTPRequestPrepare(
const string& request,
string& fullrequest,
char *errbuff);
1523 static void ClearCache();
1528 void clearCache(
bool clearSubpath);
1529 YRETCODE getFunctions(vector<YFUN_DESCR> **functions,
string& errmsg);
1530 string getHubSerial(
void);
1553 #pragma option push -w-8022 1576 friend YFunction *yFindFunction(
const string& func);
1595 YRETCODE _nextFunction(
string &hwId);
1599 string _escapeAttr(
const string& changeval);
1600 YRETCODE _buildSetRequest(
const string& changeattr,
const string *changeval,
string& request,
string& errmsg);
1603 YRETCODE _setAttr(
string attrname,
string newvalue);
1604 YRETCODE _load_unsafe(
int msValidity);
1606 static void _UpdateValueCallbackList(
YFunction* func,
bool add);
1607 static void _UpdateTimedReportCallbackList(
YFunction* func,
bool add);
1610 static YFunction* _FindFromCache(
const string& classname,
const string& func);
1611 static void _AddToCache(
const string& classname,
const string& func,
YFunction *obj);
1617 static void _ClearCache(
void);
1620 void _throw(
YRETCODE errType,
string errMsg);
1623 string _request(
const string& request);
1625 string _download(
const string& url);
1629 YRETCODE _upload(
const string& path,
const string& content);
1632 string _json_get_key(
const string& json,
const string& data);
1633 string _json_get_string(
const string& json);
1634 vector<string> _json_get_array(
const string& json);
1635 string _get_json_path(
const string& json,
const string& path);
1636 string _decode_json_string(
const string& json);
1645 void _clearDataStreamCache();
1656 string get_hubSerial();
1671 string get_logicalName(
void);
1674 {
return this->get_logicalName(); }
1688 int set_logicalName(
const string& newval);
1690 {
return this->set_logicalName(newval); }
1699 string get_advertisedValue(
void);
1702 {
return this->get_advertisedValue(); }
1704 int set_advertisedValue(
const string& newval);
1706 {
return this->set_advertisedValue(newval); }
1735 static YFunction* FindFunction(
string func);
1750 virtual int _invokeValueCallback(
string value);
1763 virtual int muteValueCallbacks(
void);
1775 virtual int unmuteValueCallbacks(
void);
1787 virtual string loadAttribute(
string attrName);
1789 virtual int _parserHelper(
void);
1800 {
return this->nextFunction();}
1831 string describe(
void);
1844 virtual string get_friendlyName(
void);
1855 string get_hardwareId(
void);
1865 string get_functionId(
void);
1878 {
return this->get_errorType();}
1880 {
return this->get_errorType();}
1890 string get_errorMessage(
void);
1892 {
return this->get_errorMessage();}
1894 {
return this->get_errorMessage();}
1905 bool isOnline(
void);
1940 {
return this->get_module();}
1953 {
return this->get_functionDescriptor();}
1963 void *get_userData(
void);
1965 {
return this->get_userData();}
1974 void set_userData(
void* data);
1976 { this->set_userData(data);}
1993 #pragma option push -w-8022 2027 YRETCODE _getFunction(
int idx,
string& serial,
string& funcId,
string& baseType,
string& funcName,
string& funcVal,
string& errMsg);
2043 virtual string get_friendlyName(
void);
2053 int functionCount();
2065 string functionId(
int functionIndex);
2077 string functionName(
int functionIndex);
2090 string functionValue(
int functionIndex);
2102 string functionType(
int functionIndex);
2116 string functionBaseType(
int functionIndex);
2119 void setImmutableAttributes(
yDeviceSt *infos);
2163 string get_productName(
void);
2166 {
return this->get_productName(); }
2175 string get_serialNumber(
void);
2178 {
return this->get_serialNumber(); }
2187 int get_productId(
void);
2190 {
return this->get_productId(); }
2199 int get_productRelease(
void);
2202 {
return this->get_productRelease(); }
2211 string get_firmwareRelease(
void);
2214 {
return this->get_firmwareRelease(); }
2227 {
return this->get_persistentSettings(); }
2231 {
return this->set_persistentSettings(newval); }
2240 int get_luminosity(
void);
2243 {
return this->get_luminosity(); }
2257 int set_luminosity(
int newval);
2259 {
return this->set_luminosity(newval); }
2271 {
return this->get_beacon(); }
2284 {
return this->set_beacon(newval); }
2293 s64 get_upTime(
void);
2296 {
return this->get_upTime(); }
2305 int get_usbCurrent(
void);
2308 {
return this->get_usbCurrent(); }
2319 int get_rebootCountdown(
void);
2322 {
return this->get_rebootCountdown(); }
2324 int set_rebootCountdown(
int newval);
2326 {
return this->set_rebootCountdown(newval); }
2336 int get_userVar(
void);
2339 {
return this->get_userVar(); }
2352 int set_userVar(
int newval);
2354 {
return this->set_userVar(newval); }
2377 static YModule* FindModule(
string func);
2393 virtual int _invokeValueCallback(
string value);
2404 virtual int saveToFlash(
void);
2414 virtual int revertFromFlash(
void);
2425 virtual int reboot(
int secBeforeReboot);
2436 virtual int triggerFirmwareUpdate(
int secBeforeReboot);
2453 virtual string checkFirmware(
string path,
bool onlynew);
2484 virtual string get_allSettings(
void);
2486 virtual int loadThermistorExtra(
string funcId,
string jsonExtra);
2488 virtual int set_extraSettings(
string jsonExtra);
2503 virtual int set_allSettingsAndFiles(
string settings);
2513 virtual bool hasFunction(
string funcId);
2522 virtual vector<string> get_functionIds(
string funType);
2524 virtual string _flattenJsonStruct(
string jsoncomplex);
2526 virtual int calibVersion(
string cparams);
2528 virtual int calibScale(
string unit_name,
string sensorType);
2530 virtual int calibOffset(
string unit_name);
2532 virtual string calibConvert(
string param,
string currentFuncValue,
string unit_name,
string sensorType);
2545 virtual int set_allSettings(
string settings);
2556 virtual string download(
string pathname);
2565 virtual string get_icon2d(
void);
2574 virtual string get_lastLogs(
void);
2587 virtual int log(
string text);
2596 virtual vector<string> get_subDevices(
void);
2605 virtual string get_parentHub(
void);
2613 virtual string get_url(
void);
2628 {
return this->nextModule();}
2639 static YModule* FirstModule(
void);
2667 #pragma option push -w-8022 2739 string get_unit(
void);
2742 {
return this->get_unit(); }
2752 double get_currentValue(
void);
2755 {
return this->get_currentValue(); }
2767 int set_lowestValue(
double newval);
2769 {
return this->set_lowestValue(newval); }
2780 double get_lowestValue(
void);
2783 {
return this->get_lowestValue(); }
2795 int set_highestValue(
double newval);
2797 {
return this->set_highestValue(newval); }
2808 double get_highestValue(
void);
2811 {
return this->get_highestValue(); }
2822 double get_currentRawValue(
void);
2825 {
return this->get_currentRawValue(); }
2836 string get_logFrequency(
void);
2839 {
return this->get_logFrequency(); }
2854 int set_logFrequency(
const string& newval);
2856 {
return this->set_logFrequency(newval); }
2867 string get_reportFrequency(
void);
2870 {
return this->get_reportFrequency(); }
2885 int set_reportFrequency(
const string& newval);
2887 {
return this->set_reportFrequency(newval); }
2900 {
return this->get_advMode(); }
2914 {
return this->set_advMode(newval); }
2916 string get_calibrationParam(
void);
2919 {
return this->get_calibrationParam(); }
2921 int set_calibrationParam(
const string& newval);
2923 {
return this->set_calibrationParam(newval); }
2935 int set_resolution(
double newval);
2937 {
return this->set_resolution(newval); }
2947 double get_resolution(
void);
2950 {
return this->get_resolution(); }
2962 int get_sensorState(
void);
2965 {
return this->get_sensorState(); }
2994 static YSensor* FindSensor(
string func);
3010 virtual int _invokeValueCallback(
string value);
3012 virtual int _parserHelper(
void);
3022 virtual bool isSensorReady(
void);
3040 virtual int startDataLogger(
void);
3047 virtual int stopDataLogger(
void);
3075 virtual YDataSet get_recordedData(s64 startTime,s64 endTime);
3090 virtual int _invokeTimedReportCallback(
YMeasure value);
3113 virtual int calibrateFromPoints(vector<double> rawValues,vector<double> refValues);
3128 virtual int loadCalibrationPoints(vector<double>& rawValues,vector<double>& refValues);
3130 virtual string _encodeCalibrationPoints(vector<double> rawValues,vector<double> refValues);
3132 virtual double _applyCalibration(
double rawValue);
3134 virtual YMeasure _decodeTimedReport(
double timestamp,vector<int> report);
3136 virtual double _decodeVal(
int w);
3138 virtual double _decodeAvg(
int dw);
3153 {
return this->nextSensor();}
3164 static YSensor* FirstSensor(
void);
3586 unsigned stamp,
unsigned utc,
unsigned itv);
3589 int loadStream(
void);
3604 int get_startTime(
void);
3606 {
return this->get_startTime(); }
3619 double get_dataSamplesInterval(
void);
3621 {
return this->get_dataSamplesInterval(); }
3635 #pragma option push -w-8022 3664 int getData(
unsigned runIdx,
unsigned timeIdx,
string &buffer,
yJsonStateMachine &j);
3689 int get_dataStreams(vector<YDataStream *>& v);
3691 {
return this->get_dataStreams(v);}
3721 int get_currentRunIndex(
void);
3724 {
return this->get_currentRunIndex(); }
3733 s64 get_timeUTC(
void);
3736 {
return this->get_timeUTC(); }
3747 int set_timeUTC(s64 newval);
3749 {
return this->set_timeUTC(newval); }
3762 {
return this->get_recording(); }
3776 {
return this->set_recording(newval); }
3789 {
return this->get_autoStart(); }
3805 {
return this->set_autoStart(newval); }
3818 {
return this->get_beaconDriven(); }
3834 {
return this->set_beaconDriven(newval); }
3839 {
return this->get_clearHistory(); }
3843 {
return this->set_clearHistory(newval); }
3888 virtual int _invokeValueCallback(
string value);
3898 virtual int forgetAllDataStreams(
void);
3912 virtual vector<YDataSet> get_dataSets(
void);
3914 virtual vector<YDataSet> parse_dataSets(
string json);
3929 {
return this->nextDataLogger();}
int setReportFrequency(const string &newval)
static YDataLogger * Find(string func)
void(* YHubDiscoveryCallback)(const string &serial, const string &url)
prototype of the Hub discoverycallback
static YHubDiscoveryCallback _HubDiscoveryCallback
string errorMessage(void)
static void FreeAPI(void)
string serialNumber(void)
yCRITICAL_SECTION _this_cs
YDataLoggerValueCallback _valueCallbackDataLogger
int setRecording(Y_RECORDING_enum newval)
int setTimeUTC(s64 newval)
int setBeaconDriven(Y_BEACONDRIVEN_enum newval)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val)
vector< YDataStream * > _streams
static YSensor * FindSensor(string func)
static const double DATA_INVALID
static const double LOWESTVALUE_INVALID
static void RegisterHubDiscoveryCallback(YHubDiscoveryCallback hubDiscoveryCallback)
void yDisableExceptions(void)
int _ystrpos(const string &haystack, const string &needle)
void yRegisterHubDiscoveryCallback(YHubDiscoveryCallback hubDiscoveryCallback)
int setHighestValue(double newval)
static const string ADVERTISEDVALUE_INVALID
#define YAPI_INVALID_LONG
int currentRunIndex(void)
std::map< string, YDataStream * > _dataStreams
static const string REPORTFREQUENCY_INVALID
static void UnregisterHub(const string &url)
vector< YFUN_DESCR > _functions
static YModule * FindModule(string func)
YRETCODE yInitAPI(int mode, string &errmsg)
static const string FRIENDLYNAME_INVALID
Y_CLEARHISTORY_enum clearHistory(void)
static void EnableExceptions(void)
Y_PERSISTENTSETTINGS_enum persistentSettings(void)
static const string CALIBRATIONPARAM_INVALID
static const string LOGFREQUENCY_INVALID
static YDataLogger * First(void)
static YRETCODE PreregisterHub(const string &url, string &errmsg)
void(* yapiRequestProgressCallback)(void *context, u32 acked, u32 totalbytes)
static int DefaultCacheValidity
void(* YSensorValueCallback)(YSensor *func, const string &functionValue)
static std::map< string, YFunction * > _cache
static YFunction * First(void)
static const string HARDWAREID_INVALID
void(* HTTPRequestCallback)(YDevice *device, void *context, YRETCODE returnval, const string &result, string &errmsg)
vector< double > floatArr
prototype of the value calibration handlers
static YSensor * Find(string func)
YAPI_Exception(YRETCODE errType, string errMsg)
static const string LOGICALNAME_INVALID
YRETCODE yPreregisterHub(const string &url, string &errmsg)
string advertisedValue(void)
static const string FIRMWARERELEASE_INVALID
double currentValue(void)
YSensor * yFirstSensor(void)
string reportFrequency(void)
static const string FUNCTIONID_INVALID
static void RegisterDeviceArrivalCallback(yDeviceUpdateCallback arrivalCallback)
#define YAPI_INVALID_UINT
static string GetAPIVersion(void)
int setLowestValue(double newval)
int setBeacon(Y_BEACON_enum newval)
static YRETCODE RegisterHub(const string &url, string &errmsg)
static yDeviceUpdateCallback DeviceRemovalCallback
static YRETCODE TestHub(const string &url, int mstimeout, string &errmsg)
YDataLogger * _dataLogger
static const double INVALID_DOUBLE
static queue< yapiGlobalEvent > _plug_events
static void RegisterDeviceChangeCallback(yDeviceUpdateCallback changeCallback)
int setLogicalName(const string &newval)
YFUN_DESCR functionDescriptor(void)
Y_BEACON_enum beacon(void)
static void RegisterDeviceRemovalCallback(yDeviceUpdateCallback removalCallback)
static YSensor * First(void)
YRETCODE ySleep(unsigned ms_duration, string &errmsg)
Y_RECORDING_enum recording(void)
int dataStreams(vector< YDataStream * > &v)
int setUserVar(int newval)
static u64 GetTickCount(void)
static void DisableExceptions(void)
int setAdvertisedValue(const string &newval)
int setAutoStart(Y_AUTOSTART_enum newval)
vector< YJSONContent * > _arrayValue
Y_AUTOSTART_enum _autoStart
string firmwareRelease(void)
YRETCODE yRegisterHub(const string &url, string &errmsg)
double dataSamplesInterval(void)
static void RegisterLogFunction(yLogFunction logfun)
static const string SERIALNUMBER_INVALID
vector< vector< double > > _values
void yRegisterDeviceRemovalCallback(yDeviceUpdateCallback removalCallback)
int setResolution(double newval)
Y_BEACONDRIVEN_enum beaconDriven(void)
static YModule * FirstModule(void)
vector< YMeasure > _preview
static void RegisterCalibrationHandler(int calibrationType, yCalibrationHandler calibrationHandler)
int setLuminosity(int newval)
static const string PRODUCTNAME_INVALID
static YModule * Find(string func)
ROSCPP_DECL bool has(const std::string &key)
void(* YFunctionValueCallback)(YFunction *func, const string &functionValue)
static YFunction * Find(string func)
vector< string > _strsplit(const string &str, char delimiter)
Y_ADVMODE_enum advMode(void)
YSensorTimedReportCallback _timedReportCallbackSensor
static yCRITICAL_SECTION _global_cs
static yDeviceUpdateCallback DeviceChangeCallback
int setRebootCountdown(int newval)
void(* YModuleValueCallback)(YModule *func, const string &functionValue)
void yEnableExceptions(void)
static const string UNIT_INVALID
static queue< yapiDataEvent > _data_events
void(* YDataLoggerValueCallback)(YDataLogger *func, const string &functionValue)
static YRETCODE Sleep(unsigned ms_duration, string &errmsg)
static YRETCODE InitAPI(int mode, string &errmsg)
virtual int registerValueCallback(YFunctionValueCallback callback)
static bool ExceptionsDisabled
YFunctionValueCallback _valueCallbackFunction
Y_PERSISTENTSETTINGS_enum
YSensor * yFindSensor(const string &func)
YRETCODE yUpdateDeviceList(string &errmsg)
YDataLogger * yFirstDataLogger(void)
static YDataLogger * FirstDataLogger(void)
static YDataLogger * FindDataLogger(string func)
string calibrationParam(void)
static const double CURRENTVALUE_INVALID
double currentRawValue(void)
const int Y_RESEND_MISSING_PKT
#define YOCTO_CLASS_EXPORT
Y_BEACONDRIVEN_enum _beaconDriven
string logFrequency(void)
static YSensor * FirstSensor(void)
void(* yLogFunction)(const string &msg)
prototype of the log callback
static yDeviceUpdateCallback DeviceArrivalCallback
int setLogFrequency(const string &newval)
Y_RECORDING_enum _recording
bool yCheckLogicalName(const string &name)
Y_AUTOSTART_enum autoStart(void)
static YRETCODE HandleEvents(string &errmsg)
void(* YSensorTimedReportCallback)(YSensor *func, YMeasure measure)
#define Y_FUNCTIONDESCRIPTOR_INVALID
static YModule * First(void)
int setAdvMode(Y_ADVMODE_enum newval)
yCalibrationHandler _calhdl
static const double RESOLUTION_INVALID
YModule * yFirstModule(void)
vector< YMeasure > _measures
void yUnregisterHub(const string &url)
static const string INVALID_STRING
static vector< YDevice * > _devCache
YRETCODE yTriggerHubDiscovery(string &errmsg)
static bool _apiInitialized
YDataLogger * yFindDataLogger(const string &func)
static const double CURRENTRAWVALUE_INVALID
double highestValue(void)
string functionValue(int functionIndex)
void yRegisterDeviceArrivalCallback(yDeviceUpdateCallback arrivalCallback)
static const double HIGHESTVALUE_INVALID
YModuleValueCallback _valueCallbackModule
void yRegisterLogFunction(yLogFunction logfun)
yCalibrationHandler _calhdl
Y_PERSISTENTSETTINGS_enum _persistentSettings
void(* YModuleLogCallback)(YModule *module, const string &logline)
void(* yDeviceUpdateCallback)(YModule *module)
prototype of the device arrival/update/removal callback
static bool CheckLogicalName(const string &name)
vector< string > _columnNames
int setPersistentSettings(Y_PERSISTENTSETTINGS_enum newval)
static YFunction * FirstFunction(void)
void yRegisterCalibrationHandler(int calibrationType, yCalibrationHandler calibrationHandler)
map< string, YJSONContent * > _parsed
YModuleLogCallback _logCallback
int setClearHistory(Y_CLEARHISTORY_enum newval)
YModule * yFindModule(const string &func)
static YRETCODE TriggerHubDiscovery(string &errmsg)
static yLogFunction LogFunction
void yRegisterDeviceChangeCallback(yDeviceUpdateCallback removalCallback)
YRETCODE yHandleEvents(string &errmsg)
int setCalibrationParam(const string &newval)
YSensorValueCallback _valueCallbackSensor
int rebootCountdown(void)
double(* yCalibrationHandler)(double rawValue, int calibType, vector< int > params, vector< double > rawValues, vector< double > refValues)
Y_CLEARHISTORY_enum _clearHistory
void setUserData(void *data)
YRETCODE yTestHub(const string &url, int mstimeout, string &errmsg)
static YFunction * FindFunction(string func)
static map< int, yCalibrationHandler > _calibHandlers
static YRETCODE UpdateDeviceList(string &errmsg)