From 0f4326d3fd1c161feee25413360d7b229bfba572 Mon Sep 17 00:00:00 2001 From: h2zero Date: Sun, 20 Feb 2022 10:02:09 -0700 Subject: [PATCH] Check characteristic handles before fetching descriptors. --- src/NimBLERemoteCharacteristic.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/NimBLERemoteCharacteristic.cpp b/src/NimBLERemoteCharacteristic.cpp index 4f88bdb..6cca615 100644 --- a/src/NimBLERemoteCharacteristic.cpp +++ b/src/NimBLERemoteCharacteristic.cpp @@ -266,6 +266,10 @@ bool NimBLERemoteCharacteristic::retrieveDescriptors(const NimBLEUUID *uuid_filt } } + if (m_handle == m_endHandle) { + return true; + } + desc_filter_t filter = {uuid_filter, &taskData}; rc = ble_gattc_disc_all_dscs(getRemoteService()->getClient()->getConnId(),