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.

SIMPLELINK-CC2640R2-SDK: Beacon Broadcast

Part Number: SIMPLELINK-CC2640R2-SDK
Other Parts Discussed in Thread: CC2640R2F

Hi Team -

Posting on customer behalf.

We want to stop the beacon broadcasting when receive external command over UART. Is that have Gap role API or other way to stop the beacon advertising packet in BLE CC2640R2 SDK (simplelink_cc2640r2_sdk_1_50_00_58)? I have checked the document (swru393d) and didn’t find any gap role api’s to stop the advertising packet (NON Connectable).

Thank you. 

  • Hi DGC,

    Please have your customer review the SLA on Scanning and Advertising for CC2640R2F as it can be very informative for your customer:

    dev.ti.com/.../overview.html

    Also, to turn off advertising

    uint8_t initialAdvertDisable = FALSE;
    GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &initialAdvertDisable);

  • Hi Evan -

    Thanks for the quick response.

    We implemented the recommended changes but it still didn’t stop the beacon broadcasting.

     

    Our Implementation looks like below when receiver command from external over UART.

    while (UART_read(uart, advdatainput, sizeof(advdatainput)) > 0) {

     

               cmd = advdatainput[0];

                switch (cmd) {

              case UARTMon_ADVDATACMD:

                    initial_advertising_enable = FALSE;

                  GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &initial_advertising_enable);

               break;

    Does anything jump out at you?

    Thanks!

  • DGC,

    I do not see anything immediately that jumps out no. If you set a breakpoint on GAPRole_SetParameter, does it ever reach it? Is there any other place in the code that may re-initiate advertising again?

    Here is another thread in which the answer is confirmed (different device, same API) to give some confidence to your customer that this is the correct API/Call.
    https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/t/416450

  • DGC,

    As an update from our emails, can you have your customer set a breakpoint at the line VOID GAP_EndDiscoverable(selfEntity); and make sure they get there? This is within the GAPRole_SetParameter. Also please make sure that they are not setting the priority of the UART Task Fxn higher than the ICall task function. 

    Code referenced in peripheral.c below. 

    bStatus_t GAPRole_SetParameter(uint16_t param, uint8_t len, void *pValue)
    {
      bStatus_t ret = SUCCESS;
      switch (param)
      {
        case GAPROLE_ADVERT_ENABLED:
          if (len == sizeof(uint8_t))
          {
            uint8_t oldAdvEnabled = gapRole_AdvEnabled;
            gapRole_AdvEnabled = *((uint8_t*)pValue);
    
            if ((oldAdvEnabled) && (gapRole_AdvEnabled == FALSE))
            {
              // Turn off Advertising
              if (gapRole_state == GAPROLE_ADVERTISING)
              {
                VOID GAP_EndDiscoverable(selfEntity);
              }
            }

    Can you also have them clarify how they are determining that it is continuing to advertise? Just via a sniffer etc?

  • Dan,

    I'm going to close this post due to inactivity. To reopen this thread, just post a follow up question. Otherwise, after 30-days of inactivity from this post, this thread will lock.