Using nRF5340 hci code, I've been able to get a device that connects and authenticates with two central devices. However, after connecting with one central device, I no longer see any advertisements with my other central device. Is there a way to connect multiple centrals to one peripheral?
prj.conf for bluetooth
CONFIG_BT=y CONFIG_BT_SMP=y CONFIG_BT_SMP_APP_PAIRING_ACCEPT=y CONFIG_BT_SECURITY_ERR_TO_STR=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_MAX_CONN=2 CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=2 CONFIG_BT_MAX_PAIRED=10
Code sequence
1. bt_conn_auth_cb_register
2. bt_conn_auth_info_cb_register
3. bt_conn_cb_register
4. bt_enable
5.
const bt_le_adv_param advParam = BT_LE_ADV_PARAM_INIT(BT_LE_ADV_OPT_CONNECTABLE,
BT_GAP_ADV_FAST_INT_MIN_2,
BT_GAP_ADV_FAST_INT_MAX_2,
NULL);
int err = bt_le_adv_start(&advParam, sAdvertisingData, ARRAY_SIZE(sAdvertisingData), sScanData, ARRAY_SIZE(sScanData));
I read that advertising might need to be restarted so I called bt_le_adv_start again after connecting but that returns a -12 error (ENOMEM)
I am not setting BT_LE_ADV_OPT_ONE_TIME so I would have expected it to keep advertising.
[00:00:00.455,322] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002) [00:00:00.455,352] <inf> bt_hci_core: HW Variant: nRF53x (0x0003) [00:00:00.455,352] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 254.63788 Build 573996906 [00:00:00.492,218] <inf> bt_hci_core: Identity: E3:13:CC:30:DD:E9 (random) [00:00:00.492,218] <inf> bt_hci_core: HCI: version 6.0 (0x0e) revision 0x204e, manufacturer 0x0059 [00:00:00.492,248] <inf> bt_hci_core: LMP: version 6.0 (0x0e) subver 0x204e
This is using SDK v2.8.0