How to set peripheral to always advertise

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Do I just set high_undirect_adv_duration to 0?

With our present setting (below) it stops advertising after 5 min. (300sec.).

We want our peripheral to always advertise, very often, at first, and then less often, to save power.

const BLE_PROFILE_CFG DW_Gateway_cfg =

 

#ifdef REAL_TIME_TEST_FINE_TIMER_PERIOD_ms

/*.fine_timer_interval =*/ REAL_TIME_TEST_FINE_TIMER_PERIOD_ms, // UINT16, # of ms

#else

/*.fine_timer_interval =*/ 500, // UINT16, # of ms

#endif

/*.default_adv =*/ 4, // UINT8, HIGH_UNDIRECTED_DISCOVERABLE

/*.button_adv_toggle =*/ 0, // UINT8, pairing button make adv toggle (if 1) or always on (if 0)

// TBD: fine tune later:

/*.high_undirect_adv_interval =*/ 32, // UINT16, # of slots .000625 us/slot

/*.low_undirect_adv_interval =*/ 2048, // UINT16, # of slots

/*.high_undirect_adv_duration =*/ 300, // UINT16, # of seconds - 5 minutes

/*.low_undirect_adv_duration =*/ 300, // UINT16, # of seconds

0 Likes
1 Solution
asridharan
Employee
Employee
10 comments on KBA 5 comments on KBA First comment on KBA

You can register for the ADV timeout callback using bleprofile_regAppEvtHandler and then re-start advertisement in this callback. For an example, see Apps/RAM/hello_sensor.c, hello_sensor_advertisement_stopped().

View solution in original post

1 Reply
asridharan
Employee
Employee
10 comments on KBA 5 comments on KBA First comment on KBA

You can register for the ADV timeout callback using bleprofile_regAppEvtHandler and then re-start advertisement in this callback. For an example, see Apps/RAM/hello_sensor.c, hello_sensor_advertisement_stopped().