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

Keeping track of advertising status

Hello Nordic!

This question is a follow-up on this topic, where it is suggested to keep track of BLE_GAP_EVT_CONNECTED and BLE_GAP_EVT_TIMEOUT events in order to know when a peripheral device has stopped advertising.

My first though was to use the ble_adv_evt_t field passed to the callback defined in ble_advertising_init(...), as I was expecting it to be called when the advertising status changed, including in the case of an established connection.

I tested this, and in fact the advertising callback is not called when a connection is established. Why is this? Shouldn't we received a BLE_ADV_EVT_IDLE signaling the change to BLE_ADV_MODE_IDLE?

I'm using S132 v3.0.0 .

Thanks!

Related