diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2006-11-21 13:03:48 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2006-11-21 13:03:48 +0000 |
commit | 8982d081ea2af0687e2eb7e3babff5d692f0577c (patch) | |
tree | 433f4d2a3706c91cc5d4fac8f14d9925757cbabb /hcid/dbus-adapter.c | |
parent | 253ba836f00b17a4da1436520f3735593ba9493d (diff) |
Improve "off" mode behaviour when offmode=devdown
Diffstat (limited to 'hcid/dbus-adapter.c')
-rw-r--r-- | hcid/dbus-adapter.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c index c7bc7671..bc45da9a 100644 --- a/hcid/dbus-adapter.c +++ b/hcid/dbus-adapter.c @@ -397,6 +397,7 @@ static DBusHandlerResult adapter_set_mode(DBusConnection *conn, const char* scan_mode; uint8_t hci_mode; const uint8_t current_mode = adapter->mode; + bdaddr_t local; int dd; dbus_error_init(&err); @@ -422,6 +423,8 @@ static DBusHandlerResult adapter_set_mode(DBusConnection *conn, else return error_invalid_arguments(conn, msg); + str2ba(adapter->address, &local); + dd = hci_open_dev(adapter->dev_id); if (dd < 0) return error_no_such_adapter(conn, msg); @@ -430,9 +433,6 @@ static DBusHandlerResult adapter_set_mode(DBusConnection *conn, (hcid.offmode == HCID_OFFMODE_NOSCAN || (hcid.offmode == HCID_OFFMODE_DEVDOWN && hci_mode != SCAN_DISABLED))) { - bdaddr_t local; - - str2ba(adapter->address, &local); /* The new value will be loaded when the adapter comes UP */ write_device_mode(&local, scan_mode); @@ -457,6 +457,8 @@ static DBusHandlerResult adapter_set_mode(DBusConnection *conn, return error_failed(conn, msg, errno); } + write_device_mode(&local, scan_mode); + goto done; } |