DA14531 ADVERTISEMENT WITH TIMEOUT

How does the advertise with timeout function work?

static const struct default_handlers_configuration user_default_hnd_conf = {
// Configure the advertise operation used by the default handlers
// Possible values:
// - DEF_ADV_FOREVER
// - DEF_ADV_WITH_TIMEOUT
.adv_scenario = DEF_ADV_WITH_TIMEOUT,

// Configure the advertise period in case of DEF_ADV_WITH_TIMEOUT.
// It is measured in timer units (3 min). Use MS_TO_TIMERUNITS macro to convert
// from milliseconds (ms) to timer units.
.advertise_period = MS_TO_TIMERUNITS(5000),

I have defined the above configuration. Advertisement timeout shall happen after 5 seconds.

After the timeout, which callback shall get called?

I want to advertise for 5 seconds then have a timeout and go to deep sleep mode. Then upon pressing a GPIO, my dialog will wake up and restart advertising. How shall I do?

Which callback/function shall I put the button wakeup press function so that when I press SW2 in dialog board, my system wakes up?

When will the below callback function be called?