14. Advertising Interval

Our implementation advertises at 687.5ms intervals. In some applications, we may want to advertise using shorter intervals, or we may want to use longer intervals. It is very easy to modify this as we will demonstrate in the following.

  1. In user_config.h, change the advertising interval in the user_adv_conf struct from:

    static const struct advertise_configuration user_adv_conf = {
       .addr_src = APP_CFG_ADDR_SRC(USER_CFG_ADDRESS_MODE),
       /// Minimum interval for advertising
    -    .intv_min = MS_TO_BLESLOTS(687.5),                    // 687.5ms
    +    .intv_min = MS_TO_BLESLOTS(100),                      // 100ms
    
       /// Maximum interval for advertising
    -     .intv_max = MS_TO_BLESLOTS(687.5),                    // 687.5ms
    +     .intv_max = MS_TO_BLESLOTS(100),                      // 100ms
    
  2. Build the project and load it onto target

  3. Use the SmartSnippets Power Profiler to verify the that the interval has changed.

    _images/sw_adv_intv.png

    Figure 26 The advertising interval has been changed to 100ms

Increasing the advertising interval

Increasing the advertising interval reduces the average current consumption i.e. can make your battery last longer. However decreasing the advertising interval often allows a central to find your device more quickly i.e. can make the user exerpience better. Apple has published some guidelines that should be noted when selecting an advertising interval for a device that will need to communication with an iOS based device: https://developer.apple.com/library/archive/qa/qa1931/_index.html