summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/osx/osxbtperipheralmanager_p.h
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2016-11-04 10:07:01 +0100
committerAlex Blasche <alexander.blasche@qt.io>2016-11-04 10:19:35 +0000
commit78402e8f96a49462677cd07ae57c7d830228ec3b (patch)
tree78a638ae277c7045e510c0e48a91311536a6715e /src/bluetooth/osx/osxbtperipheralmanager_p.h
parent3dbea0c3f9333235629b3249115cd300f8f41112 (diff)
LE peripheral: fix a crash with unrecognized selector (iOS/macOS)
It's nice to re-use some generic functions, but it's not so if they are actually not generic: data_from_bytearray returns NSData, not NSMutableData and NSData (or whatever type they have under the hood) obviously does not have replaceBytesInRange:withBytes: method and we get 'unrecognized selector' exception as a result. Task-number: QTBUG-56898 Change-Id: I8fcaaf2a020c6f5caa8a171b7ac6e534fcb070cd Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/bluetooth/osx/osxbtperipheralmanager_p.h')
-rw-r--r--src/bluetooth/osx/osxbtperipheralmanager_p.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bluetooth/osx/osxbtperipheralmanager_p.h b/src/bluetooth/osx/osxbtperipheralmanager_p.h
index 30ddd073..3367b367 100644
--- a/src/bluetooth/osx/osxbtperipheralmanager_p.h
+++ b/src/bluetooth/osx/osxbtperipheralmanager_p.h
@@ -98,14 +98,14 @@ enum class PeripheralState
struct UpdateRequest
{
UpdateRequest() = default;
- UpdateRequest(QLowEnergyHandle handle, const ObjCStrongReference<NSData> &val)
+ UpdateRequest(QLowEnergyHandle handle, const ObjCStrongReference<NSMutableData> &val)
: charHandle(handle),
value(val)
{
}
QLowEnergyHandle charHandle = {};
- ObjCStrongReference<NSData> value;
+ ObjCStrongReference<NSMutableData> value;
};
@interface QT_MANGLE_NAMESPACE(OSXBTPeripheralManager) : NSObject<CBPeripheralManagerDelegate>
@@ -125,7 +125,7 @@ struct UpdateRequest
ObjCScopedPointer<NSMutableDictionary> advertisementData;
GenericLEMap<CBCharacteristic *> charMap;
- GenericLEMap<ObjCStrongReference<NSData>> charValues;
+ GenericLEMap<ObjCStrongReference<NSMutableData>> charValues;
std::deque<UpdateRequest> updateQueue;