diff options
author | Paul Nettle <nettlep@users.noreply.github.com> | 2019-01-08 16:32:12 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-08 16:32:12 -0600 |
commit | 820d11ef2eb6f87e1676c1feadfe3fcf2c132784 (patch) | |
tree | d91efa82328ce2d3f90bd2e53faf6f1d057aaecf /src/Server.cpp | |
parent | Merge pull request #13 from br101/disc-fix (diff) | |
parent | Return after WriteValue method, fixes #12 (diff) | |
download | gobbledegook-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
Diffstat (limited to 'src/Server.cpp')
-rw-r--r-- | src/Server.cpp | 5 |
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 |