aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Nettle <nettlep@users.noreply.github.com>2019-01-08 16:32:12 -0600
committerGitHub <noreply@github.com>2019-01-08 16:32:12 -0600
commit820d11ef2eb6f87e1676c1feadfe3fcf2c132784 (patch)
treed91efa82328ce2d3f90bd2e53faf6f1d057aaecf
parentMerge pull request #13 from br101/disc-fix (diff)
parentReturn after WriteValue method, fixes #12 (diff)
downloadgobbledegook-820d11ef2eb6f87e1676c1feadfe3fcf2c132784.tar.gz
gobbledegook-820d11ef2eb6f87e1676c1feadfe3fcf2c132784.tar.bz2
gobbledegook-820d11ef2eb6f87e1676c1feadfe3fcf2c132784.zip
Merge pull request #15 from br101/method-return
Return after WriteValue method, fixes #12 #6
-rw-r--r--src/Server.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Server.cpp b/src/Server.cpp
index 47a74da..db1aa76 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -406,6 +406,11 @@ Server::Server(const std::string &serviceName, const std::string &advertisingNam
// Characteristic interface (which just so happens to be the same interface passed into our self
// parameter) we can that parameter to call our own onUpdatedValue method
self.callOnUpdatedValue(pConnection, pUserData);
+
+ // Note: Even though the WriteValue method returns void, it's important to return like this, so that a
+ // dbus "method_return" is sent, otherwise the client gets an error (ATT error code 0x0e"unlikely").
+ // Only "write-without-response" works without this
+ self.methodReturnVariant(pInvocation, NULL);
})
// Here we use the onUpdatedValue to set a callback that isn't exposed to BlueZ, but rather allows us to manage