summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-service.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-04-17 08:43:45 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-04-17 08:43:45 +0000
commit4c911c68f8bdc213aaaa40e6726617b553694dbb (patch)
tree5386bb36526e9dd060e2c5ade15fd324df39bf53 /hcid/dbus-service.c
parent2d09985d7bc2333ad4bb24e4f1790acd8ec1467b (diff)
Implement experimental Service.GetBusName method
Diffstat (limited to 'hcid/dbus-service.c')
-rw-r--r--hcid/dbus-service.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c
index 81c4b2da..73b5c397 100644
--- a/hcid/dbus-service.c
+++ b/hcid/dbus-service.c
@@ -205,6 +205,26 @@ static DBusHandlerResult get_description(DBusConnection *conn,
return send_message_and_unref(conn, reply);
}
+static DBusHandlerResult get_bus_name(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ struct service *service = data;
+ DBusMessage *reply;
+
+ if (!service->bus_name)
+ return error_not_available(conn, msg);
+
+ reply = dbus_message_new_method_return(msg);
+ if (!reply)
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
+
+ dbus_message_append_args(reply,
+ DBUS_TYPE_STRING, &service->bus_name,
+ DBUS_TYPE_INVALID);
+
+ return send_message_and_unref(conn, reply);
+}
+
static void service_setup(gpointer data)
{
/* struct service *service = data; */
@@ -611,6 +631,7 @@ static struct service_data services_methods[] = {
{ "GetIdentifier", get_identifier },
{ "GetName", get_name },
{ "GetDescription", get_description },
+ { "GetBusName", get_bus_name },
{ "Start", start },
{ "Stop", stop },
{ "IsRunning", is_running },