Hello, as from title, after updating from ncs 2.7.0 to 3.0.2 my application cannot advertise and scan concurrently anymore.
If I start advertising after starting a scan:
[00:00:18.599,731] <inf> ble: Scanning started [00:00:18.600,494] <wrn> bt_hci_core: opcode 0x2005 status 0x0c [00:00:18.600,830] <wrn> bt_id: cmd disallowed [00:00:18.606,109] <err> main: Failed to start advertising, err -13
If I start scanning after starting advertising
[00:00:04.347,869] <wrn> bt_hci_core: opcode 0x200c status 0x12 [00:00:04.348,236] <err> main: Failed to start scanning for peer, err -22
Advertising is started like this
int ble_adv_start(void){ // with BT_LE_ADV_OPT_CONNECTABLE the advertizing stops automatically // when CONFIG_BT_MAX_CONN connections are established struct bt_data ad[] = { BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)), BT_DATA_BYTES(BT_DATA_NAME_SHORTENED, CONFIG_BT_DEVICE_NAME), }; return bt_le_adv_start( BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE, BT_GAP_ADV_FAST_INT_MAX_1, BT_GAP_ADV_FAST_INT_MAX_2, NULL), // todo: directed adv over disconnect? ad, ARRAY_SIZE(ad), NULL, 0); }
Scanning is started like this
int ble_scan_for_peer(void){ if(connections[BLE_CONN_PEER]){ return -EALREADY; } /* Use active scanning and disable duplicate filtering to handle any * devices that might update their advertising data at runtime. */ struct bt_le_scan_param scan_param = { .type = BT_LE_SCAN_TYPE_PASSIVE, .options = BT_LE_SCAN_OPT_NONE, // todo add coded phy support? .interval = BT_GAP_PER_ADV_FAST_INT_MAX_2, .window = BT_GAP_PER_ADV_FAST_INT_MIN_1, }; int err = bt_le_scan_start(&scan_param, device_found); if(err){ return err; } LOG_INF("Scanning started"); return 0; }
I'm also getting this warning warning: 'BT_LE_ADV_OPT_CONNECTABLE' is deprecated
in the advertising function, but I think this should still work fine by reading the documentation.
This was working perfectly fine in 2.7.0. Was this feature deprecated?