diff options
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/dbus-adapter.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c index a7dce984..2fec2542 100644 --- a/hcid/dbus-adapter.c +++ b/hcid/dbus-adapter.c @@ -428,9 +428,6 @@ static DBusHandlerResult adapter_set_mode(DBusConnection *conn, (hcid.offmode == HCID_OFFMODE_NOSCAN || (hcid.offmode == HCID_OFFMODE_DEVDOWN && hci_mode != SCAN_DISABLED))) { - /* The new value will be loaded when the adapter comes UP */ - write_device_mode(&local, scan_mode); - /* Start HCI device */ if (ioctl(dd, HCIDEVUP, adapter->dev_id) == 0) goto done; /* on success */ @@ -452,8 +449,6 @@ static DBusHandlerResult adapter_set_mode(DBusConnection *conn, return error_failed(conn, msg, errno); } - write_device_mode(&local, scan_mode); - goto done; } @@ -485,11 +480,11 @@ static DBusHandlerResult adapter_set_mode(DBusConnection *conn, hci_close_dev(dd); return error_failed(conn, msg, bt_error(status)); } - - write_device_mode(&local, scan_mode); } done: + write_device_mode(&local, scan_mode); + hci_close_dev(dd); reply = dbus_message_new_method_return(msg); |