diff options
Diffstat (limited to 'src/standalone.cpp')
-rw-r--r-- | src/standalone.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/standalone.cpp b/src/standalone.cpp index 57177cd..b86e64e 100644 --- a/src/standalone.cpp +++ b/src/standalone.cpp @@ -106,7 +106,7 @@ #include <iostream> #include <thread> #include <sstream> -#include <map> +#include <vector> #include "../include/Gobbledegook.h" @@ -121,7 +121,7 @@ static const int kMaxAsyncInitTimeoutMS = 30 * 1000; // Server data values // -static int16_t temperatures[] = {0,0,0,0,0}; +static std::vector<std::string> temperatures(5); // // Logging @@ -192,7 +192,7 @@ const void *dataGetter(const char *pName) LogInfo((std::string("reading: ")+strName).c_str()); char idx = strName.back(); - return &(temperatures[idx-'0']); + return temperatures[idx-'0'].c_str(); } // Called by the server when it wants to update a named value @@ -216,11 +216,11 @@ int dataSetter(const char *pName, const void *pData) std::string strName = pName; - int16_t temp = *static_cast<const int16_t *>(pData); + const char* temp = static_cast<const char *>(pData); char idx = strName.back(); temperatures[idx-'0']=temp; - LogDebug((std::string("Server data: temperature of ")+strName+" set to " + std::to_string(temp)).c_str()); + LogDebug((std::string("Server data: temperature of ")+strName+" set to " + temp).c_str()); return 1; } |