summaryrefslogtreecommitdiffstats
path: root/daemon/manager.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-01-18 23:15:12 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-01-18 23:15:12 +0000
commitd71d1b8aac88cc66455016e38ebdc1f79c19f36b (patch)
tree909754a10a60b172a34aa3bddf2e99aaabffee90 /daemon/manager.c
parentaa79fbd0ea4a4b97e174d6835be895ead383d885 (diff)
Add skeleton for database interface
Diffstat (limited to 'daemon/manager.c')
-rw-r--r--daemon/manager.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/daemon/manager.c b/daemon/manager.c
index 718c2b2e..7dbb7417 100644
--- a/daemon/manager.c
+++ b/daemon/manager.c
@@ -27,17 +27,14 @@
#include <dbus/dbus.h>
-#include "logging.h"
-#include "dbus.h"
-
#include "dbus-helper.h"
+#include "logging.h"
+#include "system.h"
#include "manager.h"
#define MANAGER_INTERFACE "org.bluez.Manager"
-#define MANAGER_PATH "/org/bluez"
-
static DBusConnection *connection = NULL;
static DBusHandlerResult list_adapters(DBusConnection *conn,
@@ -60,7 +57,7 @@ static DBusHandlerResult list_adapters(DBusConnection *conn,
dbus_message_iter_close_container(&iter, &array);
- return send_message_and_unref(conn, reply);
+ return dbus_connection_send_and_unref(conn, reply);
}
static DBusHandlerResult find_adapter(DBusConnection *conn,
@@ -76,7 +73,7 @@ static DBusHandlerResult find_adapter(DBusConnection *conn,
dbus_message_append_args(reply, DBUS_TYPE_STRING, &ptr,
DBUS_TYPE_INVALID);
- return send_message_and_unref(conn, reply);
+ return dbus_connection_send_and_unref(conn, reply);
}
static DBusHandlerResult default_adapter(DBusConnection *conn,
@@ -92,7 +89,7 @@ static DBusHandlerResult default_adapter(DBusConnection *conn,
dbus_message_append_args(reply, DBUS_TYPE_STRING, &ptr,
DBUS_TYPE_INVALID);
- return send_message_and_unref(conn, reply);
+ return dbus_connection_send_and_unref(conn, reply);
}
static DBusMethodVTable manager_table[] = {
@@ -111,17 +108,9 @@ int manager_init(DBusConnection *conn)
info("Starting manager interface");
- if (dbus_connection_create_object_path(connection,
- MANAGER_PATH, NULL, NULL) == FALSE) {
- error("Manager path registration failed");
- dbus_connection_unref(connection);
- return -1;
- }
-
- if (dbus_connection_register_interface(connection, MANAGER_PATH,
+ if (dbus_connection_register_interface(connection, SYSTEM_PATH,
MANAGER_INTERFACE, manager_table, NULL) == FALSE) {
error("Manager interface registration failed");
- dbus_connection_destroy_object_path(connection, MANAGER_PATH);
dbus_connection_unref(connection);
return -1;
}
@@ -133,8 +122,6 @@ void manager_exit(void)
{
info("Stopping manager interface");
- dbus_connection_destroy_object_path(connection, MANAGER_PATH);
-
dbus_connection_unref(connection);
connection = NULL;