diff options
author | Sven Gothel <[email protected]> | 2021-07-27 11:37:04 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-07-27 11:37:04 +0200 |
commit | 6fe79f792dcfe31227c40de3cc0cd63ecfe2a92b (patch) | |
tree | c0b368d1a3a9e74e8518451350915c28c3a854a2 | |
parent | 668b657421575cede1fc25dc4a54f99c8ffce43d (diff) | |
parent | 64e242e3fd3f35da5abe1455e6566f9f2f82523b (diff) |
Merge remote-tracking branch 'sgothel-ict/master'
-rw-r--r-- | src/direct_bt/BTGattHandler.cpp | 5 |
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()); |