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: "gapRole_AdvEnabled" set "true" on enabling for both connectable and non connectable Advertisements

Part Number: CC2640R2F

Tool/software: TI-RTOS

SDK: simplelink_cc2640r2_sdk_1_40_00_45

Device:CC2640R2_LAUNCHXL

IDE:  IAR8.11.2

Hi,

I want to enable non connectable advertisement  if my "xyz"  condition  true.

And here is how I did it

  1. Initially device is advertising with 'Connectable' advertisement. So variables
    1. gapRole_AdvEnabled = true
    2. gapRole_AdvNonConnEnabled = false
  2. I will disable "GAPROLE_ADVERT_ENABLED".  And variables become,
    1. gapRole_AdvEnabled = false
    2. gapRole_AdvNonConnEnabled = false
  3. Enable "GAPROLE_ADV_NONCONN_ENABLED"   And variable changes,
    1. gapRole_AdvEnabled = false
    2. gapRole_AdvNonConnEnabled = true

But as per my understanding "GAP_MakeDiscoverable(selfEntity, &params);"  will post  "GAP_MAKE_DISCOVERABLE_DONE_EVENT" on both connectable and non connectable advertisement enable.

Issue is here (in multi.c):

In  function "static uint8_t gapRole_processGAPMsg(gapEventHdr_t *pMsg)" and case "GAP_MAKE_DISCOVERABLE_DONE_EVENT"

-Each time "gapRole_AdvEnabled" is set to true. refer below snippet.

-So both variables "gapRole_AdvEnabled" and "gapRole_AdvNonConnEnabled" will become "true"  :(

-As a result  we can't even disable the advertisements. !!!!

-----------------------------------------------------------------------------------------------------------------------------------------

 case GAP_END_DISCOVERABLE_DONE_EVENT:
    {
      gapMakeDiscoverableRspEvent_t *pPkt = (gapMakeDiscoverableRspEvent_t *)pMsg;

      if (pPkt->hdr.status == SUCCESS)
      {
        // If advertising started
        if (pMsg->opcode == GAP_MAKE_DISCOVERABLE_DONE_EVENT)
        {
          gapRole_AdvEnabled = TRUE;
        }

..

     }break;

-----------------------------------------------------------------------------------------------------------------------------------------

What can I Do?:


  • What can I Do?: <continued>

    1. Can I comment the line gapRole_AdvEnabled = TRUE; ?
    2. Is it safe to do so?
    3. If I comment this software will work as expected. So what is the need of having "gapRole_AdvEnabled = TRUE; "??
  • Hi Niranjan,

    The workaround you listed seems correct. I've tested it on my end and it's working correctly.

    We've filled a ticket related to this bug internally to be addressed in the future. Thank you for bringing this to our attention.

    Thanks,
    Gerardo