summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/adapter.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/adapter.c b/src/adapter.c
index 295cddc6..49ef35d8 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -467,12 +467,9 @@ static int set_mode(struct btd_adapter *adapter, uint8_t new_mode)
adapter_set_discov_timeout(adapter,
adapter->discov_timeout);
- if (new_mode == MODE_LIMITED)
+ if (new_mode != MODE_LIMITED && adapter->mode == MODE_LIMITED)
adapter_ops->set_limited_discoverable(adapter->dev_id,
- adapter->dev.class, TRUE);
- else if (adapter->mode == MODE_LIMITED)
- adapter_ops->set_limited_discoverable(adapter->dev_id,
- adapter->dev.class,FALSE);
+ adapter->dev.class, FALSE);
}
done: