Bluetooth: host: Don't restart scan if connection is pending
With multiple devices on auto-connect list it is possible that while having pending connection to device A, device B disconnects. In that case host should not try to start scan (currently controller doesn't support concurrent scanning and initiating). Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This commit is contained in:
parent
148d515f9b
commit
602e08c69a
1 changed files with 7 additions and 0 deletions
|
@ -3182,6 +3182,13 @@ int bt_le_scan_update(bool fast_scan)
|
|||
u16_t interval, window;
|
||||
struct bt_conn *conn;
|
||||
|
||||
/* don't restart scan if we have pending connection */
|
||||
conn = bt_conn_lookup_state_le(NULL, BT_CONN_CONNECT);
|
||||
if (conn) {
|
||||
bt_conn_unref(conn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
conn = bt_conn_lookup_state_le(NULL, BT_CONN_CONNECT_SCAN);
|
||||
if (!conn) {
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue