summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2015-07-06 15:58:28 +0200
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-07-13 09:07:29 +0000
commit381dcbd8f6f67883b0a7cc82a62380882e0c4ce3 (patch)
tree61ffb356cedc7b7e7e772b9e64f0e99dbdbe923f
parent80ceeeed3c15d307784be66b5dafdc9cfc12b8cb (diff)
Cut high bits from QLECharacteristic::PropertyTypes
The enum value is 32 bit. the field we are reading is 8bit. Ensure that the higher bits are always set to 0. Change-Id: I317a877e23645c2785fd75e38494103f2272d2cd Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
-rw-r--r--src/bluetooth/qlowenergycontroller_bluez.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bluetooth/qlowenergycontroller_bluez.cpp b/src/bluetooth/qlowenergycontroller_bluez.cpp
index bb490ba9..0654bda1 100644
--- a/src/bluetooth/qlowenergycontroller_bluez.cpp
+++ b/src/bluetooth/qlowenergycontroller_bluez.cpp
@@ -478,7 +478,7 @@ QLowEnergyHandle parseReadByTypeCharDiscovery(
QLowEnergyHandle attributeHandle = bt_get_le16(&data[0]);
charData->properties =
- (QLowEnergyCharacteristic::PropertyTypes)data[2];
+ (QLowEnergyCharacteristic::PropertyTypes)(data[2] & 0xff);
charData->valueHandle = bt_get_le16(&data[3]);
if (elementLength == 7) // 16 bit uuid