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

2 beacon packets same chip

Hello, my question is pretty clear i guess. Is it possible to schedule advertising of 2 different packets on the same chip ?

The way i see it, it should be possible to initialise 2 ble_gap_adv_params_t sturctures, and then in main i can start advertising of one structure, then stop it and start advertising the other one. However doing this manually seems to require precise timing and is more power consuming. Is there any sort of scheduling mechanism in place to do that? (I thought that's what device manager would do, but i dont think it does that. I'm not sure where to look, so all i need is maybe direction where to look at.)

Thanks !

  • Hi,

    Sure it is. You can use on_ble_radio_active_evt(...) function from /components/ble/ble_radio_notification module which notifies you before each advertising event. This allows you to alter advertising data before each broadcast so you can e.g. be switching two different data formats which will appear with double the adv. frequency. It should be even possible to alter Adv. Address which should make your device visible as two virtually independent broadcasters. Of course this can scale up to more than 2 virtual devices, the only problem could be value of advertising interval (e.g. you couldn't pretend to be two devices with 20ms connectable advertisement because stack doesn't support 10ms effective adv. interval). If you would like to have your broadcaster connectable (as slave) then you might face problems with keeping the broadcasts during the ongoing connection (you can only do Unconnectable broadcasting when serving connection as GAP peripheral). But I guess this is far beyond your intentions...

    Cheers Jan

  • You can use sd_ble_gap_adv_data_set to update the advertisement data in on_ble_radio_active_evt().

Related