yocto_gyro.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_gyro.cpp 28748 2017-10-03 08:23:39Z seb $
4  *
5  * Implements yFindGyro(), the high-level API for Gyro functions
6  *
7  * - - - - - - - - - License information: - - - - - - - - -
8  *
9  * Copyright (C) 2011 and beyond by Yoctopuce Sarl, Switzerland.
10  *
11  * Yoctopuce Sarl (hereafter Licensor) grants to you a perpetual
12  * non-exclusive license to use, modify, copy and integrate this
13  * file into your software for the sole purpose of interfacing
14  * with Yoctopuce products.
15  *
16  * You may reproduce and distribute copies of this file in
17  * source or object form, as long as the sole purpose of this
18  * code is to interface with Yoctopuce products. You must retain
19  * this notice in the distributed source file.
20  *
21  * You should refer to Yoctopuce General Terms and Conditions
22  * for additional information regarding your rights and
23  * obligations.
24  *
25  * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT
26  * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
27  * WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS
28  * FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO
29  * EVENT SHALL LICENSOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
30  * INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA,
31  * COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR
32  * SERVICES, ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT
33  * LIMITED TO ANY DEFENSE THEREOF), ANY CLAIMS FOR INDEMNITY OR
34  * CONTRIBUTION, OR OTHER SIMILAR COSTS, WHETHER ASSERTED ON THE
35  * BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE), BREACH OF
36  * WARRANTY, OR OTHERWISE.
37  *
38  *********************************************************************/
39 
40 
41 #define _CRT_SECURE_NO_DEPRECATE //do not use windows secure crt
42 #include "yocto_gyro.h"
43 #include "yapi/yjson.h"
44 #include "yapi/yapi.h"
45 #include <string.h>
46 #include <stdio.h>
47 #include <math.h>
48 #include <stdlib.h>
49 #define __FILE_ID__ "gyro"
50 
51 
52 
53 YQt::YQt(const string& func): YSensor(func)
54 //--- (generated code: YQt initialization)
55  ,_valueCallbackQt(NULL)
56  ,_timedReportCallbackQt(NULL)
57 //--- (end of generated code: YQt initialization)
58 {
59  _className="Qt";
60 }
61 
63 {
64 //--- (generated code: YQt cleanup)
65 //--- (end of generated code: YQt cleanup)
66 }
67 //--- (generated code: YQt implementation)
68 // static attributes
69 
70 
98 YQt* YQt::FindQt(string func)
99 {
100  YQt* obj = NULL;
101  int taken = 0;
102  if (YAPI::_apiInitialized) {
104  taken = 1;
105  }try {
106  obj = (YQt*) YFunction::_FindFromCache("Qt", func);
107  if (obj == NULL) {
108  obj = new YQt(func);
109  YFunction::_AddToCache("Qt", func, obj);
110  }
111  } catch (std::exception) {
113  throw;
114  }
116  return obj;
117 }
118 
131 {
132  string val;
133  if (callback != NULL) {
135  } else {
137  }
138  _valueCallbackQt = callback;
139  // Immediately invoke value callback with current value
140  if (callback != NULL && this->isOnline()) {
141  val = _advertisedValue;
142  if (!(val == "")) {
143  this->_invokeValueCallback(val);
144  }
145  }
146  return 0;
147 }
148 
149 int YQt::_invokeValueCallback(string value)
150 {
151  if (_valueCallbackQt != NULL) {
152  _valueCallbackQt(this, value);
153  } else {
155  }
156  return 0;
157 }
158 
171 {
172  YSensor* sensor = NULL;
173  sensor = this;
174  if (callback != NULL) {
176  } else {
178  }
179  _timedReportCallbackQt = callback;
180  return 0;
181 }
182 
184 {
185  if (_timedReportCallbackQt != NULL) {
186  _timedReportCallbackQt(this, value);
187  } else {
189  }
190  return 0;
191 }
192 
194 {
195  string hwid;
196 
197  if(YISERR(_nextFunction(hwid)) || hwid=="") {
198  return NULL;
199  }
200  return YQt::FindQt(hwid);
201 }
202 
204 {
205  vector<YFUN_DESCR> v_fundescr;
206  YDEV_DESCR ydevice;
207  string serial, funcId, funcName, funcVal, errmsg;
208 
209  if(YISERR(YapiWrapper::getFunctionsByClass("Qt", 0, v_fundescr, sizeof(YFUN_DESCR), errmsg)) ||
210  v_fundescr.size() == 0 ||
211  YISERR(YapiWrapper::getFunctionInfo(v_fundescr[0], ydevice, serial, funcId, funcName, funcVal, errmsg))) {
212  return NULL;
213  }
214  return YQt::FindQt(serial+"."+funcId);
215 }
216 
217 //--- (end of generated code: YQt implementation)
218 
219 //--- (generated code: YQt functions)
220 //--- (end of generated code: YQt functions)
221 
222 
223 static void yInternalGyroCallback(YQt *obj, const string& value)
224 {
225  YGyro *gyro = (YGyro*) obj->get_userData();
226  if (gyro == NULL) {
227  return;
228  }
229  string tmp = obj->get_functionId().substr(2);
230  int idx = atoi(tmp.c_str());
231  double dbl_value = atof(value.c_str());
232  gyro->_invokeGyroCallbacks(idx, dbl_value);
233 }
234 
235 
236 
237 
238 YGyro::YGyro(const string& func): YSensor(func)
239 //--- (generated code: YGyro initialization)
240  ,_bandwidth(BANDWIDTH_INVALID)
241  ,_xValue(XVALUE_INVALID)
242  ,_yValue(YVALUE_INVALID)
243  ,_zValue(ZVALUE_INVALID)
244  ,_valueCallbackGyro(NULL)
245  ,_timedReportCallbackGyro(NULL)
246  ,_qt_stamp(0)
247  ,_qt_w(NULL)
248  ,_qt_x(NULL)
249  ,_qt_y(NULL)
250  ,_qt_z(NULL)
251  ,_w(0.0)
252  ,_x(0.0)
253  ,_y(0.0)
254  ,_z(0.0)
255  ,_angles_stamp(0)
256  ,_head(0.0)
257  ,_pitch(0.0)
258  ,_roll(0.0)
259  ,_quatCallback(NULL)
260  ,_anglesCallback(NULL)
261 //--- (end of generated code: YGyro initialization)
262 {
263  _className="Gyro";
264 }
265 
267 {
268 //--- (generated code: YGyro cleanup)
269 //--- (end of generated code: YGyro cleanup)
270 }
271 //--- (generated code: YGyro implementation)
272 // static attributes
276 
278 {
279  if(json_val->has("bandwidth")) {
280  _bandwidth = json_val->getInt("bandwidth");
281  }
282  if(json_val->has("xValue")) {
283  _xValue = floor(json_val->getDouble("xValue") * 1000.0 / 65536.0 + 0.5) / 1000.0;
284  }
285  if(json_val->has("yValue")) {
286  _yValue = floor(json_val->getDouble("yValue") * 1000.0 / 65536.0 + 0.5) / 1000.0;
287  }
288  if(json_val->has("zValue")) {
289  _zValue = floor(json_val->getDouble("zValue") * 1000.0 / 65536.0 + 0.5) / 1000.0;
290  }
291  return YSensor::_parseAttr(json_val);
292 }
293 
294 
303 {
304  int res = 0;
306  try {
309  {
312  }
313  }
314  }
315  res = _bandwidth;
316  } catch (std::exception) {
318  throw;
319  }
321  return res;
322 }
323 
334 int YGyro::set_bandwidth(int newval)
335 {
336  string rest_val;
337  int res;
339  try {
340  char buf[32]; sprintf(buf, "%d", newval); rest_val = string(buf);
341  res = _setAttr("bandwidth", rest_val);
342  } catch (std::exception) {
344  throw;
345  }
347  return res;
348 }
349 
358 double YGyro::get_xValue(void)
359 {
360  double res = 0.0;
362  try {
365  {
367  return YGyro::XVALUE_INVALID;
368  }
369  }
370  }
371  res = _xValue;
372  } catch (std::exception) {
374  throw;
375  }
377  return res;
378 }
379 
388 double YGyro::get_yValue(void)
389 {
390  double res = 0.0;
392  try {
395  {
397  return YGyro::YVALUE_INVALID;
398  }
399  }
400  }
401  res = _yValue;
402  } catch (std::exception) {
404  throw;
405  }
407  return res;
408 }
409 
418 double YGyro::get_zValue(void)
419 {
420  double res = 0.0;
422  try {
425  {
427  return YGyro::ZVALUE_INVALID;
428  }
429  }
430  }
431  res = _zValue;
432  } catch (std::exception) {
434  throw;
435  }
437  return res;
438 }
439 
467 YGyro* YGyro::FindGyro(string func)
468 {
469  YGyro* obj = NULL;
470  int taken = 0;
471  if (YAPI::_apiInitialized) {
473  taken = 1;
474  }try {
475  obj = (YGyro*) YFunction::_FindFromCache("Gyro", func);
476  if (obj == NULL) {
477  obj = new YGyro(func);
478  YFunction::_AddToCache("Gyro", func, obj);
479  }
480  } catch (std::exception) {
482  throw;
483  }
485  return obj;
486 }
487 
500 {
501  string val;
502  if (callback != NULL) {
504  } else {
506  }
507  _valueCallbackGyro = callback;
508  // Immediately invoke value callback with current value
509  if (callback != NULL && this->isOnline()) {
510  val = _advertisedValue;
511  if (!(val == "")) {
512  this->_invokeValueCallback(val);
513  }
514  }
515  return 0;
516 }
517 
519 {
520  if (_valueCallbackGyro != NULL) {
521  _valueCallbackGyro(this, value);
522  } else {
524  }
525  return 0;
526 }
527 
540 {
541  YSensor* sensor = NULL;
542  sensor = this;
543  if (callback != NULL) {
545  } else {
547  }
548  _timedReportCallbackGyro = callback;
549  return 0;
550 }
551 
553 {
554  if (_timedReportCallbackGyro != NULL) {
555  _timedReportCallbackGyro(this, value);
556  } else {
558  }
559  return 0;
560 }
561 
563 {
564  int now_stamp = 0;
565  int age_ms = 0;
566  now_stamp = (int) ((YAPI::GetTickCount()) & (0x7FFFFFFF));
567  age_ms = (((now_stamp - _qt_stamp)) & (0x7FFFFFFF));
568  if ((age_ms >= 10) || (_qt_stamp == 0)) {
569  if (this->_load_unsafe(10) != YAPI_SUCCESS) {
570  return YAPI_DEVICE_NOT_FOUND;
571  }
572  if (_qt_stamp == 0) {
573  _qt_w = YQt::FindQt(YapiWrapper::ysprintf("%s.qt1",_serial.c_str()));
574  _qt_x = YQt::FindQt(YapiWrapper::ysprintf("%s.qt2",_serial.c_str()));
575  _qt_y = YQt::FindQt(YapiWrapper::ysprintf("%s.qt3",_serial.c_str()));
576  _qt_z = YQt::FindQt(YapiWrapper::ysprintf("%s.qt4",_serial.c_str()));
577  }
578  if (_qt_w->load(9) != YAPI_SUCCESS) {
579  return YAPI_DEVICE_NOT_FOUND;
580  }
581  if (_qt_x->load(9) != YAPI_SUCCESS) {
582  return YAPI_DEVICE_NOT_FOUND;
583  }
584  if (_qt_y->load(9) != YAPI_SUCCESS) {
585  return YAPI_DEVICE_NOT_FOUND;
586  }
587  if (_qt_z->load(9) != YAPI_SUCCESS) {
588  return YAPI_DEVICE_NOT_FOUND;
589  }
594  _qt_stamp = now_stamp;
595  }
596  return YAPI_SUCCESS;
597 }
598 
600 {
601  double sqw = 0.0;
602  double sqx = 0.0;
603  double sqy = 0.0;
604  double sqz = 0.0;
605  double norm = 0.0;
606  double delta = 0.0;
607 
608  if (this->_loadQuaternion() != YAPI_SUCCESS) {
609  return YAPI_DEVICE_NOT_FOUND;
610  }
611  if (_angles_stamp != _qt_stamp) {
612  sqw = _w * _w;
613  sqx = _x * _x;
614  sqy = _y * _y;
615  sqz = _z * _z;
616  norm = sqx + sqy + sqz + sqw;
617  delta = _y * _w - _x * _z;
618  if (delta > 0.499 * norm) {
619  // singularity at north pole
620  _pitch = 90.0;
621  _head = floor(2.0 * 1800.0/3.141592653589793238463 * atan2(_x,-_w)+0.5) / 10.0;
622  } else {
623  if (delta < -0.499 * norm) {
624  // singularity at south pole
625  _pitch = -90.0;
626  _head = floor(-2.0 * 1800.0/3.141592653589793238463 * atan2(_x,-_w)+0.5) / 10.0;
627  } else {
628  _roll = floor(1800.0/3.141592653589793238463 * atan2(2.0 * (_w * _x + _y * _z),sqw - sqx - sqy + sqz)+0.5) / 10.0;
629  _pitch = floor(1800.0/3.141592653589793238463 * asin(2.0 * delta / norm)+0.5) / 10.0;
630  _head = floor(1800.0/3.141592653589793238463 * atan2(2.0 * (_x * _y + _z * _w),sqw + sqx - sqy - sqz)+0.5) / 10.0;
631  }
632  }
634  }
635  return YAPI_SUCCESS;
636 }
637 
649 double YGyro::get_roll(void)
650 {
651  this->_loadAngles();
652  return _roll;
653 }
654 
666 double YGyro::get_pitch(void)
667 {
668  this->_loadAngles();
669  return _pitch;
670 }
671 
683 double YGyro::get_heading(void)
684 {
685  this->_loadAngles();
686  return _head;
687 }
688 
699 {
700  this->_loadQuaternion();
701  return _w;
702 }
703 
715 {
716  this->_loadQuaternion();
717  return _x;
718 }
719 
731 {
732  this->_loadQuaternion();
733  return _y;
734 }
735 
747 {
748  this->_loadQuaternion();
749  return _z;
750 }
751 
768 {
769  _quatCallback = callback;
770  if (callback != NULL) {
771  if (this->_loadQuaternion() != YAPI_SUCCESS) {
772  return YAPI_DEVICE_NOT_FOUND;
773  }
774  _qt_w->set_userData(this);
775  _qt_x->set_userData(this);
776  _qt_y->set_userData(this);
777  _qt_z->set_userData(this);
782  } else {
783  if (!(_anglesCallback != NULL)) {
788  }
789  }
790  return 0;
791 }
792 
809 {
810  _anglesCallback = callback;
811  if (callback != NULL) {
812  if (this->_loadQuaternion() != YAPI_SUCCESS) {
813  return YAPI_DEVICE_NOT_FOUND;
814  }
815  _qt_w->set_userData(this);
816  _qt_x->set_userData(this);
817  _qt_y->set_userData(this);
818  _qt_z->set_userData(this);
823  } else {
824  if (!(_quatCallback != NULL)) {
829  }
830  }
831  return 0;
832 }
833 
834 int YGyro::_invokeGyroCallbacks(int qtIndex,double qtValue)
835 {
836  switch(qtIndex - 1) {
837  case 0:
838  _w = qtValue;
839  break;
840  case 1:
841  _x = qtValue;
842  break;
843  case 2:
844  _y = qtValue;
845  break;
846  case 3:
847  _z = qtValue;
848  break;
849  }
850  if (qtIndex < 4) {
851  return 0;
852  }
853  _qt_stamp = (int) ((YAPI::GetTickCount()) & (0x7FFFFFFF));
854  if (_quatCallback != NULL) {
855  _quatCallback(this, _w, _x, _y, _z);
856  }
857  if (_anglesCallback != NULL) {
858  this->_loadAngles();
860  }
861  return 0;
862 }
863 
865 {
866  string hwid;
867 
868  if(YISERR(_nextFunction(hwid)) || hwid=="") {
869  return NULL;
870  }
871  return YGyro::FindGyro(hwid);
872 }
873 
875 {
876  vector<YFUN_DESCR> v_fundescr;
877  YDEV_DESCR ydevice;
878  string serial, funcId, funcName, funcVal, errmsg;
879 
880  if(YISERR(YapiWrapper::getFunctionsByClass("Gyro", 0, v_fundescr, sizeof(YFUN_DESCR), errmsg)) ||
881  v_fundescr.size() == 0 ||
882  YISERR(YapiWrapper::getFunctionInfo(v_fundescr[0], ydevice, serial, funcId, funcName, funcVal, errmsg))) {
883  return NULL;
884  }
885  return YGyro::FindGyro(serial+"."+funcId);
886 }
887 
888 //--- (end of generated code: YGyro implementation)
889 
890 //--- (generated code: YGyro functions)
891 //--- (end of generated code: YGyro functions)
int set_bandwidth(int newval)
Definition: yocto_gyro.cpp:334
string _advertisedValue
Definition: yocto_api.h:1569
double getDouble(const string &key)
Definition: yocto_api.cpp:796
virtual int registerAnglesCallback(YAnglesCallback callback)
Definition: yocto_gyro.cpp:808
yCRITICAL_SECTION _this_cs
Definition: yocto_api.h:1563
double _y
Definition: yocto_gyro.h:283
virtual int registerQuaternionCallback(YQuatCallback callback)
Definition: yocto_gyro.cpp:767
YQt * _qt_y
Definition: yocto_gyro.h:279
static const double ZVALUE_INVALID
Definition: yocto_gyro.h:309
static void _UpdateTimedReportCallbackList(YFunction *func, bool add)
Definition: yocto_api.cpp:3531
YQt * _qt_x
Definition: yocto_gyro.h:278
double _pitch
Definition: yocto_gyro.h:287
double _w
Definition: yocto_gyro.h:281
YRETCODE _load_unsafe(int msValidity)
Definition: yocto_api.cpp:3327
static YGyro * FirstGyro(void)
Definition: yocto_gyro.cpp:874
virtual int _loadAngles(void)
Definition: yocto_gyro.cpp:599
virtual int _invokeGyroCallbacks(int qtIndex, double qtValue)
Definition: yocto_gyro.cpp:834
virtual int _loadQuaternion(void)
Definition: yocto_gyro.cpp:562
double _zValue
Definition: yocto_gyro.h:273
YQuatCallback _quatCallback
Definition: yocto_gyro.h:289
void(* YQtTimedReportCallback)(YQt *func, YMeasure measure)
Definition: yocto_gyro.h:56
double _roll
Definition: yocto_gyro.h:288
virtual double get_heading(void)
Definition: yocto_gyro.cpp:683
static YQt * FindQt(string func)
Definition: yocto_gyro.cpp:98
YGyroValueCallback _valueCallbackGyro
Definition: yocto_gyro.h:274
YQt * _qt_w
Definition: yocto_gyro.h:277
static int DefaultCacheValidity
Definition: yocto_api.h:468
YQtValueCallback _valueCallbackQt
Definition: yocto_gyro.h:75
void(* YQtValueCallback)(YQt *func, const string &functionValue)
Definition: yocto_gyro.h:54
YGyro(const string &func)
Definition: yocto_gyro.cpp:238
double _yValue
Definition: yocto_gyro.h:272
virtual double get_quaternionY(void)
Definition: yocto_gyro.cpp:730
int _qt_stamp
Definition: yocto_gyro.h:276
double _head
Definition: yocto_gyro.h:286
u64 _cacheExpiration
Definition: yocto_api.h:1571
string _serial
Definition: yocto_api.h:1572
void set_userData(void *data)
Definition: yocto_api.cpp:3486
~YQt()
Definition: yocto_gyro.cpp:62
double _z
Definition: yocto_gyro.h:284
YRETCODE load(int msValidity)
Definition: yocto_api.cpp:3391
void yLeaveCriticalSection(yCRITICAL_SECTION *cs)
Definition: ythread.c:672
virtual double get_roll(void)
Definition: yocto_gyro.cpp:649
int get_bandwidth(void)
Definition: yocto_gyro.cpp:302
static YRETCODE getFunctionInfo(YFUN_DESCR fundesc, YDEV_DESCR &devdescr, string &serial, string &funcId, string &funcName, string &funcVal, string &errmsg)
Definition: yocto_api.cpp:4930
YQt * nextQt(void)
Definition: yocto_gyro.cpp:193
double get_yValue(void)
Definition: yocto_gyro.cpp:388
double get_currentValue(void)
Definition: yocto_api.cpp:7091
virtual double get_quaternionX(void)
Definition: yocto_gyro.cpp:714
void * get_userData(void)
Definition: yocto_api.cpp:3469
string get_functionId(void)
Definition: yocto_api.cpp:3229
YAnglesCallback _anglesCallback
Definition: yocto_gyro.h:290
virtual int registerValueCallback(YGyroValueCallback callback)
Definition: yocto_gyro.cpp:499
virtual int registerValueCallback(YQtValueCallback callback)
Definition: yocto_gyro.cpp:130
static YGyro * FindGyro(string func)
Definition: yocto_gyro.cpp:467
YAPI_FUNCTION YFUN_DESCR
Definition: yocto_api.h:230
int getInt(const string &key)
Definition: yocto_api.cpp:779
static u64 GetTickCount(void)
Definition: yocto_api.cpp:4755
static void _AddToCache(const string &classname, const string &func, YFunction *obj)
Definition: yocto_api.cpp:2345
static const double XVALUE_INVALID
Definition: yocto_gyro.h:307
double _xValue
Definition: yocto_gyro.h:271
#define YAPI_INVALID_DOUBLE
Definition: yocto_api.h:73
virtual int _invokeTimedReportCallback(YMeasure value)
Definition: yocto_api.cpp:7936
int _angles_stamp
Definition: yocto_gyro.h:285
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:7645
void(* YQuatCallback)(YGyro *yGyro, double w, double x, double y, double z)
Definition: yocto_gyro.h:245
YAPI_DEVICE YDEV_DESCR
Definition: yocto_api.h:229
static YFunction * _FindFromCache(const string &classname, const string &func)
Definition: yocto_api.cpp:2338
virtual int _invokeTimedReportCallback(YMeasure value)
Definition: yocto_gyro.cpp:183
virtual double get_quaternionZ(void)
Definition: yocto_gyro.cpp:746
YGyro * nextGyro(void)
Definition: yocto_gyro.cpp:864
static string ysprintf(const char *fmt,...)
Definition: yocto_api.cpp:4997
virtual int _invokeValueCallback(string value)
Definition: yocto_gyro.cpp:518
void yEnterCriticalSection(yCRITICAL_SECTION *cs)
Definition: ythread.c:647
static yCRITICAL_SECTION _global_cs
Definition: yocto_api.h:476
virtual double get_quaternionW(void)
Definition: yocto_gyro.cpp:698
bool isOnline(void)
Definition: yocto_api.cpp:3291
virtual int _invokeTimedReportCallback(YMeasure value)
Definition: yocto_gyro.cpp:552
static const double YVALUE_INVALID
Definition: yocto_gyro.h:308
double _x
Definition: yocto_gyro.h:282
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:7015
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_gyro.cpp:277
static int getFunctionsByClass(const string &class_str, YFUN_DESCR prevfundesc, vector< YFUN_DESCR > &buffer, int maxsize, string &errmsg)
Definition: yocto_api.cpp:4852
YQt * _qt_z
Definition: yocto_gyro.h:280
string _className
Definition: yocto_api.h:1558
YQt(const string &func)
Definition: yocto_gyro.cpp:53
static void yInternalGyroCallback(YQt *obj, const string &value)
Definition: yocto_gyro.cpp:223
YQtTimedReportCallback _timedReportCallbackQt
Definition: yocto_gyro.h:76
Definition: yocto_gyro.h:67
virtual int registerTimedReportCallback(YQtTimedReportCallback callback)
Definition: yocto_gyro.cpp:170
static const int BANDWIDTH_INVALID
Definition: yocto_gyro.h:306
double get_xValue(void)
Definition: yocto_gyro.cpp:358
void(* YGyroTimedReportCallback)(YGyro *func, YMeasure measure)
Definition: yocto_gyro.h:238
static bool _apiInitialized
Definition: yocto_api.h:475
YRETCODE _nextFunction(string &hwId)
Definition: yocto_api.cpp:2709
virtual int registerTimedReportCallback(YGyroTimedReportCallback callback)
Definition: yocto_gyro.cpp:539
virtual int _invokeValueCallback(string value)
Definition: yocto_gyro.cpp:149
virtual double get_pitch(void)
Definition: yocto_gyro.cpp:666
static void _UpdateValueCallbackList(YFunction *func, bool add)
Definition: yocto_api.cpp:3509
#define YISERR(retcode)
Definition: ydef.h:394
void(* YAnglesCallback)(YGyro *yGyro, double roll, double pitch, double head)
Definition: yocto_gyro.h:246
double get_zValue(void)
Definition: yocto_gyro.cpp:418
YGyroTimedReportCallback _timedReportCallbackGyro
Definition: yocto_gyro.h:275
bool has(const string &key)
Definition: yocto_api.cpp:735
YRETCODE _setAttr(string attrname, string newvalue)
Definition: yocto_api.cpp:2968
int _bandwidth
Definition: yocto_gyro.h:270
void(* YGyroValueCallback)(YGyro *func, const string &functionValue)
Definition: yocto_gyro.h:236
static YQt * FirstQt(void)
Definition: yocto_gyro.cpp:203


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