From 939fd8f37fdab0941ae8eb3125bab572a97a0b26 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 31 Mar 2018 00:02:48 +0100 Subject: strings everywhere --- src/standalone.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/standalone.cpp') 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 #include #include -#include +#include #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 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(pData); + const char* temp = static_cast(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; } -- cgit v1.2.3