diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2006-11-21 14:48:18 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2006-11-21 14:48:18 +0000 |
commit | b3e36f1329d10cc97d854f84137e3568cb59a9a7 (patch) | |
tree | cce83533a01a9284fbc5584405fd6accef693c45 /hcid/main.c | |
parent | 8982d081ea2af0687e2eb7e3babff5d692f0577c (diff) |
Fall back to hcid.conf setting if offmode=devdown, mode is "off", and somebody does a DEVUP
Diffstat (limited to 'hcid/main.c')
-rw-r--r-- | hcid/main.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/hcid/main.c b/hcid/main.c index 5f05543b..722a3b15 100644 --- a/hcid/main.c +++ b/hcid/main.c @@ -289,7 +289,7 @@ static void configure_device(int hdev) /* Set scan mode */ if (!read_device_mode(&di.bdaddr, mode, sizeof(mode))) { - if (!strcmp(mode, MODE_OFF)) + if (!strcmp(mode, MODE_OFF) && hcid.offmode == HCID_OFFMODE_NOSCAN) device_opts->scan = SCAN_DISABLED; else if (!strcmp(mode, MODE_CONNECTABLE)) device_opts->scan = SCAN_PAGE; @@ -302,12 +302,10 @@ static void configure_device(int hdev) } } - if (!(hcid.offmode == HCID_OFFMODE_DEVDOWN && !strcmp(mode, MODE_OFF))) { - dr.dev_opt = device_opts->scan; - if (ioctl(s, HCISETSCAN, (unsigned long) &dr) < 0) { - error("Can't set scan mode on hci%d: %s (%d)", - hdev, strerror(errno), errno); - } + dr.dev_opt = device_opts->scan; + if (ioctl(s, HCISETSCAN, (unsigned long) &dr) < 0) { + error("Can't set scan mode on hci%d: %s (%d)", + hdev, strerror(errno), errno); } /* Set device name */ |