BLE Advertisement Callback

Hi!

This question has been asked before in various forms, but none of the answers I've seen will work;

Is there a way to get any callback before or after a BLE Advertisement is transmitted?

- bt_le_ext_adv_cb.sent is only called when advertisements are stopped.

- MPSL radio notifications don't seem to work [anymore] ( mpsl_radio_notification_cfg_set function not available in NCS2.6 ).

- BluetoothRegistered Event Trigger doesn't seem to include an event for this.

Basically I want to update the values (battery voltage, advertisement count, uptime, etc) in my advertisement each time.

Surely this can't be so difficult? Grin

Parents Reply Children
  • Hi,

    You can refer to the PPI trace sample for how to get events from the radio via PPI (essentially triggering some task based on radio activity (in thi scase the READY event). But instead of toggling a GPIO pin via PPI, you want to trigger the EGU, so you nee to connect the PPI channel from the readio to a task on the EGU and enable interrupt for that. You can see an EGU example under modules/hal/nordic/nrfx/samples/src/nrfx_egu/.

    Note that this will let you know whenever the radio is in use, you will not be able to distinguish between advertising, connections, etc.

Related