diff options
author | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-12-08 10:08:09 +0100 |
---|---|---|
committer | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-12-08 12:55:02 +0100 |
commit | 95e5647cf4b825b8bb86b76925aead7b554795d8 (patch) | |
tree | df7ba99fb948a0f571091ac2f569ddbb4cce35c8 /src/bluetooth/osx/osxbtcentralmanager_p.h | |
parent | dfc0a00c4fdde773e4e8154a8b51488fd10831d0 (diff) |
QLowEnergyConttroller - char/descriptor values (OS X/iOS)
While writing with response, Core Bluetooth does not
update characteristic/descriptor values in write notifications.
I have to 'cache' this values and report them back.
Also this patch fixes minor bugs in '-performNextWriteRequest':
while handling errors it's not enough just to call 'performNextWriteRequest:'
again, it must be in return statement or followed by 'return'.
Change-Id: I6e7ab7fe6f63ea84268bf6c7ea67e2939d524f91
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/osx/osxbtcentralmanager_p.h')
-rw-r--r-- | src/bluetooth/osx/osxbtcentralmanager_p.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/bluetooth/osx/osxbtcentralmanager_p.h b/src/bluetooth/osx/osxbtcentralmanager_p.h index 6d93816f..704053c6 100644 --- a/src/bluetooth/osx/osxbtcentralmanager_p.h +++ b/src/bluetooth/osx/osxbtcentralmanager_p.h @@ -138,15 +138,13 @@ struct LEWriteRequest typedef QQueue<LEWriteRequest> WriteQueue; -// It can happen that Qt's API wants to write something -// and expects the confirmation about this value written, -// but under the hood (Core Bluetooth) we have something like -// a special method without any values at all. -// To report our user a successful write, we have this map: -// handle -> value for a write operation. -// Since write operations are serialized, the key is guaranteed -// to be unique. -typedef QHash<QLowEnergyHandle, QByteArray> ValueHash; +// Core Bluetooth's write confirmation does not provide +// the updated value (characteristic or descriptor). +// But the Qt's Bluetooth API ('write with response') +// expects this updated value as a response, so we have +// to cache this write value and report it back. +// 'NSObject *' will require '__weak' with ARC. +typedef QHash<NSObject *, QByteArray> ValueHash; } |