I was working on a piece of code that declares a few cloud variables, e.g.:
Particle.function("SetMode", SetMode);
Particle.variable("wifi", &wifi, INT);
Particle.variable("tHour", &tHour, INT);
Particle.variable("speed", &speedIndex, INT);
Particle.variable("brightness", &brightness, INT);
Particle.variable("modeList", &modeList, STRING);
Particle.variable("mode", ¤tModeName, STRING);
Had this working for weeks, and now (literally, just now) without me having even touched any of that code, the cloud IDE started spitting the following error message:
error: no matching function for call to 'CloudClass::variable(const char [9], char ()[622], const CloudVariableTypeString&)'
void colorChaser(uint32_t c);
note: candidates are:
In file included from ../wiring/inc/spark_wiring.h:46:0,
from ./inc/application.h:36,
from sparkpixels.cpp:36:
../wiring/inc/spark_wiring_cloud.h:48:24: note: static bool CloudClass::variable(const char, const uint8_t*, const CloudVariableTypeString&)
static inline bool variable(const char varKey, const uint8_t userVar, const CloudVariableTypeString& userVarType)
^
../wiring/inc/spark_wiring_cloud.h:48:24: note: no known conversion for argument 2 from 'char ()[622]' to 'const uint8_t {aka const unsigned char*}'
../wiring/inc/spark_wiring_cloud.h:53:45: note: static bool CloudClass::variable(const char*, typename T::varref, const T&) [with T = CloudVariableTypeString; typename T::varref = const char*]
template static inline bool variable(const char varKey, const typename T::varref userVar, const T& userVarType)
^
../wiring/inc/spark_wiring_cloud.h:53:45: note: no known conversion for argument 2 from 'char ()[622]' to 'CloudVariableTypeString::varref {aka const char*}'
In file included from ../wiring/inc/spark_wiring.h:46:0,
from ./inc/application.h:36,
from sparkpixels.cpp:36:
../wiring/inc/spark_wiring_cloud.h:58:24: note: static bool CloudClass::variable(const char*, const uint32_t*, const CloudVariableTypeInt&)
static inline bool variable(const char varKey, const uint32_t userVar, const CloudVariableTypeInt& userVarType)
^
../wiring/inc/spark_wiring_cloud.h:58:24: note: no known conversion for argument 2 from 'char ()[622]' to 'const uint32_t {aka const long unsigned int*}'
error: no matching function for call to 'CloudClass::variable(const char [5], char ()[64], const CloudVariableTypeString&)'
void pulse_oneColorAll(void);
note: candidates are:
In file included from ../wiring/inc/spark_wiring.h:46:0,
from ./inc/application.h:36,
from sparkpixels.cpp:36:
../wiring/inc/spark_wiring_cloud.h:48:24: note: static bool CloudClass::variable(const char, const uint8_t*, const CloudVariableTypeString&)
static inline bool variable(const char varKey, const uint8_t userVar, const CloudVariableTypeString& userVarType)
^
../wiring/inc/spark_wiring_cloud.h:48:24: note: no known conversion for argument 2 from 'char ()[64]' to 'const uint8_t {aka const unsigned char*}'
../wiring/inc/spark_wiring_cloud.h:53:45: note: static bool CloudClass::variable(const char*, typename T::varref, const T&) [with T = CloudVariableTypeString; typename T::varref = const char*]
template static inline bool variable(const char varKey, const typename T::varref userVar, const T& userVarType)
^
../wiring/inc/spark_wiring_cloud.h:53:45: note: no known conversion for argument 2 from 'char ()[64]' to 'CloudVariableTypeString::varref {aka const char*}'
In file included from ../wiring/inc/spark_wiring.h:46:0,
from ./inc/application.h:36,
from sparkpixels.cpp:36:
../wiring/inc/spark_wiring_cloud.h:58:24: note: static bool CloudClass::variable(const char*, const uint32_t*, const CloudVariableTypeInt&)
static inline bool variable(const char varKey, const uint32_t userVar, const CloudVariableTypeInt& userVarType)
^
../wiring/inc/spark_wiring_cloud.h:58:24: note: no known conversion for argument 2 from 'char ()[64]' to 'const uint32_t {aka const long unsigned int*}'
error: no matching function for call to 'CloudClass::variable(const char [6], char ()[200], const CloudVariableTypeString&)'
void police_light_strobo(void);
note: candidates are:
In file included from ../wiring/inc/spark_wiring.h:46:0,
from ./inc/application.h:36,
from sparkpixels.cpp:36:
../wiring/inc/spark_wiring_cloud.h:48:24: note: static bool CloudClass::variable(const char, const uint8_t*, const CloudVariableTypeString&)
static inline bool variable(const char varKey, const uint8_t userVar, const CloudVariableTypeString& userVarType)
^
../wiring/inc/spark_wiring_cloud.h:48:24: note: no known conversion for argument 2 from 'char ()[200]' to 'const uint8_t {aka const unsigned char*}'
../wiring/inc/spark_wiring_cloud.h:53:45: note: static bool CloudClass::variable(const char*, typename T::varref, const T&) [with T = CloudVariableTypeString; typename T::varref = const char*]
template static inline bool variable(const char varKey, const typename T::varref userVar, const T& userVarType)
^
../wiring/inc/spark_wiring_cloud.h:53:45: note: no known conversion for argument 2 from 'char ()[200]' to 'CloudVariableTypeString::varref {aka const char*}'
In file included from ../wiring/inc/spark_wiring.h:46:0,
from ./inc/application.h:36,
from sparkpixels.cpp:36:
../wiring/inc/spark_wiring_cloud.h:58:24: note: static bool CloudClass::variable(const char*, const uint32_t*, const CloudVariableTypeInt&)
static inline bool variable(const char varKey, const uint32_t userVar, const CloudVariableTypeInt& userVarType)
^
../wiring/inc/spark_wiring_cloud.h:58:24: note: no known conversion for argument 2 from 'char ()[200]' to 'const uint32_t {aka const long unsigned int*}'
sparkpixels.cpp:272:21: warning: zero-length gnu_printf format string [-Wformat-zero-length]
defaultColor = strip.Color((255 * .5),(255 * .5),(60 * .5)); // This seems close to incandescent color
^
sparkpixels.cpp:272:21: warning: zero-length gnu_printf format string [-Wformat-zero-length]
sparkpixels.cpp: In function 'int colorAll(uint32_t)':
sparkpixels.cpp:437:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
//Used in all modes to set the brightness, show the lights, process Spark events and delay
^
sparkpixels.cpp: In function 'void colorChaser(uint32_t)':
sparkpixels.cpp:484:17: warning: unused variable 'j' [-Wunused-variable]
}
^
sparkpixels.cpp: In function 'void fadeInToColor(uint32_t, Color)':
sparkpixels.cpp:1088:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Color retVal;
^
make[1]: *** [../build/target/user/platform-6sparkpixels.o] Error 1
make: *** [user] Error 2
Error: Could not compile. Please review your code.
This just stopped working. As if something in the cloud or somewhere, was changed without my knowledge.
Now I can't compile my code. Can't even decypher what the heck these cryptic Cloud::variable messages refer to - it's like someone decided to remove the function signature from the cloud or something.
Very - no wait - VERY!!! - frustrated right now. Showstopper.