diff options
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) |