Diff between 170259bb533c2c98ff9a711bbc3db474df0482f2 and 384369fb18de79d6547954b8dd1d5b022ccb1e53

Changed Files

File Additions Deletions Status
plugins/mgmtops.c +4 -5 modified

Full Patch

diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index 139b058..4a7bfff 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
@@ -909,8 +909,8 @@ static void read_index_list_complete(int sk, void *buf, size_t len)
 		index = btohs(bt_get_unaligned(&rp->index[i]));
 
 		add_controller(index);
-		get_connections(sk, index);
 		clear_uuids(index);
+		read_info(sk, index);
 	}
 }
 
@@ -972,9 +972,10 @@ static void read_info_complete(int sk, uint16_t index, void *buf, size_t len)
 		return;
 	}
 
-	if (mgmt_powered(info->current_settings))
+	if (mgmt_powered(info->current_settings)) {
 		mgmt_update_powered(adapter, info->current_settings);
-	else
+		get_connections(sk, index);
+	} else
 		mgmt_set_powered(index, TRUE);
 
 	adapter_name_changed(adapter, (char *) rp->name);
@@ -1070,8 +1071,6 @@ static void get_connections_complete(int sk, uint16_t index, void *buf,
 		bdaddr_t *bdaddr = g_memdup(&rp->addr[i], sizeof(bdaddr_t));
 		info->connections = g_slist_append(info->connections, bdaddr);
 	}
-
-	read_info(sk, index);
 }
 
 static void set_local_name_complete(int sk, uint16_t index, void *buf,