summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-01-20 21:44:09 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-01-20 21:44:09 +0000
commitbc83a777f42ad7d74c9589967c994c259332f9c1 (patch)
tree3f4582e644c34e25aaf4bcd50eff3010324e39a9
parentee0d353d9dc1b7ea330312bd644c5d3012e211d0 (diff)
Add support for GetIdentifier
-rw-r--r--daemon/service.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/daemon/service.c b/daemon/service.c
index 3d523a34..f76829b4 100644
--- a/daemon/service.c
+++ b/daemon/service.c
@@ -112,6 +112,22 @@ DBusHandlerResult manager_activate_service(DBusConnection *conn,
return dbus_connection_send_and_unref(conn, reply);
}
+static DBusHandlerResult service_get_identifier(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ DBusMessage *reply;
+ const char name[] = "service", *ptr = name;
+
+ reply = dbus_message_new_method_return(msg);
+ if (!reply)
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
+
+ dbus_message_append_args(reply, DBUS_TYPE_STRING, &ptr,
+ DBUS_TYPE_INVALID);
+
+ return dbus_connection_send_and_unref(conn, reply);
+}
+
static DBusHandlerResult service_get_name(DBusConnection *conn,
DBusMessage *msg, void *data)
{
@@ -178,7 +194,7 @@ static DBusHandlerResult service_start(DBusConnection *conn,
dbus_message_append_args(reply, DBUS_TYPE_INVALID);
- g_shell_parse_argv("/data/bluez/utils/daemon/bluetoothd_echo", &argc, &argv, NULL);
+ g_shell_parse_argv(SERVICEDIR "bluetoothd-service-echo", &argc, &argv, NULL);
g_spawn_async(NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &pid, NULL);
@@ -242,6 +258,8 @@ static DBusHandlerResult service_is_running(DBusConnection *conn,
}
static DBusMethodVTable service_table[] = {
+ { "GetIdentifier", service_get_identifier,
+ DBUS_TYPE_INVALID_AS_STRING, DBUS_TYPE_STRING_AS_STRING },
{ "GetName", service_get_name,
DBUS_TYPE_INVALID_AS_STRING, DBUS_TYPE_STRING_AS_STRING },
{ "GetDescription", service_get_description,