From adfed1222fbe73267f4a3be149d9acff158ddfa1 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Mon, 6 Jul 2015 15:10:31 +0200 Subject: Parse all char descriptions in one go ATT_OP_READ_BY_TYPE_REQUEST may return more than one char description per response packet. Due to a missing offset adjustment we only ever read the first description. Subsequent description were read by issuing a new READ_BY_TYPE request. This is very inefficient as at worst 3 times as many requests had to be send to the device. Change-Id: I83ca75a42425fe230926411f068112865c249061 Reviewed-by: Timur Pocheptsov Reviewed-by: Alex Blasche --- src/bluetooth/qlowenergycontroller_bluez.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/bluetooth/qlowenergycontroller_bluez.cpp b/src/bluetooth/qlowenergycontroller_bluez.cpp index a35545b0..8906eb06 100644 --- a/src/bluetooth/qlowenergycontroller_bluez.cpp +++ b/src/bluetooth/qlowenergycontroller_bluez.cpp @@ -672,6 +672,7 @@ void QLowEnergyControllerPrivate::processReply( lastHandle = parseReadByTypeCharDiscovery( &characteristic, &data[offset], elementLength); p->characteristicList[lastHandle] = characteristic; + offset += elementLength; } else if (attributeType == GATT_INCLUDED_SERVICE) { QList includedServices; lastHandle = parseReadByTypeIncludeDiscovery( -- cgit v1.2.3