From 27ca535ba0ad16a3cbb9baca9763e0b60b404db2 Mon Sep 17 00:00:00 2001 From: krishna kishore Date: Mon, 13 May 2019 14:27:10 +0530 Subject: [PATCH] Explicit CCC added descriptor does not send notification/indication to client --- .../stack/ble-host/sources/stack/att/atts_write.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_write.c b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_write.c index 0b60bc59d7a..88bcf7fdc49 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_write.c +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_write.c @@ -157,6 +157,11 @@ void attsProcWrite(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) } else { + /* check if CCC */ + if ((pAttr->settings & ATTS_SET_CCC) && (attsCb.cccCback != NULL)) + { + err = (*attsCb.cccCback)(pCcb->connId, ATT_METHOD_WRITE, handle, pPacket); + } /* if write callback is desired */ if ((pAttr->settings & ATTS_SET_WRITE_CBACK) && (pGroup->writeCback != NULL)) @@ -164,11 +169,6 @@ void attsProcWrite(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) err = (*pGroup->writeCback)(pCcb->connId, handle, opcode, 0, writeLen, pPacket, pAttr); } - /* else check if CCC */ - else if ((pAttr->settings & ATTS_SET_CCC) && (attsCb.cccCback != NULL)) - { - err = (*attsCb.cccCback)(pCcb->connId, ATT_METHOD_WRITE, handle, pPacket); - } else { /* write attribute value */