Advertiser can't restart unless deprecated macro BT_LE_ADV_CONN is used (Central & Peripheral are both active)

*Note that this is only an issue when the central and peripheral are simultaneously active.

This is my current setup for starting advertising, but it requires a deprecated macro:

err = bt_le_adv_start( BT_LE_ADV_CONN, // YES this is deprecated. There is a bug (or unclear usage req) that leaves "adv*" NULL when this isn't used.
                                       // and prevents the advertiser from restarting. 
                                       // see: https://github.com/zephyrproject-rtos/zephyr/blob/8e5e9922c5c428d457568e317256894efccce078/subsys/bluetooth/host/adv.c#L1526N
                       ble_adv_data,  ARRAY_SIZE(ble_adv_data), 
                       ble_scan_data, ARRAY_SIZE(ble_scan_data) );

The macro description recommends using BT_LE_ADV_CONN_FAST_1 or BT_LE_ADV_CONN_FAST_2 instead, but when I use either one I am unable to restart advertising after stopping once. It fails with err -12 (-ENOMEM).

Is there a way to make this work without using the deprecated macro?

Thanks!

- Riley

Parents Reply Children
Related