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: Advertise frequency changes when "linkDB_NumActive() >= linkDBNumConns"

Part Number: CC2640R2F

Tool/software: TI-RTOS

Device

CC2640R2LAUNCHXL

SDK

simplelink_cc2640r2_sdk_2_40_00_32

IDE

IAR8.20.2

Reference Project

Multirole

 

Hi Ti,

I am using the multirole project and I have problem with advertisement frequency.

 

Here is what I do:

  1. I have set my maximum connections as 3
  2. I have set my TGAP_CONN_ADV_INT_MIN & TGAP_CONN_ADV_INT_MAX as 1sec
  3. I will connect all devices (both peripheral and client)

What is happening..!!

  1.  When (linkDB_NumActive() >= linkDBNumConns) advertisement changes to ADV_NON_CONN_IND
  2.  Advertise frequency changes 100msec.
  3. When (linkDB_NumActive() < linkDBNumConns) advertisement changes to ADV _IND
  4. Now Advertise frequency will become 1sec.

What is the Question?

  1. Why the frequency is changing to 100ms when (linkDB_NumActive() >= linkDBNumConns) ?
  2. What are the parameters need to be tested/monitored to find this issue?

Please refer below image

  • Hi,

    Additional info
    1. I am changing the advertisement to ADV_NON_CONN_IND once the (linkDB_NumActive() >= linkDBNumConns).
    2. Actual question is only about the frequency change.
  • The reason for changing to non connectable advertising packet is because the current active connection(linkDB_NumActive) has reached the maximum supported connections(linkDBNumConns).

    TGAP_CONN_ADV_INT_MIN , TGAP_CONN_ADV_INT_MAX these two parameters only covers connectable advertising's advertising interval.
    To change the non connectable advertising interval, you need to also change the following parameters to 1s.
    TGAP_LIM_DISC_ADV_INT_MIN,
    TGAP_LIM_DISC_ADV_INT_MAX,
    TGAP_GEN_DISC_ADV_INT_MIN,
    TGAP_GEN_DISC_ADV_INT_MAX
  • Hi Christin,

    Thanks for the suggestion. Updating the “TGAP_LIM_DISC_ADV_INT_MIN” did not made any change in the bug.

    Here is the multiple tests I have done.

    1. Took the multi_role base project.
    2. Set the 2sec advertisement frequency #define DEFAULT_ADVERTISING_INTERVAL         160 * 10
    3. I have Enabled GAPROLE_ADV_NONCONN_ENABLED when(linkDB_NumActive() > linkDBNumConns). (Note: Actual/base application just stops advertisement in this case)
    4. Set the MAX_NUM_BLE_CONNS=1
    5. I have Enabled GAPROLE_ADVERT_ENABLED while (linkDB_NumActive() < linkDBNumConns).  (Note: Actual/base application we explicitly press the menu option from button to start the advertisement)

    Observations:

    With SDK “simplelink_cc2640r2_sdk_1_50_00_58”

    1. Device was advertising with ADV_NON_CONN_IND with the 1 Sec interval appeared. (Means same frequency as set at initialization.)
    2. Connected to other devices. (linkDB_NumActive() > linkDBNumConns).  
    3. ADV_NON_CONN_IND with the 1 Sec interval appeared. (Means same frequency as set at initialization.)
    4. Disconnected from other devices.(linkDB_NumActive() < linkDBNumConns).
    5. ADV_NON_CONN_IND with the 1 Sec interval appeared. (Means same frequency as set at initialization.)

    With SDK “simplelink_cc2640r2_sdk_2_30_00_28”

    1. Device was advertising with ADV_NON_CONN_IND with the 1 Sec interval appeared. (Means same frequency as set at initialization.)
    2. Connected to other devices. (linkDB_NumActive() > linkDBNumConns).  
    3. ADV_NON_CONN_IND with the 100 ms interval appeared. (Means frequency has been changed)
    4. Disconnected from other devices.(linkDB_NumActive() < linkDBNumConns).
    5. ADV_NON_CONN_IND with the 1 Sec interval appeared. (Means same frequency as set at initialization.)

     

    Could you please suggest further.

    Thanks

    Niranjan Hegde

  • Hi,

    In the new SDK, the advertising interval for non connectable while in a connection is set by using

    GAP_SetParamValue(TGAP_FAST_INTERVAL_2_INT_MIN, advInt);
    GAP_SetParamValue(TGAP_FAST_INTERVAL_2_INT_MAX, advInt);

  • Hi Christin,

    Thanks for the suggestion. By setting the TGAP_FAST_INTERVAL_2_INT parameter solves the problem.

     

    But I have done some more tests (without setting TGAP_FAST_INTERVAL_2_INT parameter).

    I observed below behavior:

    1. If we have linkDB_NumActive() > 0 and enable ADV_NON_CONN_IND then device starts advertising with 100ms.
    2. If linkDB_NumActive() = 0 and enable ADV_NON_CONN_IND then devices advertises with the same frequency as set in initialization. (there is no change advertising in the frequency).

     

    Now my questions are:

    1. What is reason behind this behavior?
    2. According to the BLE specifications 4.2 [Vol 3, Part C] - 9.3.11.2 it should always advertise with the same frequency set by the TGAP_FAST_INTERVAL_2_INT if it is advertising in ADV_NON_CONN_IND. Isn’t it?

     

    Thanks

    Niranjan Hegde

  • Hi,

    In our software implementation, when the device is in connection, the non-connectable advertising interval is set by TGAP_FAST_INTERVAL_2_INT while the connectable advertising interval is controlled by TGAP_CONN_ADV_INT
    When there is no connection, the advertising interval for both non-connectable and connectable is controlled by TGAP_LIM_DISC_ADV_INT or TGAP_GEN_DISC_ADV_INT.

    So in the spec, this is not a mandatory parameter, however we do have it but we have the functionality implemented half way. Sorry for the confusion. I hope the explanation provided above can solve all the adv related questions.
  • Hi Christin,

     

    Thanks for the detailed explanation.

    I want to clarify more on the case when linkDB_NumActive() = 0 .

    As you mentioned TGAP_GEN_DISC_ADV_INT or TGAP_LIM_DISC_ADV_INT. I want to confirm which parameter sets ADV_NON_CONN_IND frequency ? And which parameter sets ADV _IND frequency?

    Do I need to initialize TGAP_LIM_DISC_ADV_INT also? Right now I have not initialized this parameter and still it is getting the same advertise frequency.

     

    Thanks

    Niranjan Hegde

  • They both can control non-connectable advertising interval. If you set your advertising DEFAULT_DISCOVERABLE_MODE is set to GAP_ADTYPE_FLAGS_LIMITED, then the interval is controlled by TGAP_LIM_DISC_ADV_INT.

    In our out of box example project, the DEFAULT_DISCOVERABLE_MODE is set to DEVDISC_MODE_ALL. You can change it according to your need.
    For more information regarding advertising, you can take a look at SimpleLink Academy
    dev.ti.com/.../ble_scan_adv_basic.html