mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2025-01-22 09:20:51 +01:00
Fix characteristic discovery with no descriptors.
Avoid discovery of descriptors if there are no handles remaining.
This commit is contained in:
parent
57fe9cb77f
commit
8158a16fbf
1 changed files with 6 additions and 0 deletions
|
@ -101,6 +101,12 @@ int NimBLERemoteCharacteristic::descriptorDiscCB(
|
||||||
bool NimBLERemoteCharacteristic::retrieveDescriptors(const NimBLEUUID* uuidFilter) const {
|
bool NimBLERemoteCharacteristic::retrieveDescriptors(const NimBLEUUID* uuidFilter) const {
|
||||||
NIMBLE_LOGD(LOG_TAG, ">> retrieveDescriptors() for characteristic: %s", getUUID().toString().c_str());
|
NIMBLE_LOGD(LOG_TAG, ">> retrieveDescriptors() for characteristic: %s", getUUID().toString().c_str());
|
||||||
|
|
||||||
|
// If this is the last handle then there are no descriptors
|
||||||
|
if (getHandle() == getRemoteService()->getEndHandle()) {
|
||||||
|
NIMBLE_LOGD(LOG_TAG, "<< retrieveDescriptors(): found 0 descriptors.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
NimBLETaskData taskData(const_cast<NimBLERemoteCharacteristic*>(this));
|
NimBLETaskData taskData(const_cast<NimBLERemoteCharacteristic*>(this));
|
||||||
desc_filter_t filter = {uuidFilter, &taskData};
|
desc_filter_t filter = {uuidFilter, &taskData};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue