summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-common.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@indt.org.br>2008-07-09 16:19:51 -0300
committerLuiz Augusto von Dentz <luiz.dentz@indt.org.br>2008-07-28 10:36:47 -0300
commitdc38fc68b74e98af1139d7769a1d91a98139af99 (patch)
tree213df980e15318de87a85afc2c979952ded066ca /hcid/dbus-common.c
parent555fcc9b4bf67e923708af8de46aa91b7077f050 (diff)
Move adapter initialization code from dbus-hci.c to manager.c.
Diffstat (limited to 'hcid/dbus-common.c')
-rw-r--r--hcid/dbus-common.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/hcid/dbus-common.c b/hcid/dbus-common.c
index a2b25588..e779549c 100644
--- a/hcid/dbus-common.c
+++ b/hcid/dbus-common.c
@@ -157,7 +157,7 @@ static gboolean system_bus_reconnect(void *data)
manager_set_default_adapter(-1);
for (i = 0; i < dl->dev_num; i++, dr++)
- hcid_dbus_register_device(dr->dev_id);
+ manager_register_adapter(dr->dev_id);
ret_val = FALSE;
@@ -192,14 +192,19 @@ void hcid_dbus_unregister(void)
return;
for (i = 0; children[i]; i++) {
- char dev_path[MAX_PATH_LENGTH];
+ char path[MAX_PATH_LENGTH];
+ struct adapter *adapter;
if (children[i][0] != 'h')
continue;
- snprintf(dev_path, sizeof(dev_path), "/%s", children[i]);
+ snprintf(path, sizeof(path), "/%s", children[i]);
- unregister_adapter_path(dev_path);
+ adapter = manager_find_adapter_by_path(path);
+ if (!adapter)
+ continue;
+
+ manager_unregister_adapter(adapter->dev_id);
}
dbus_free_string_array(children);