From bbeae9df6bc6c491ca58882b131c5a40b160cc76 Mon Sep 17 00:00:00 2001 From: h2zero Date: Sun, 10 May 2020 20:28:28 -0600 Subject: [PATCH] Fix: Descriptor list incomplete when Notify property set. --- src/NimBLEService.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NimBLEService.cpp b/src/NimBLEService.cpp index 61cf525..60887d7 100644 --- a/src/NimBLEService.cpp +++ b/src/NimBLEService.cpp @@ -111,8 +111,9 @@ bool NimBLEService::start() { if(numDscs) { // skip 2902 as it's automatically created by NimBLE // if Indicate or Notify flags are set - if((pCharacteristic->m_properties & BLE_GATT_CHR_F_INDICATE) || - (pCharacteristic->m_properties & BLE_GATT_CHR_F_NOTIFY)) { + if(((pCharacteristic->m_properties & BLE_GATT_CHR_F_INDICATE) || + (pCharacteristic->m_properties & BLE_GATT_CHR_F_NOTIFY)) && + pCharacteristic->getDescriptorByUUID("2902") != nullptr) { numDscs--; } }