Skip to content

Explicit CCC added descriptor does not send notification/indication to client #10316

@cy-kishore

Description

@cy-kishore

When the CCC descriptor is added explicitly from application then the indication or notification packets are not sent out from server device.

We found this issue is in attsProcWrite () function in atts_write.c file.
We had to move out the cccCback from else if condition. Below is our changes for your reference.

--- 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
{

  •  /* 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 */
    

Because of cccCback callback is not called, the attsCccCb.pCccTbl value is not getting updated. Because of this the stack is not sending out the notification which the application is sending.

Issue request type

[ ] Question
[ ] Enhancement
[ ] Bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions