Extended advertising call-back register

Hallo,

currently I try to optimise the functionality of my extended advertiser code. I found that there are also some call-backs defined for extended advertisers. The struct bt_le_ext_adv_cb contains fields for sent, connected and scanned call-back functions. But I didn't find a function to register my call-backs. In case of scanning devices, there is the struct bt_le_scan_cb, an instance of which is to be used with the register function bt_le_scan_cb_register(). How can I realise that in case of extended advertising call-backs - does an appropriate "bt_le_ext_adv_cb_register()" function exist?

Kind regards

Axel

Parents
  • Hello,

    If you have a look at the sample found in:

    NCS\nrf\samples\bluetooth\multiple_adv_sets, you can see that this uses an instance of bt_le_ext_adv_cb, which is registered using bt_le_ext_adv_create() inside advertising_set_create();

    This is all implemented in adv.c, and relying on already existing events in hci_core, such as bt_hci_le_adv_set_terminated() and bt_hci_le_scan_req_received(). The implementation inside adv.c is not too difficult to read. It just checks whether the callback exists (not NULL), and then it triggers the appropriate callback.

    Best regards,

    Edvin

Reply
  • Hello,

    If you have a look at the sample found in:

    NCS\nrf\samples\bluetooth\multiple_adv_sets, you can see that this uses an instance of bt_le_ext_adv_cb, which is registered using bt_le_ext_adv_create() inside advertising_set_create();

    This is all implemented in adv.c, and relying on already existing events in hci_core, such as bt_hci_le_adv_set_terminated() and bt_hci_le_scan_req_received(). The implementation inside adv.c is not too difficult to read. It just checks whether the callback exists (not NULL), and then it triggers the appropriate callback.

    Best regards,

    Edvin

Children
Related