Skip to content

Commit c01d938

Browse files
MarekPietarlubos
authored andcommitted
applications: nrf_desktop: Align conn params in BLE scan module
Change aligns connection paramters used by BLE scan module to the connection paramters used by BLE conn params module. If a dongle supports LLPM and more than one BLE connection, connection interval of 10 ms needs to be used for peripherals without LLPM support. Jira: NCSDK-30261 Signed-off-by: Marek Pieta <[email protected]>
1 parent a5941fa commit c01d938

File tree

1 file changed

+0
-58
lines changed

1 file changed

+0
-58
lines changed

applications/nrf_desktop/src/modules/ble_scan.c

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -362,55 +362,6 @@ static int configure_filters(void)
362362
return err;
363363
}
364364

365-
static bool is_llpm_peer_connected(void)
366-
{
367-
bool llpm_peer_connected = false;
368-
369-
__ASSERT_NO_MSG(IS_ENABLED(CONFIG_CAF_BLE_USE_LLPM));
370-
371-
for (size_t i = 0; i < ARRAY_SIZE(subscribed_peers); i++) {
372-
const bt_addr_le_t *addr = &subscribed_peers[i].addr;
373-
374-
if (!bt_addr_le_cmp(addr, BT_ADDR_LE_NONE)) {
375-
break;
376-
}
377-
378-
struct bt_conn *conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, addr);
379-
380-
if (conn) {
381-
bt_conn_unref(conn);
382-
if (subscribed_peers[i].llpm_support) {
383-
llpm_peer_connected = true;
384-
break;
385-
}
386-
}
387-
}
388-
389-
return llpm_peer_connected;
390-
}
391-
392-
static void update_init_conn_params(bool llpm_peer_connected)
393-
{
394-
struct bt_le_conn_param cp = {
395-
.latency = 0,
396-
.timeout = 400,
397-
};
398-
399-
/* In case LLPM peer is already connected, the next peer has to be
400-
* connected with 10 ms connection interval instead of 7.5 ms.
401-
* Connecting with 7.5 ms may cause Bluetooth scheduling issues.
402-
*/
403-
if (llpm_peer_connected) {
404-
cp.interval_min = 8;
405-
cp.interval_max = 8;
406-
} else {
407-
cp.interval_min = 6;
408-
cp.interval_max = 6;
409-
}
410-
411-
bt_scan_update_init_conn_params(&cp);
412-
}
413-
414365
static int scan_start(void)
415366
{
416367
int err = scan_stop();
@@ -420,15 +371,6 @@ static int scan_start(void)
420371
return err;
421372
}
422373

423-
if (IS_ENABLED(CONFIG_CAF_BLE_USE_LLPM) && (CONFIG_BT_MAX_CONN == 2)) {
424-
/* If the central supports the LLPM and more than two
425-
* simultaneous Bluetooth connections, the BLE peers use the
426-
* connection interval of 10 ms instead of 7.5 ms and there is
427-
* no need to update the initial connection parameters.
428-
*/
429-
update_init_conn_params(is_llpm_peer_connected());
430-
}
431-
432374
err = configure_filters();
433375
if (err) {
434376
LOG_ERR("Cannot set filters (err %d)", err);

0 commit comments

Comments
 (0)