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.

CC2640 GATT_Indication fail

Hello,

My GATT server indicates an attribute every 100 ms.

When I use BTOOL to test my indication function, I found that my GATT server disconnected after 30~40 indication (about 3~4 sec).

In BTOOL, I didn't see any error code or error message.

It means GATT server crash with unknown reason.

Dose anyone know about this situation?

Thanks.

  • Hello,

    Can you share your code for doing the Indication?

    Best wishes
  • I use periodic task to do indication every 100 ms.
    When clock expired, it will do

    static void SimpleBLEPeripheral_performPeriodicTask(void)
    {
      uint8 Charvalue[GATT_CHAR2_LEN];
      SimpleProfile_GetParameter(SIMPLEPROFILE_CHAR2, Charvalue);
      Indication_ATT(SIMPLEPROFILE_CHAR2, Charvalue, selfEntity);
    }

    Then,

    bStatus_t Indication_ATT( uint8 param, uint8* value, ICall_EntityID taskid)
    {
      bStatus_t status = SUCCESS;
      attHandleValueInd_t indicate;

      switch ( param )
      {
        case SIMPLEPROFILE_CHAR2:
        indicate.pValue = (uint8 *)GATT_bm_alloc( gapConnHandle, ATT_HANDLE_VALUE_NOTI, GATT_CHAR2_LEN, NULL );

        VOID memcpy(indicate.pValue, ECGTimer, TIMER_LEN);
        indicate.len = GATT_CHAR2_LEN;
        indicate.handle = 0x0024;

        status = GATT_Indication( gapConnHandle, &indicate, FALSE, (uint8)taskid );
     
        break;

        default:
        status = INVALIDPARAMETER;
        break;
      }
      return ( status );
    }

    Finally, if the GATT server receives ACK from BTOOL, it will goto

    static void SimpleBLEPeripheral_processGATTMsg(gattMsgEvent_t *pMsg)
    {

       if( pMsg->method != ATT_HANDLE_VALUE_CFM)
       {
         //ATT_HandleValueCfm( pMsg->connHandle );
         System_printf("0x%x\n", pMsg->method);
       }

       GATT_bm_free(&pMsg->msg, pMsg->method);
    }

  • Hi JXS,

    If Indication returns failure, it will indicate about 120~130 times. (use another device can't ACK)

    If Indication returns success, it will indicate about 30 times. (use BTOOL)

    I indicate 5 Byte ATT each time.