diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-03-19 13:24:41 +0000 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-03-19 13:24:41 +0000 |
commit | 851ad267e554850ae2cbfd486922cbcfb897f8b5 (patch) | |
tree | 9a393fb7e36f3782cf54caac05592e9c41be5918 /network/connection.c | |
parent | ad868bd4137e86fbf141175f411898796287ff2a (diff) |
- Fix standalone init when there is no bluetooth adapter.
Diffstat (limited to 'network/connection.c')
-rw-r--r-- | network/connection.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/network/connection.c b/network/connection.c index cdcdcbb1..4966a7e1 100644 --- a/network/connection.c +++ b/network/connection.c @@ -33,6 +33,7 @@ #include "dbus.h" #define NETWORK_CONNECTION_INTERFACE "org.bluez.network.Manager" +#define NETWORK_CONNECTION_PATH "/org/bluez/network/connection" #define NETWORK_ERROR_INTERFACE "org.bluez.Error" #include "connection.h" @@ -153,3 +154,28 @@ static const DBusObjectPathVTable connection_table = { .unregister_function = connection_unregister, }; +int connection_register(DBusConnection *conn, const char *path) +{ + struct network_conn *nc; + static int nc_uid = 0; + + if (!conn) + return -1; + + nc = g_new0(struct network_conn, 1); + + /* register path */ + if (!dbus_connection_register_object_path(conn, path, + &connection_table, nc)) { + error("D-Bus failed to register %s path", path); + goto fail; + } + + nc->path = g_strdup(path); + info("Registered connection path:%s", path); + + return 0; +fail: + connection_free(nc); + return -1; +} |