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.

cc2650 simpleBLEPeripheral crash when Simple Profile Characteristic 4 work in GATT_PROP_INDICATE

hardware: CC2650EM_7ID

My application need  Simple Profile Characteristic 4 work in GATT_PROP_INDICATE, my modify is following:

1. simplelink/ble_cc26xx_2_00_00_42893/Projects/ble/Profiles/SimpleProfile/CC26xx/simpleGATTprofile.c

static uint8 simpleProfileChar4Props = GATT_PROP_INDICATE;//GATT_PROP_NOTIFY;

2. in function  simpleProfile_WriteAttrCB:

      case GATT_CLIENT_CHAR_CFG_UUID:
        status = GATTServApp_ProcessCCCWriteReq( connHandle, pAttr, pValue, len,
                                                 offset, GATT_CLIENT_CFG_INDICATE );

after lightBlue in ipad4 connected to simpleBLEPeripheral, click Listen for notifications of INDICATED VALUES of Characteristic 4。

then simpleBLEPeripheral crash 。


because simpleBLEPeripheral send data to lightBlue per 5 seconds in function SimpleBLEPeripheral_performPeriodicTask, SO when I comment the following code, simpleBLEPeripheral do not crash,but lightBlue can't get indicate value.

SimpleProfile_SetParameter:

    case SIMPLEPROFILE_CHAR4:
      if ( len == sizeof ( uint8 ) )
      {
        simpleProfileChar4 = *((uint8*)value);

        // See if Notification has been enabled

#if 0
        GATTServApp_ProcessCharCfg( simpleProfileChar4Config, &simpleProfileChar4, FALSE,
                                    simpleProfileAttrTbl, GATT_NUM_ATTRS( simpleProfileAttrTbl ),
                                    INVALID_TASK_ID, simpleProfile_ReadAttrCB );

#endif
      }

OR

simplelink/ble_cc26xx_2_00_00_42893/Projects/ble/Profiles/GATT/gattservapp_util.c

        if ( pItem->value & GATT_CLIENT_CFG_INDICATE )
        {

#if 0
           status |= gattServApp_SendNotiInd( pItem->connHandle, GATT_CLIENT_CFG_INDICATE,
                                              authenticated, pAttr, taskId, pfnReadAttrCB );

#endif
        }

I can't find the reson of this crash , the code is seem that have no error。

where is reson of crash , is this bug of  simpleBlePeripheral code ?

  • Hi user3931807,

    I will look into this - it shouldn't crash. But there is more you need to consider when doing indications, for example you need to specify which task should receive the confirmation. Have a look at the GlucoseSensor project - glucose.c::GlucoseSensor_ctlPntIndicate(), glucservce.c::Glucose_CtlPntIndicate().

    Best regards,
    Aslak
  • thanks,Aslak N.
    according your information, I find out the source of crash is INVALID_TASK_ID,
    I add taskId of the current task ,and every thing is ok!