This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Advertisement interval Vs Connection interval

Is it possible to have a fast advertisement interval (for connecting and bonding/pairing) for example: 40msec; at the same time, have a slow connection interval (after connection has established) - for example 1 second? This is because in my project, I have 13 characteristics and for the connection to be successful every single time, the advertisement interval needs to be faster. Once connected, I need the number of CPU blocks to be as minimal as possible (because of highly sensitive algorithm). Hence, after connection has established, I need the connection interval to be 1 second or more. Please help.

  • Yes - the Advertising Interval & Connection Interval are entirely independent.

  • Hi Awneil, Thanks for the reply. Is advertisement interval in APP_ADV_INTERVAL and connection interval in MIN_CONN_INTERVAL and MAX_CONN_INTERVAL?

  • Hi Awneil, consider the situation phone and nRF51 have already been connected and bonded before. Then, the phone and app have been disconnected(for example, phone has gone out of range of the nRF51 Bluetooth range). Now, will the nRF51 be using advertisement packets (using advertisement interval) to make itself available on the Bluetooth network so that the app can find it and reconnect to it, or, is there any re-connection advertisement interval to do so? I am asking this because, for reconnection (example: phone has gone out of the nRF51 Bluetooth range, and when the phone comes back into the range, my nRF51 would have already started a sensitive algorithm, which needs minimal softdevice's cpu block time), I need the re-connection advertisement interval to be as slow as 1 second or more.

  • As anweil pointed out, Advertising Interval and Connection Interval are independent from each other.

    If you want to force a connection to have a certain Connection Interval (CI), you should set MIN_CONN_INTERVAL and MAX_CONN_INTERVAL to the same value. But beware that not all devices support every CI. Some more information here.

    As to your other question (re-connect), yes, you may choose a different Advertising Interval for each situation. In your code, there should something like:

    ble_gap_adv_params_t advertising_parameters;
    ....
    advertising_parameters.interval = APP_ADV_INTERVAL;
    ....
    sd_ble_gap_adv_start(&advertising_parameters);
    

    In that piece of code ADVERTISING_INTERVAL is a #define, which makes it constant. This is similar to what is provided on the Nordic examples. However, you may instead use a variable, and set it for the value that you wish, depending on the situation, using

    advertising_parameters.interval = my_adv_interval;
    
  • Hi Amiguel, THanks for the reply. Is it possible to change advertisement interval on the fly(while the connection is still on and not disconnected)? THanks

Related