From cc6b8c3a6f0cda66ec892adf569130c03580ae04 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Wed, 15 Jan 2020 14:32:01 +0100 Subject: [PATCH] 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 --- subsys/bluetooth/host/conn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 8bdd73570a8..2820f5768dc 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -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) */ } }