diff options
author | dakkar <dakkar@thenautilus.net> | 2018-03-31 00:02:48 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2018-03-31 00:02:48 +0100 |
commit | 3ded39fe0062799b1781575641a3f5446e446d1c (patch) | |
tree | 8353a678b68717d61199efeb6a75206dd0319a17 /src/Server.cpp | |
parent | boh (diff) | |
download | gobbledegook-3ded39fe0062799b1781575641a3f5446e446d1c.tar.gz gobbledegook-3ded39fe0062799b1781575641a3f5446e446d1c.tar.bz2 gobbledegook-3ded39fe0062799b1781575641a3f5446e446d1c.zip |
strings everywhere
Diffstat (limited to 'src/Server.cpp')
-rw-r--r-- | src/Server.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Server.cpp b/src/Server.cpp index 4651ccf..f3464c6 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -299,15 +299,15 @@ Server::Server(const std::string &serviceName, const std::string &advertisingNam // Standard characteristic "ReadValue" method call .onReadValue(CHARACTERISTIC_METHOD_CALLBACK_LAMBDA { - int16_t temperature = self.getDataValue<int16_t>("room-1", 0); + const char *temperature = self.getDataPointer<const char*>("room-1", ""); self.methodReturnValue(pInvocation, temperature, true); }) // Standard characteristic "WriteValue" method call .onWriteValue(CHARACTERISTIC_METHOD_CALLBACK_LAMBDA { - GVariant *pValue = g_variant_get_child_value(pParameters, 0); - self.setDataValue("room-1", g_variant_get_int16(pValue)); + GVariant *pValue = g_variant_get_child_value(pParameters, 0); + self.setDataPointer("room-1", Utils::stringFromGVariantByteArray(pValue).c_str()); }) // GATT Descriptor: Characteristic User Description (0x2901) @@ -332,7 +332,7 @@ Server::Server(const std::string &serviceName, const std::string &advertisingNam // Standard characteristic "ReadValue" method call .onReadValue(CHARACTERISTIC_METHOD_CALLBACK_LAMBDA { - int16_t temperature = self.getDataValue<int16_t>("room-2", 0); + const char *temperature = self.getDataPointer<const char*>("room-2", ""); self.methodReturnValue(pInvocation, temperature, true); }) @@ -340,7 +340,7 @@ Server::Server(const std::string &serviceName, const std::string &advertisingNam .onWriteValue(CHARACTERISTIC_METHOD_CALLBACK_LAMBDA { GVariant *pValue = g_variant_get_child_value(pParameters, 0); - self.setDataValue("room-2", g_variant_get_int16(pValue)); + self.setDataPointer("room-2", Utils::stringFromGVariantByteArray(pValue).c_str()); }) // GATT Descriptor: Characteristic User Description (0x2901) |