diff options
author | Luiz Augusto von Dentz <luiz.dentz@indt.org.br> | 2008-08-05 17:22:52 -0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@indt.org.br> | 2008-08-05 18:26:40 -0300 |
commit | 00acfa685e3e73c619146b7ca39068eb304f1ce8 (patch) | |
tree | bd6281604d6d256625c615b98cf2a3d19fe0be0e /src/manager.c | |
parent | 6a3bd6d20c655f43e061db0473861e9698fa7cba (diff) |
Add initial implementation of adapter driver.
Diffstat (limited to 'src/manager.c')
-rw-r--r-- | src/manager.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/manager.c b/src/manager.c index cda45f4c..fc0c8738 100644 --- a/src/manager.c +++ b/src/manager.c @@ -59,7 +59,7 @@ #include "oui.h" #include "agent.h" #include "device.h" -#include "glib-helper.h" +#include "driver.h" #include "manager.h" @@ -443,14 +443,17 @@ static void manager_remove_adapter(struct adapter *adapter) int manager_register_adapter(int id) { struct adapter *adapter = adapter_create(connection, id); - const gchar *path; + GSList *l = btd_get_adapter_drivers(); if (!adapter) return -1; - path = adapter_get_path(adapter); + for (; l; l = l->next) { + struct btd_adapter_driver *driver = l->data; - __probe_servers(path); + if (driver->probe) + driver->probe(driver, (struct btd_adapter *) adapter); + } manager_add_adapter(adapter); @@ -461,6 +464,7 @@ int manager_unregister_adapter(int id) { struct adapter *adapter; const gchar *path; + GSList *l = btd_get_adapter_drivers(); adapter = manager_find_adapter_by_id(id); if (!adapter) @@ -470,7 +474,12 @@ int manager_unregister_adapter(int id) info("Unregister path: %s", path); - __remove_servers(path); + for (; l; l = l->next) { + struct btd_adapter_driver *driver = l->data; + + if (driver->remove) + driver->remove(driver, (struct btd_adapter *) adapter); + } adapter_stop(adapter); |