aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-02-24 00:45:46 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-24 00:47:12 +0200
commit8136e7ba9a678d8a8459ac7bbdf939ab436ae21f (patch)
treebc4bca85bc9bc9761139067711456636c14caf4c /plugins
parent4ef8aae454865a35ea9deaee8fb4bdabb7ad758b (diff)
downloadbluez-8136e7ba9a678d8a8459ac7bbdf939ab436ae21f.tar.gz
bluez-8136e7ba9a678d8a8459ac7bbdf939ab436ae21f.tar.xz
bluez-8136e7ba9a678d8a8459ac7bbdf939ab436ae21f.zip
mgmtops: Fix read_info response handling
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mgmtops.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index 3ea8f6df..f049c644 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
@@ -989,19 +989,20 @@ static void read_info_complete(int sk, uint16_t index, void *buf, size_t len)
return;
}
+ adapter_name_changed(adapter, (char *) rp->name);
+
btd_adapter_get_mode(adapter, &mode, NULL, NULL);
- if (mode == MODE_OFF) {
+ if (mode == MODE_OFF && mgmt_powered(info->current_settings)) {
mgmt_set_powered(index, FALSE);
return;
}
- if (mgmt_powered(info->current_settings)) {
- mgmt_update_powered(adapter, info->current_settings);
- get_connections(sk, index);
- } else
+ if (mode != MODE_OFF && !mgmt_powered(info->current_settings))
mgmt_set_powered(index, TRUE);
-
- adapter_name_changed(adapter, (char *) rp->name);
+ else {
+ get_connections(sk, index);
+ btd_adapter_start(adapter);
+ }
btd_adapter_unref(adapter);
}