summaryrefslogtreecommitdiffstats
path: root/src/adapter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/adapter.c')
-rw-r--r--src/adapter.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/adapter.c b/src/adapter.c
index a59f2b12..4a6ea8c2 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2242,9 +2242,14 @@ static void adapter_up(struct btd_adapter *adapter, int dd)
/* Set scan mode */
if (read_device_mode(srcaddr, mode, sizeof(mode)) == 0) {
- if (!strcmp(mode, "off") && main_opts.offmode == HCID_OFFMODE_NOSCAN) {
- adapter->mode = MODE_OFF;
- adapter->scan_mode= SCAN_DISABLED;
+ if (!strcmp(mode, "off")) {
+ if (main_opts.offmode == HCID_OFFMODE_NOSCAN) {
+ adapter->mode = MODE_OFF;
+ adapter->scan_mode= SCAN_DISABLED;
+ } else if (main_opts.offmode == HCID_OFFMODE_DEVDOWN) {
+ ioctl(dd, HCIDEVDOWN, adapter->dev_id);
+ return;
+ }
} else if (!strcmp(mode, "connectable")) {
adapter->mode = MODE_CONNECTABLE;
adapter->scan_mode = SCAN_PAGE;