aboutsummaryrefslogtreecommitdiff
path: root/src/Server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Server.cpp')
-rw-r--r--src/Server.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Server.cpp b/src/Server.cpp
index 0917523..7e7e0f8 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -300,15 +300,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)
@@ -333,7 +333,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);
})
@@ -341,7 +341,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)