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.

RTOS/CC2640R2F: Disable DLE CC2640r2f RTOS

Part Number: CC2640R2F

Tool/software: TI-RTOS

Dear all,

I'd like to disable DLE on CC2640r2f. I followed this link

I think that we must use at the end of void SimpleBLEPeripheral_init(void)

#define APP_TX_PDU_SIZE 27
#define APP_RX_PDU_SIZE 27
#define APP_TX_TIME 328
#define APP_RX_TIME 328

//This API is documented in hci.h
HCI_EXT_SetMaxDataLenCmd(APP_TX_PDU_SIZE ,  APP_TX_TIME,
   APP_RX_PDU_SIZE, APP_RX_TIME);
// featSet is an array of bytes representing features supported
// of the Device. Clear DLE Feature bit
CLR_FEATURE_FLAG( featSet[0], LL_FEATURE_DATA_PACKET_LENGTH_EXTENSION );
HCI_EXT_SetLocalSupportedFeaturesCmd( featSet );

But I wonder what is value of featSet[0]?
thanks and regards,
Tuyen
  • Hi Tuyen,

    featSet[0] is the first byte of the local supported feature set. So the value will be the bitmask indicating what features are supported locally. This byte is defined in ll_common.h:

    // Byte 0
    #define LL_FEATURE_ENCRYPTION                          0x01
    #define LL_FEATURE_CONN_PARAMS_REQ                     0x02
    #define LL_FEATURE_REJECT_IND_EXT                      0x04
    #define LL_FEATURE_SLV_FEATURES_EXCHANGE               0x08
    #define LL_FEATURE_PING                                0x10
    #define LL_FEATURE_DATA_PACKET_LENGTH_EXTENSION        0x20
    #define LL_FEATURE_PRIVACY                             0x40
    #define LL_FEATURE_EXTENDED_SCANNER_FILTER_POLICIES    0x80

    If you want to know the supported features, you can use the HCI_ReadLocalSupportedFeaturesCmd() API.

  • Thank Marie,
    I just HCI_ReadLocalSupportedFeaturesCmd() and get value is 0. It mean all feature is not enable? If i'm not wrong then why we must disable DLE by clear it
    CLR_FEATURE_FLAG( featSet[0], LL_FEATURE_DATA_PACKET_LENGTH_EXTENSION );
    HCI_EXT_SetLocalSupportedFeaturesCmd( featSet );

    thanks,
    Tuyen
  • Hi Tuyen,

    Are you sure you used HCI_ReadLocalSupportedFeaturesCmd() correctly? From the API documentation:

    hciStatus_t HCI_ReadLocalSupportedFeaturesCmd ( void  )

    Read the locally supported features.

    Corresponding Events
    hciEvt_CmdComplete_t with cmdOpcode HCI_READ_LOCAL_SUPPORTED_FEATURES
    Returns
    HCI_SUCCESS

    So the HCI_ReadLocalSupportedFeaturesCmd() function call will return a status (0=SUCCESS). You will get the actual local supported features in an hciEvt_CmdComplete_t event. You catch this event in the SimpleBLEPeripheral_processStackMsg() function, in the HCI_COMMAND_COMPLETE_EVENT_CODE case, in the HCI_LE_READ_LOCAL_SUPPORTED_FEATURES case. 

    //find which command this command complete is for
                  switch (command_complete->cmdOpcode)
                  {
                    case HCI_LE_READ_LOCAL_SUPPORTED_FEATURES:
                      {
                        if (pktStatus == SUCCESS)
                        {
                          uint8_t featSet[8];
    
                          // Get current feature set from received event (bits 1-9
                          // of the returned data
                          memcpy( featSet, &command_complete->pReturnParam[1], 8 );
    

    The &command_complete->pReturnParam is the returned feature set.

  • when HCI_LE_ReadLocalSupportedFeaturesCmd() not HCI_READ_LOCAL_SUPPORTED_FEATURES() is being used, HCI_LE_READ_LOCAL_SUPPORTED_FEATURES event is generated.

    BR,
    Ji-won
  • Thanks Ji-won, Got it!