Bluetooth: host: Ifdef starting of background scanner in init

Starting a background scanner for auto-connection is an API that is only
available when whitelist API is not enabled.
There is currently no way to set this bit when the whitelist API is
enabled so there is not any issues with the current code, but it is
still not correct.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2020-01-15 14:32:01 +01:00 committed by Johan Hedberg
commit cc6b8c3a6f

View file

@ -2652,12 +2652,14 @@ int bt_conn_init(void)
continue;
}
#if !defined(CONFIG_BT_WHITELIST)
if (atomic_test_bit(conn->flags,
BT_CONN_AUTO_CONNECT)) {
/* Only the default identity is supported */
conn->id = BT_ID_DEFAULT;
bt_conn_set_state(conn, BT_CONN_CONNECT_SCAN);
}
#endif /* !defined(CONFIG_BT_WHITELIST) */
}
}