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

Sending IBeacon and connectable advertising in parallel

I am using a nrf52832 with SDK 15.2 and softdevice s132 v6.1

My peripharal should transmit an iBeacon to wake up an application on the smartphone and also transmit a connectable advertising telegram so the smartphone can establish a connection with me after the wake up.

Can I setup 2 broadcasters in parallel to broadcast the IBeacon and the connectable advertising? I have searched the docu and I think it is not possible.

I am therefor trying to to stop the iBeacon advertising and init a new advertising for the connectable advertising. When doing this, I get the error "NO_MEMORY" when calling  sd_ble_gap_adv_set_configure.

In the docu of sd_ble_gap_adv_start, the EVENT BLE_GAP_EVT_ADV_SET_TERMINATED is mentioned. When is this Event triggered? Or what is required to trigger this event?

What is the correct sequence to switch the advertising mode in this way:

init IBeacon advertising
start IBeacon advertising
stop IBeacon advertising

init connectable advertising
start connectable advertising
stop connectable advertising

init IBeacon advertising
start IBeacon advertising
stop IBeacon advertising

init connectable advertising
start connectable advertising
stop connectable advertising

and so on....

Happy coding

Christian

  • Hi,

    Number of advertisement sets is currently limited to one, hence the NO_MEM error when you try to add a new set with sd_ble_gap_adv_set_configure. The terminated event will be triggered on advertisment timeout if you have enabled it, see duration/max_adv_evts in ble_gap_adv_params_t.

    It is possible to update the advertisment payload on the fly. The limitation is that you have to use the same adv. parameters for both modes (ble_gap_adv_params_t). We introduced a new API in the advertisment module in SDK 15.2.0 that does exactly this, see ble_advertising.c->ble_advertising_advdata_update(). 

    Alternatively, you can use the terminated event to switch "modes". This approach would allow you to use different advertisement intervals for the ibeacon and the connectable packets. 

    The init->start->stop sequence will also work. 

    Vidar

     

  • Hi Vidar

    Using your answer, the following should work:

    init IBeacon advertising with short timeout
    start IBeacon advertising
    -> wait for event BLE_GAP_EVT_ADV_SET_TERMINATED 

    init connectable advertising with short timeout
    start connectable advertising
    -> wait for event BLE_GAP_EVT_ADV_SET_TERMINATED

    init IBeacon advertising with short timeout
    start IBeacon advertising
    -> wait for event BLE_GAP_EVT_ADV_SET_TERMINATED

    init connectable advertising with short timeout
    start connectable advertising
    -> wait for event BLE_GAP_EVT_ADV_SET_TERMINATED

    and so on....

    Can you confirm this

    Happy coding
    Christian

  • Hi Christian,

    Yes, based on the API documentation this should work, but have not verified it myself. 

    Best regards,

    Vidar

Related