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 change advertising and connection interval ?

Other Parts Discussed in Thread: CC2650STK, CC2540

Hi,  

I am using CCS 6 on Win 8.1. When I debug sensortag_cc2650stk_app, I try to change advertising interval and connection interval by changing params in gap.h

And I use CC2540 to sniff, it turns out the connection interval and advertising interval remain the same, approximately 67.5ms and 104ms respectively. 

How can I make this work?

  • Hi Tiancong,

    Have you read through the SW Developers Guide?

    Cheers,
    Fredrik
  • I did. But I am not sure whether I missed something...

    I tried to use these commands to change params. 

    But after I wrote these in main function, nothing changed. 

    Where should I put them in ?

  • Hi Tiancong,

    Do you use sniffer to check those parameters? In my test, advertising intetval can be changed by following API

    // Set advertising interval
    {
    uint16_t advInt = DEFAULT_ADVERTISING_INTERVAL;

    GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MIN, advInt);
    GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MAX, advInt);
    GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MIN, advInt);
    GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MAX, advInt);
    }

    About connection interval, you can change by following parameters. Make sure "DEFAULT_ENABLE_UPDATE_REQUEST" is TRUE. Remember, host can accept or reject this request.

    // Minimum connection interval (units of 1.25ms, 80=100ms) if automatic
    // parameter update request is enabled
    #define DEFAULT_DESIRED_MIN_CONN_INTERVAL 8

    // Maximum connection interval (units of 1.25ms, 800=1000ms) if automatic
    // parameter update request is enabled
    #define DEFAULT_DESIRED_MAX_CONN_INTERVAL 800

    // Slave latency to use if automatic parameter update request is enabled
    #define DEFAULT_DESIRED_SLAVE_LATENCY 0

    // Supervision timeout value (units of 10ms, 1000=10s) if automatic parameter
    // update request is enabled
    #define DEFAULT_DESIRED_CONN_TIMEOUT 100

    // Whether to enable automatic parameter update request when a
    // connection is formed
    #define DEFAULT_ENABLE_UPDATE_REQUEST TRUE
  • I found it in sensortag.c file. Thank you!!!

    By the way do you know how to change TGAP_LIM_ADV_TIMEOUT ? The maximum time to remain advertising. I found it is declared in gap.h but I didn't find where it is set.
  • It turns out only advertising interval is changed but connection interval remains the same... Is this related to my master device?
  • Hi Tiancong,
    You can search "DEFAULT_DISCOVERABLE_MODE", there are two parameters
    GAP_ADTYPE_FLAGS_GENERAL --> advertising will not stop
    GAP_ADTYPE_FLAGS_LIMITED --> advertising will stop after 180 seconds(default value)

    You can change 180 sec to 60sec by
    GAP_SetParamValue(TGAP_LIM_ADV_TIMEOUT , 60);
  • Hi Tiancong,

    Yes, master device can reject parameter update request. Do you have sniffer? You can observer the master accept(or reject) you request. Otherwise, you can test your device by BTool