summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-07-27 11:37:04 +0200
committerSven Gothel <[email protected]>2021-07-27 11:37:04 +0200
commit6fe79f792dcfe31227c40de3cc0cd63ecfe2a92b (patch)
treec0b368d1a3a9e74e8518451350915c28c3a854a2
parent668b657421575cede1fc25dc4a54f99c8ffce43d (diff)
parent64e242e3fd3f35da5abe1455e6566f9f2f82523b (diff)
Merge remote-tracking branch 'sgothel-ict/master'
-rw-r--r--src/direct_bt/BTGattHandler.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/direct_bt/BTGattHandler.cpp b/src/direct_bt/BTGattHandler.cpp
index b3d19bab..57fdd844 100644
--- a/src/direct_bt/BTGattHandler.cpp
+++ b/src/direct_bt/BTGattHandler.cpp
@@ -665,9 +665,8 @@ bool BTGattHandler::discoverDescriptors(BTGattServiceRef & service) {
const std::lock_guard<std::recursive_mutex> lock(mtx_command); // RAII-style acquire and relinquish via destructor
PERF_TS_T0();
- bool done=false;
const int charCount = service->characteristicList.size();
- for(int charIter=0; !done && charIter < charCount; charIter++ ) {
+ for(int charIter=0; charIter < charCount; charIter++ ) {
BTGattCharRef charDecl = service->characteristicList[charIter];
charDecl->clearDescriptors();
COND_PRINT(env.DEBUG_DATA, "GATT discoverDescriptors Characteristic[%d/%d]: %s on %s", charIter, charCount, charDecl->toString().c_str(), deviceString.c_str());
@@ -680,6 +679,8 @@ bool BTGattHandler::discoverDescriptors(BTGattServiceRef & service) {
cd_handle_end = service->endHandle;
}
+ bool done=false;
+
while( !done && cd_handle_iter <= cd_handle_end ) {
const AttFindInfoReq req(cd_handle_iter, cd_handle_end);
COND_PRINT(env.DEBUG_DATA, "GATT CD discover send: %s", req.toString().c_str());