This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2642R: Send notification to central through CHAR4 is not working in simple peripheral code

Part Number: CC2642R

Hi,

  I sent the notification to the central in characteristic 4(using SimpleProfile_SetParameter) from the SimplePeripheral_performPeriodicTask function (i.e) from periodic timer function... It is working 

then   I sent the notification to the central in characteristic 4(using SimpleProfile_SetParameter) from the new thread created (using Task_construct fn). Now  when i try to Send notification to central by using same API but it is not sending . It is stucking at  SimpleProfile_SetParameter -> GATTServApp_ProcessCharCfg-> gattServApp_SendNotiInd -> GATT_Notification(stucking here) ....

Can you please give a solution ??

  • Hey Mohan,

    Which SDK are you using? I've assigned a colleague to help you with your post.

  • Hi Mohan,

    Can you provide the debug log when stuck in  GATT_Notification?

    Meanwhile, I think you can try char4 updating  under this guidance Custom Profile (ti.com)

    Best regards! 

  • I am using this SDK (simplelink_cc13x2_26x2_sdk_5_20_00_52)

  • HI Simon,

    SDK i am using is : simplelink_cc13x2_26x2_sdk_5_20_00_52.run

    It stucking means not even a debug print is coming after that .

    SimpleProfile_SetParameter -> GATTServApp_ProcessCharCfg-> gattServApp_SendNotiInd -> GATT_Notification(stucking here) ....

    before the  GATT_Notification() function i added one print .... that print is displaying (Printt -> Ntfy Handle 0x2b | cccValue 1)

    after GATT_Notification() function also i has one more print that is not even printing.....

    can you please tell some idea about this????

    Here i will posted the code flow details....

    step 1: Simplepheripheral_SetParameter(SIMPLE_PHERIPHERAL_CHAR4, in_u8len, in_u8buffer);       (WORKING)

    step 2: In Simplepheripheral_SetParameter function -> inside SIMPLE_PHERIPHERAL_CHAR4 switch case below function is calling  (WORKING)

     GATTServApp_ProcessCharCfg( simpleProfileChar4Config, SimplepheripheralNtfyChar_profile, FALSE,
    SimplepheripheralProfileAttrTbl, GATT_NUM_ATTRS( SimplepheripheralProfileAttrTbl ),
    INVALID_TASK_ID, Simplepheripheral_ReadAttrCB ); 

    step 3: In  GATTServApp_ProcessCharCfg function -> inside a ........... 

    pAttr = GATTServApp_FindAttr( attrTbl, numAttrs, pValue );
    if ( pAttr != NULL )
    {
    if ( pItem->value & GATT_CLIENT_CFG_NOTIFY )
    {

    status |= gattServApp_SendNotiInd( pItem->connHandle, GATT_CLIENT_CFG_NOTIFY,
    authenticated, pAttr, taskId, pfnReadAttrCB );
    (WORKING)

    }

    below function is calling ,,,,,,,,,,,,,

    status |= gattServApp_SendNotiInd( pItem->connHandle, GATT_CLIENT_CFG_NOTIFY,
    authenticated, pAttr, taskId, pfnReadAttrCB );

    step 4: Inside a function -> GATT_Notification() is stucked    (NOT WORKING)

    static bStatus_t gattServApp_SendNotiInd( uint16 connHandle, uint8 cccValue,
    uint8 authenticated, gattAttribute_t *pAttr,
    uint8 taskId, pfnGATTReadAttrCB_t pfnReadAttrCB )
    {
    attHandleValueNoti_t noti;
    uint16 len;
    bStatus_t status;

    // If the attribute value is longer than (ATT_MTU - 3) octets, then
    // only the first (ATT_MTU - 3) octets of this attributes value can
    // be sent in a notification.
    noti.pValue = (uint8 *)GATT_bm_alloc( connHandle, ATT_HANDLE_VALUE_NOTI,
    GATT_MAX_MTU, &len );
    if ( noti.pValue != NULL )
    {
    status = (*pfnReadAttrCB)( connHandle, pAttr, noti.pValue, &noti.len,
    0, len, GATT_LOCAL_READ );
    if ( status == SUCCESS )
    {
    noti.handle = pAttr->handle;

    if ( cccValue & GATT_CLIENT_CFG_NOTIFY )
    {
     printf(LOGD, " Ntfy Handle 0x%x | cccValue %d ", pAttr->handle, cccValue); //This line is printing

    *status = GATT_Notification( connHandle, &noti, authenticated );   /////////////////////////////Here it is stucked----------------------------))))))))))))))))))))))*

     printf(LOGD, " Status ///// : %d", status); //This line is Not printing
    }
    else // GATT_CLIENT_CFG_INDICATE
    {
    status = GATT_Indication( connHandle, (attHandleValueInd_t *)&noti,
    authenticated, taskId );
    }
    }

    if ( status != SUCCESS )
    {
    GATT_bm_free( (gattMsg_t *)&noti, ATT_HANDLE_VALUE_NOTI );
    }
    }
    else
    {
    status = bleNoResources;
    }

     //printf(LOGD, " End of gattServApp_SendNotiInd"); 

    return ( status );
    }

  • When i called the Simplepheripheral_SetParameter(SIMPLE_PHERIPHERAL_CHAR4, in_u8len, in_u8buffer) function from queue event it is working fine...it doesn't block or stuck