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

Advertising interval changing

I have set APP_ADV_INTERVAL to 100ms. Now when my device is rum=nning i want to manually change it say to 1000ms/300ms.Kindly assist how can this be done for ble_app_beacon code 

Parents
  • Hi,

    To change the advertising interval you need to stop and then re-start advertising. Using the ble_app_beacon example in the nRF5 SDK as reference that means stopping by calling sd_ble_gap_adv_stop(), and then re-configuring and starting advertising again by calling advertising_init() again as this calls sd_ble_gap_adv_set_configure() (with some modification to use different advertising intervals) and lastly advertising_start(), which calls sd_ble_gap_adv_start().

Reply
  • Hi,

    To change the advertising interval you need to stop and then re-start advertising. Using the ble_app_beacon example in the nRF5 SDK as reference that means stopping by calling sd_ble_gap_adv_stop(), and then re-configuring and starting advertising again by calling advertising_init() again as this calls sd_ble_gap_adv_set_configure() (with some modification to use different advertising intervals) and lastly advertising_start(), which calls sd_ble_gap_adv_start().

Children
No Data
Related