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

Change Advertising Speed on Scan Response

I am working on a project working with remote connectable beacons. One of the easiest ways to save power in these applications is to reduce advertising speed, however, this comes at the cost of getting a reliable/timely connection.

I have been experimenting with the scan response request and essentially using that as a signal to the beacon that a phone is nearby. I set up a program with the following steps:

1. Set low advertising speed >4s normally.

2. On scan response increase advertising speed for 10 seconds.

3. Either phone successfully connects and collects information, or phone leaves range and advertising goes back to normal.

My question is whether this methodology is sensible, to change the advertising interval you have to stop advertising and restart at a different speed - is this likely to cause issues?

Any insight would be great!

  • Hello,

    I do not see any issues with stopping and starting the advertising again as you describe. In fact, at least one of the examples in the SDK (the eddystone beacon) does this. You can use the softdevice call sd_ble_gap_adv_stop() to stop the advertisement. Just check the return of this function call. If it returns BLE_ERROR_INVALID_ADV_HANDLE, it is called with an invalid handle. If it returns NRF_SUCCESS, it has stopped the advertising, and you can configure the advertisement with the updated advertising interval. If it returns NRF_ERROR_INVALID_STATE, it means that the device is not advertising (it has already been stopped), and you can ignore this return, and configure the advertising interval.

     

    Best regards,

    Edvin

  •   We do something similar in one of our products without any issues.  In fact if you look at

    ble_advertising.h
    in the SDK you will see it implements something called fast and slow advertising is changes the advertising interval.

Related