adapter: Fix check of DISCOVERABLE setting
authorJakob hilmer <jakob@hilmer.dk>
Sat, 9 Apr 2022 10:01:30 +0000 (12:01 +0200)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
The test for `DISCOVERABLE` should be done with
`MGMT_SETTING_DISCOVERABLE` instead of `MGMT_OP_SET_DISCOVERABLE`.
Acked-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/adapter.c

index 9bf6af2..665bf63 100644 (file)
@@ -2792,7 +2792,7 @@ static bool set_discovery_discoverable(struct btd_adapter *adapter, bool enable)
                return true;
 
        /* Reset discoverable filter if already set */
-       if (enable && (adapter->current_settings & MGMT_OP_SET_DISCOVERABLE))
+       if (enable && (adapter->current_settings & MGMT_SETTING_DISCOVERABLE))
                return true;
 
        adapter->discovery_discoverable = enable;
@@ -3125,7 +3125,7 @@ static int update_discovery_filter(struct btd_adapter *adapter)
        /* Only attempt to overwrite current discoverable setting when not
         * discoverable.
         */
-       if (!(adapter->current_settings & MGMT_OP_SET_DISCOVERABLE)) {
+       if (!(adapter->current_settings & MGMT_SETTING_DISCOVERABLE)) {
                GSList *l;
 
                for (l = adapter->discovery_list; l; l = g_slist_next(l)) {