From f25b7cc6f91fa0f9abf457433fdd9c32ee229b24 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Tue, 17 Jan 2017 09:58:04 +1000 Subject: [PATCH] Template for the String datatype for Particle Variable was not being used. Moved and 'fixed up' the template for the String Partice Variable to OakParticle.h. It looks like it was missed when DarkLotus did his changes in https://github.com/digistump/OakCore/pull/37 --- cores/oak/OakParticle/OakParticle.cpp | 8 -------- cores/oak/OakParticle/OakParticle.h | 8 +++++++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/cores/oak/OakParticle/OakParticle.cpp b/cores/oak/OakParticle/OakParticle.cpp index a9a5eeb..0673e8f 100644 --- a/cores/oak/OakParticle/OakParticle.cpp +++ b/cores/oak/OakParticle/OakParticle.cpp @@ -7,14 +7,6 @@ using namespace particle_core; CloudClass::CloudClass(){ spark_initConfig(false); } -template -bool CloudClass::variable(const T *varKey, const String *userVar, const CloudVariableTypeString& userVarType) -{ - spark_variable_t extra; - extra.size = sizeof(extra); - extra.update = update_string_variable; - return CLOUD_FN(spark_variable(varKey, userVar, CloudVariableTypeString::value(), &extra), false); -} bool CloudClass::function(const char *funcKey, user_function_int_str_t* func) { diff --git a/cores/oak/OakParticle/OakParticle.h b/cores/oak/OakParticle/OakParticle.h index 8f1acb9..8f5812f 100644 --- a/cores/oak/OakParticle/OakParticle.h +++ b/cores/oak/OakParticle/OakParticle.h @@ -118,7 +118,13 @@ class CloudClass : public Stream { } template - static bool variable(const T *varKey, const String *userVar, const particle_core::CloudVariableTypeString& userVarType); + static inline bool variable(const T *varKey, const String *userVar, const particle_core::CloudVariableTypeString& userVarType) + { + particle_core::spark_variable_t extra; + extra.size = sizeof(extra); + extra.update = update_string_variable; + return CLOUD_FN(spark_variable(varKey, userVar, particle_core::CloudVariableTypeString::value(), &extra), false); + } template static inline bool variable(const T *varKey, const String &userVar, const particle_core::CloudVariableTypeString& userVarType)