yocto_colorledcluster.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_colorledcluster.cpp 29186 2017-11-16 10:04:13Z seb $
4  *
5  * Implements yFindColorLedCluster(), the high-level API for ColorLedCluster 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_colorledcluster.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__ "colorledcluster"
50 
52 //--- (YColorLedCluster initialization)
53  ,_activeLedCount(ACTIVELEDCOUNT_INVALID)
54  ,_maxLedCount(MAXLEDCOUNT_INVALID)
55  ,_blinkSeqMaxCount(BLINKSEQMAXCOUNT_INVALID)
56  ,_blinkSeqMaxSize(BLINKSEQMAXSIZE_INVALID)
57  ,_command(COMMAND_INVALID)
58  ,_valueCallbackColorLedCluster(NULL)
59 //--- (end of YColorLedCluster initialization)
60 {
61  _className="ColorLedCluster";
62 }
63 
65 {
66 //--- (YColorLedCluster cleanup)
67 //--- (end of YColorLedCluster cleanup)
68 }
69 //--- (YColorLedCluster implementation)
70 // static attributes
72 
74 {
75  if(json_val->has("activeLedCount")) {
76  _activeLedCount = json_val->getInt("activeLedCount");
77  }
78  if(json_val->has("maxLedCount")) {
79  _maxLedCount = json_val->getInt("maxLedCount");
80  }
81  if(json_val->has("blinkSeqMaxCount")) {
82  _blinkSeqMaxCount = json_val->getInt("blinkSeqMaxCount");
83  }
84  if(json_val->has("blinkSeqMaxSize")) {
85  _blinkSeqMaxSize = json_val->getInt("blinkSeqMaxSize");
86  }
87  if(json_val->has("command")) {
88  _command = json_val->getString("command");
89  }
90  return YFunction::_parseAttr(json_val);
91 }
92 
93 
102 {
103  int res = 0;
105  try {
108  {
111  }
112  }
113  }
114  res = _activeLedCount;
115  } catch (std::exception) {
117  throw;
118  }
120  return res;
121 }
122 
133 {
134  string rest_val;
135  int res;
137  try {
138  char buf[32]; sprintf(buf, "%d", newval); rest_val = string(buf);
139  res = _setAttr("activeLedCount", rest_val);
140  } catch (std::exception) {
142  throw;
143  }
145  return res;
146 }
147 
156 {
157  int res = 0;
159  try {
160  if (_cacheExpiration == 0) {
162  {
165  }
166  }
167  }
168  res = _maxLedCount;
169  } catch (std::exception) {
171  throw;
172  }
174  return res;
175 }
176 
185 {
186  int res = 0;
188  try {
189  if (_cacheExpiration == 0) {
191  {
194  }
195  }
196  }
197  res = _blinkSeqMaxCount;
198  } catch (std::exception) {
200  throw;
201  }
203  return res;
204 }
205 
214 {
215  int res = 0;
217  try {
218  if (_cacheExpiration == 0) {
220  {
223  }
224  }
225  }
226  res = _blinkSeqMaxSize;
227  } catch (std::exception) {
229  throw;
230  }
232  return res;
233 }
234 
236 {
237  string res;
239  try {
242  {
245  }
246  }
247  }
248  res = _command;
249  } catch (std::exception) {
251  throw;
252  }
254  return res;
255 }
256 
257 int YColorLedCluster::set_command(const string& newval)
258 {
259  string rest_val;
260  int res;
262  try {
263  rest_val = newval;
264  res = _setAttr("command", rest_val);
265  } catch (std::exception) {
267  throw;
268  }
270  return res;
271 }
272 
301 {
302  YColorLedCluster* obj = NULL;
303  int taken = 0;
304  if (YAPI::_apiInitialized) {
306  taken = 1;
307  }try {
308  obj = (YColorLedCluster*) YFunction::_FindFromCache("ColorLedCluster", func);
309  if (obj == NULL) {
310  obj = new YColorLedCluster(func);
311  YFunction::_AddToCache("ColorLedCluster", func, obj);
312  }
313  } catch (std::exception) {
315  throw;
316  }
318  return obj;
319 }
320 
333 {
334  string val;
335  if (callback != NULL) {
337  } else {
339  }
341  // Immediately invoke value callback with current value
342  if (callback != NULL && this->isOnline()) {
343  val = _advertisedValue;
344  if (!(val == "")) {
345  this->_invokeValueCallback(val);
346  }
347  }
348  return 0;
349 }
350 
352 {
353  if (_valueCallbackColorLedCluster != NULL) {
354  _valueCallbackColorLedCluster(this, value);
355  } else {
357  }
358  return 0;
359 }
360 
362 {
363  return this->set_command(command);
364 }
365 
378 int YColorLedCluster::set_rgbColor(int ledIndex,int count,int rgbValue)
379 {
380  return this->sendCommand(YapiWrapper::ysprintf("SR%d,%d,%x",ledIndex,count,rgbValue));
381 }
382 
397 int YColorLedCluster::set_rgbColorAtPowerOn(int ledIndex,int count,int rgbValue)
398 {
399  return this->sendCommand(YapiWrapper::ysprintf("SC%d,%d,%x",ledIndex,count,rgbValue));
400 }
401 
414 int YColorLedCluster::set_hslColor(int ledIndex,int count,int hslValue)
415 {
416  return this->sendCommand(YapiWrapper::ysprintf("SH%d,%d,%x",ledIndex,count,hslValue));
417 }
418 
432 int YColorLedCluster::rgb_move(int ledIndex,int count,int rgbValue,int delay)
433 {
434  return this->sendCommand(YapiWrapper::ysprintf("MR%d,%d,%x,%d",ledIndex,count,rgbValue,delay));
435 }
436 
454 int YColorLedCluster::hsl_move(int ledIndex,int count,int hslValue,int delay)
455 {
456  return this->sendCommand(YapiWrapper::ysprintf("MH%d,%d,%x,%d",ledIndex,count,hslValue,delay));
457 }
458 
472 int YColorLedCluster::addRgbMoveToBlinkSeq(int seqIndex,int rgbValue,int delay)
473 {
474  return this->sendCommand(YapiWrapper::ysprintf("AR%d,%x,%d",seqIndex,rgbValue,delay));
475 }
476 
490 int YColorLedCluster::addHslMoveToBlinkSeq(int seqIndex,int hslValue,int delay)
491 {
492  return this->sendCommand(YapiWrapper::ysprintf("AH%d,%x,%d",seqIndex,hslValue,delay));
493 }
494 
509 {
510  return this->sendCommand(YapiWrapper::ysprintf("AC%d,0,0",seqIndex));
511 }
512 
525 int YColorLedCluster::addJumpToBlinkSeq(int seqIndex,int linkSeqIndex)
526 {
527  return this->sendCommand(YapiWrapper::ysprintf("AC%d,100,%d,1000",seqIndex,linkSeqIndex));
528 }
529 
542 {
543  return this->sendCommand(YapiWrapper::ysprintf("AC%d,100,-1,1000",seqIndex));
544 }
545 
561 int YColorLedCluster::linkLedToBlinkSeq(int ledIndex,int count,int seqIndex,int offset)
562 {
563  return this->sendCommand(YapiWrapper::ysprintf("LS%d,%d,%d,%d",ledIndex,count,seqIndex,offset));
564 }
565 
581 int YColorLedCluster::linkLedToBlinkSeqAtPowerOn(int ledIndex,int count,int seqIndex,int offset)
582 {
583  return this->sendCommand(YapiWrapper::ysprintf("LO%d,%d,%d,%d",ledIndex,count,seqIndex,offset));
584 }
585 
601 int YColorLedCluster::linkLedToPeriodicBlinkSeq(int ledIndex,int count,int seqIndex,int periods)
602 {
603  return this->sendCommand(YapiWrapper::ysprintf("LP%d,%d,%d,%d",ledIndex,count,seqIndex,periods));
604 }
605 
616 int YColorLedCluster::unlinkLedFromBlinkSeq(int ledIndex,int count)
617 {
618  return this->sendCommand(YapiWrapper::ysprintf("US%d,%d",ledIndex,count));
619 }
620 
632 {
633  return this->sendCommand(YapiWrapper::ysprintf("SS%d",seqIndex));
634 }
635 
647 {
648  return this->sendCommand(YapiWrapper::ysprintf("XS%d",seqIndex));
649 }
650 
662 {
663  return this->sendCommand(YapiWrapper::ysprintf("ZS%d",seqIndex));
664 }
665 
679 int YColorLedCluster::set_blinkSeqStateAtPowerOn(int seqIndex,int autostart)
680 {
681  return this->sendCommand(YapiWrapper::ysprintf("AS%d,%d",seqIndex,autostart));
682 }
683 
696 int YColorLedCluster::set_blinkSeqSpeed(int seqIndex,int speed)
697 {
698  return this->sendCommand(YapiWrapper::ysprintf("CS%d,%d",seqIndex,speed));
699 }
700 
711 {
712  return this->sendCommand("WL");
713 }
714 
716 {
717  return this->sendCommand("WL");
718 }
719 
732 {
733  return this->sendCommand(YapiWrapper::ysprintf("WS%d",seqIndex));
734 }
735 
748 int YColorLedCluster::set_rgbColorBuffer(int ledIndex,string buff)
749 {
750  return this->_upload(YapiWrapper::ysprintf("rgb:0:%d",ledIndex), buff);
751 }
752 
765 int YColorLedCluster::set_rgbColorArray(int ledIndex,vector<int> rgbList)
766 {
767  int listlen = 0;
768  string buff;
769  int idx = 0;
770  int rgb = 0;
771  int res = 0;
772  listlen = (int)rgbList.size();
773  buff = string(3*listlen, (char)0);
774  idx = 0;
775  while (idx < listlen) {
776  rgb = rgbList[idx];
777  buff[3*idx] = (char)(((((rgb) >> (16))) & (255)));
778  buff[3*idx+1] = (char)(((((rgb) >> (8))) & (255)));
779  buff[3*idx+2] = (char)(((rgb) & (255)));
780  idx = idx + 1;
781  }
782 
783  res = this->_upload(YapiWrapper::ysprintf("rgb:0:%d",ledIndex), buff);
784  return res;
785 }
786 
800 int YColorLedCluster::rgbArrayOfs_move(int ledIndex,vector<int> rgbList,int delay)
801 {
802  int listlen = 0;
803  string buff;
804  int idx = 0;
805  int rgb = 0;
806  int res = 0;
807  listlen = (int)rgbList.size();
808  buff = string(3*listlen, (char)0);
809  idx = 0;
810  while (idx < listlen) {
811  rgb = rgbList[idx];
812  buff[3*idx] = (char)(((((rgb) >> (16))) & (255)));
813  buff[3*idx+1] = (char)(((((rgb) >> (8))) & (255)));
814  buff[3*idx+2] = (char)(((rgb) & (255)));
815  idx = idx + 1;
816  }
817 
818  res = this->_upload(YapiWrapper::ysprintf("rgb:%d:%d",delay,ledIndex), buff);
819  return res;
820 }
821 
834 int YColorLedCluster::rgbArray_move(vector<int> rgbList,int delay)
835 {
836  int res = 0;
837 
838  res = this->rgbArrayOfs_move(0,rgbList,delay);
839  return res;
840 }
841 
854 int YColorLedCluster::set_hslColorBuffer(int ledIndex,string buff)
855 {
856  return this->_upload(YapiWrapper::ysprintf("hsl:0:%d",ledIndex), buff);
857 }
858 
871 int YColorLedCluster::set_hslColorArray(int ledIndex,vector<int> hslList)
872 {
873  int listlen = 0;
874  string buff;
875  int idx = 0;
876  int hsl = 0;
877  int res = 0;
878  listlen = (int)hslList.size();
879  buff = string(3*listlen, (char)0);
880  idx = 0;
881  while (idx < listlen) {
882  hsl = hslList[idx];
883  buff[3*idx] = (char)(((((hsl) >> (16))) & (255)));
884  buff[3*idx+1] = (char)(((((hsl) >> (8))) & (255)));
885  buff[3*idx+2] = (char)(((hsl) & (255)));
886  idx = idx + 1;
887  }
888 
889  res = this->_upload(YapiWrapper::ysprintf("hsl:0:%d",ledIndex), buff);
890  return res;
891 }
892 
905 int YColorLedCluster::hslArray_move(vector<int> hslList,int delay)
906 {
907  int res = 0;
908 
909  res = this->hslArrayOfs_move(0,hslList, delay);
910  return res;
911 }
912 
926 int YColorLedCluster::hslArrayOfs_move(int ledIndex,vector<int> hslList,int delay)
927 {
928  int listlen = 0;
929  string buff;
930  int idx = 0;
931  int hsl = 0;
932  int res = 0;
933  listlen = (int)hslList.size();
934  buff = string(3*listlen, (char)0);
935  idx = 0;
936  while (idx < listlen) {
937  hsl = hslList[idx];
938  buff[3*idx] = (char)(((((hsl) >> (16))) & (255)));
939  buff[3*idx+1] = (char)(((((hsl) >> (8))) & (255)));
940  buff[3*idx+2] = (char)(((hsl) & (255)));
941  idx = idx + 1;
942  }
943 
944  res = this->_upload(YapiWrapper::ysprintf("hsl:%d:%d",delay,ledIndex), buff);
945  return res;
946 }
947 
960 string YColorLedCluster::get_rgbColorBuffer(int ledIndex,int count)
961 {
962  return this->_download(YapiWrapper::ysprintf("rgb.bin?typ=0&pos=%d&len=%d",3*ledIndex,3*count));
963 }
964 
977 vector<int> YColorLedCluster::get_rgbColorArray(int ledIndex,int count)
978 {
979  string buff;
980  vector<int> res;
981  int idx = 0;
982  int r = 0;
983  int g = 0;
984  int b = 0;
985 
986  buff = this->_download(YapiWrapper::ysprintf("rgb.bin?typ=0&pos=%d&len=%d",3*ledIndex,3*count));
987  res.clear();
988  idx = 0;
989  while (idx < count) {
990  r = ((u8)buff[3*idx]);
991  g = ((u8)buff[3*idx+1]);
992  b = ((u8)buff[3*idx+2]);
993  res.push_back(r*65536+g*256+b);
994  idx = idx + 1;
995  }
996  return res;
997 }
998 
1011 vector<int> YColorLedCluster::get_rgbColorArrayAtPowerOn(int ledIndex,int count)
1012 {
1013  string buff;
1014  vector<int> res;
1015  int idx = 0;
1016  int r = 0;
1017  int g = 0;
1018  int b = 0;
1019 
1020  buff = this->_download(YapiWrapper::ysprintf("rgb.bin?typ=4&pos=%d&len=%d",3*ledIndex,3*count));
1021  res.clear();
1022  idx = 0;
1023  while (idx < count) {
1024  r = ((u8)buff[3*idx]);
1025  g = ((u8)buff[3*idx+1]);
1026  b = ((u8)buff[3*idx+2]);
1027  res.push_back(r*65536+g*256+b);
1028  idx = idx + 1;
1029  }
1030  return res;
1031 }
1032 
1045 vector<int> YColorLedCluster::get_linkedSeqArray(int ledIndex,int count)
1046 {
1047  string buff;
1048  vector<int> res;
1049  int idx = 0;
1050  int seq = 0;
1051 
1052  buff = this->_download(YapiWrapper::ysprintf("rgb.bin?typ=1&pos=%d&len=%d",ledIndex,count));
1053  res.clear();
1054  idx = 0;
1055  while (idx < count) {
1056  seq = ((u8)buff[idx]);
1057  res.push_back(seq);
1058  idx = idx + 1;
1059  }
1060  return res;
1061 }
1062 
1075 vector<int> YColorLedCluster::get_blinkSeqSignatures(int seqIndex,int count)
1076 {
1077  string buff;
1078  vector<int> res;
1079  int idx = 0;
1080  int hh = 0;
1081  int hl = 0;
1082  int lh = 0;
1083  int ll = 0;
1084 
1085  buff = this->_download(YapiWrapper::ysprintf("rgb.bin?typ=2&pos=%d&len=%d",4*seqIndex,4*count));
1086  res.clear();
1087  idx = 0;
1088  while (idx < count) {
1089  hh = ((u8)buff[4*idx]);
1090  hl = ((u8)buff[4*idx+1]);
1091  lh = ((u8)buff[4*idx+2]);
1092  ll = ((u8)buff[4*idx+3]);
1093  res.push_back(((hh) << (24))+((hl) << (16))+((lh) << (8))+ll);
1094  idx = idx + 1;
1095  }
1096  return res;
1097 }
1098 
1109 vector<int> YColorLedCluster::get_blinkSeqStateSpeed(int seqIndex,int count)
1110 {
1111  string buff;
1112  vector<int> res;
1113  int idx = 0;
1114  int lh = 0;
1115  int ll = 0;
1116 
1117  buff = this->_download(YapiWrapper::ysprintf("rgb.bin?typ=6&pos=%d&len=%d",seqIndex,count));
1118  res.clear();
1119  idx = 0;
1120  while (idx < count) {
1121  lh = ((u8)buff[2*idx]);
1122  ll = ((u8)buff[2*idx+1]);
1123  res.push_back(((lh) << (8))+ll);
1124  idx = idx + 1;
1125  }
1126  return res;
1127 }
1128 
1139 vector<int> YColorLedCluster::get_blinkSeqStateAtPowerOn(int seqIndex,int count)
1140 {
1141  string buff;
1142  vector<int> res;
1143  int idx = 0;
1144  int started = 0;
1145 
1146  buff = this->_download(YapiWrapper::ysprintf("rgb.bin?typ=5&pos=%d&len=%d",seqIndex,count));
1147  res.clear();
1148  idx = 0;
1149  while (idx < count) {
1150  started = ((u8)buff[idx]);
1151  res.push_back(started);
1152  idx = idx + 1;
1153  }
1154  return res;
1155 }
1156 
1167 vector<int> YColorLedCluster::get_blinkSeqState(int seqIndex,int count)
1168 {
1169  string buff;
1170  vector<int> res;
1171  int idx = 0;
1172  int started = 0;
1173 
1174  buff = this->_download(YapiWrapper::ysprintf("rgb.bin?typ=3&pos=%d&len=%d",seqIndex,count));
1175  res.clear();
1176  idx = 0;
1177  while (idx < count) {
1178  started = ((u8)buff[idx]);
1179  res.push_back(started);
1180  idx = idx + 1;
1181  }
1182  return res;
1183 }
1184 
1186 {
1187  string hwid;
1188 
1189  if(YISERR(_nextFunction(hwid)) || hwid=="") {
1190  return NULL;
1191  }
1193 }
1194 
1196 {
1197  vector<YFUN_DESCR> v_fundescr;
1198  YDEV_DESCR ydevice;
1199  string serial, funcId, funcName, funcVal, errmsg;
1200 
1201  if(YISERR(YapiWrapper::getFunctionsByClass("ColorLedCluster", 0, v_fundescr, sizeof(YFUN_DESCR), errmsg)) ||
1202  v_fundescr.size() == 0 ||
1203  YISERR(YapiWrapper::getFunctionInfo(v_fundescr[0], ydevice, serial, funcId, funcName, funcVal, errmsg))) {
1204  return NULL;
1205  }
1206  return YColorLedCluster::FindColorLedCluster(serial+"."+funcId);
1207 }
1208 
1209 //--- (end of YColorLedCluster implementation)
1210 
1211 //--- (YColorLedCluster functions)
1212 //--- (end of YColorLedCluster functions)
string _advertisedValue
Definition: yocto_api.h:1569
yCRITICAL_SECTION _this_cs
Definition: yocto_api.h:1563
virtual vector< int > get_rgbColorArray(int ledIndex, int count)
virtual int set_hslColorBuffer(int ledIndex, string buff)
YRETCODE _load_unsafe(int msValidity)
Definition: yocto_api.cpp:3327
virtual string get_rgbColorBuffer(int ledIndex, int count)
virtual vector< int > get_blinkSeqStateSpeed(int seqIndex, int count)
virtual int set_hslColorArray(int ledIndex, vector< int > hslList)
virtual int hsl_move(int ledIndex, int count, int hslValue, int delay)
virtual int linkLedToBlinkSeq(int ledIndex, int count, int seqIndex, int offset)
virtual int addRgbMoveToBlinkSeq(int seqIndex, int rgbValue, int delay)
virtual int resetBlinkSeq(int seqIndex)
YRETCODE _upload(const string &path, const string &content)
Definition: yocto_api.cpp:3098
static int DefaultCacheValidity
Definition: yocto_api.h:468
string getString(const string &key)
Definition: yocto_api.cpp:773
void(* YColorLedClusterValueCallback)(YColorLedCluster *func, const string &functionValue)
u64 _cacheExpiration
Definition: yocto_api.h:1571
void yLeaveCriticalSection(yCRITICAL_SECTION *cs)
Definition: ythread.c:672
virtual int addJumpToBlinkSeq(int seqIndex, int linkSeqIndex)
string _download(const string &url)
Definition: yocto_api.cpp:3053
static YRETCODE getFunctionInfo(YFUN_DESCR fundesc, YDEV_DESCR &devdescr, string &serial, string &funcId, string &funcName, string &funcVal, string &errmsg)
Definition: yocto_api.cpp:4930
virtual int _parseAttr(YJSONObject *json_val)
virtual int addUnlinkToBlinkSeq(int seqIndex)
virtual vector< int > get_blinkSeqStateAtPowerOn(int seqIndex, int count)
virtual int addMirrorToBlinkSeq(int seqIndex)
virtual int unlinkLedFromBlinkSeq(int ledIndex, int count)
virtual int set_blinkSeqSpeed(int seqIndex, int speed)
virtual int hslArray_move(vector< int > hslList, int delay)
#define YAPI_INVALID_STRING
Definition: yocto_api.h:69
virtual int saveLedsConfigAtPowerOn(void)
virtual int rgbArray_move(vector< int > rgbList, int delay)
virtual int sendCommand(string command)
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:2367
virtual int addHslMoveToBlinkSeq(int seqIndex, int hslValue, int delay)
virtual int set_rgbColorBuffer(int ledIndex, string buff)
virtual int set_rgbColorArray(int ledIndex, vector< int > rgbList)
YAPI_FUNCTION YFUN_DESCR
Definition: yocto_api.h:230
int getInt(const string &key)
Definition: yocto_api.cpp:779
virtual int saveBlinkSeq(int seqIndex)
static u64 GetTickCount(void)
Definition: yocto_api.cpp:4755
static const int BLINKSEQMAXCOUNT_INVALID
static void _AddToCache(const string &classname, const string &func, YFunction *obj)
Definition: yocto_api.cpp:2345
virtual int set_rgbColor(int ledIndex, int count, int rgbValue)
virtual int linkLedToBlinkSeqAtPowerOn(int ledIndex, int count, int seqIndex, int offset)
static YColorLedCluster * FirstColorLedCluster(void)
int set_activeLedCount(int newval)
YAPI_DEVICE YDEV_DESCR
Definition: yocto_api.h:229
static YFunction * _FindFromCache(const string &classname, const string &func)
Definition: yocto_api.cpp:2338
static string ysprintf(const char *fmt,...)
Definition: yocto_api.cpp:4997
virtual vector< int > get_linkedSeqArray(int ledIndex, int count)
virtual vector< int > get_blinkSeqState(int seqIndex, int count)
void yEnterCriticalSection(yCRITICAL_SECTION *cs)
Definition: ythread.c:647
YColorLedCluster * nextColorLedCluster(void)
static yCRITICAL_SECTION _global_cs
Definition: yocto_api.h:476
bool isOnline(void)
Definition: yocto_api.cpp:3291
virtual int rgbArrayOfs_move(int ledIndex, vector< int > rgbList, int delay)
static int getFunctionsByClass(const string &class_str, YFUN_DESCR prevfundesc, vector< YFUN_DESCR > &buffer, int maxsize, string &errmsg)
Definition: yocto_api.cpp:4852
virtual int linkLedToPeriodicBlinkSeq(int ledIndex, int count, int seqIndex, int periods)
static const int BLINKSEQMAXSIZE_INVALID
string _className
Definition: yocto_api.h:1558
virtual int hslArrayOfs_move(int ledIndex, vector< int > hslList, int delay)
virtual int stopBlinkSeq(int seqIndex)
virtual vector< int > get_rgbColorArrayAtPowerOn(int ledIndex, int count)
static const int ACTIVELEDCOUNT_INVALID
virtual vector< int > get_blinkSeqSignatures(int seqIndex, int count)
virtual int set_blinkSeqStateAtPowerOn(int seqIndex, int autostart)
static bool _apiInitialized
Definition: yocto_api.h:475
YRETCODE _nextFunction(string &hwId)
Definition: yocto_api.cpp:2709
static const int MAXLEDCOUNT_INVALID
virtual int rgb_move(int ledIndex, int count, int rgbValue, int delay)
virtual int set_rgbColorAtPowerOn(int ledIndex, int count, int rgbValue)
static void _UpdateValueCallbackList(YFunction *func, bool add)
Definition: yocto_api.cpp:3509
#define YISERR(retcode)
Definition: ydef.h:394
virtual int saveLedsState(void)
bool has(const string &key)
Definition: yocto_api.cpp:735
virtual int _invokeValueCallback(string value)
virtual int set_hslColor(int ledIndex, int count, int hslValue)
YRETCODE _setAttr(string attrname, string newvalue)
Definition: yocto_api.cpp:2968
static YColorLedCluster * FindColorLedCluster(string func)
YColorLedCluster(const string &func)
virtual int registerValueCallback(YColorLedClusterValueCallback callback)
virtual int startBlinkSeq(int seqIndex)
int set_command(const string &newval)
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:2563
YColorLedClusterValueCallback _valueCallbackColorLedCluster
static const string COMMAND_INVALID


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