This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to configure advertising time 10 secs on 5 secs off(with rtc)?

Hello, I am using sdk12.2.2 and pca10040. I want that my beacon advertises continuously for 10 sec and then it stops advertising for 5 secs. Do I need to use rtc for this? Also later I want that customer should be able to configure this 5 10sec on timings through nrf connect app. Thanks,

Parents
  • If you use the ble_advertising.c component, you can use the ble_adv_fast_timeout or ble_adv_slow_timeout in the ble_adv_modes_config_t type for configuring how long the device should advertise every time you invoke ble_adv_start.

    There are similar arguments to be used if you choose to use sd_ble_gap_adv_start directly.

    Next you could use app_timer.c to start a timer for a 5 second timer which will let you know when to call sd_ble_gap_adv_start again.

    As for nrf connect support, you could extend it with a new app (nrf connect is now a framework which supports different apps inside of it) in which you write to a "configure" characteristic of the device, changing the 5 second value to something else.

Reply
  • If you use the ble_advertising.c component, you can use the ble_adv_fast_timeout or ble_adv_slow_timeout in the ble_adv_modes_config_t type for configuring how long the device should advertise every time you invoke ble_adv_start.

    There are similar arguments to be used if you choose to use sd_ble_gap_adv_start directly.

    Next you could use app_timer.c to start a timer for a 5 second timer which will let you know when to call sd_ble_gap_adv_start again.

    As for nrf connect support, you could extend it with a new app (nrf connect is now a framework which supports different apps inside of it) in which you write to a "configure" characteristic of the device, changing the 5 second value to something else.

Children
No Data
Related