From 381dcbd8f6f67883b0a7cc82a62380882e0c4ce3 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Mon, 6 Jul 2015 15:58:28 +0200 Subject: 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 --- src/bluetooth/qlowenergycontroller_bluez.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bluetooth/qlowenergycontroller_bluez.cpp') 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 -- cgit v1.2.3