From 39d940bb39d6db89511a32c0997419d2f2f03ec5 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 6 Jan 2014 16:19:39 +0200 Subject: plugins/service: Add LocalUUID property --- plugins/service.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/plugins/service.c b/plugins/service.c index ae805157f..0cd600bd8 100644 --- a/plugins/service.c +++ b/plugins/service.c @@ -150,9 +150,31 @@ static gboolean get_remote_uuid(const GDBusPropertyTable *property, return TRUE; } + +static gboolean local_uuid_exists(const GDBusPropertyTable *property, + void *user_data) +{ + struct service_data *data = user_data; + struct btd_profile *p = btd_service_get_profile(data->service); + + return p->local_uuid != NULL; +} + +static gboolean get_local_uuid(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *user_data) +{ + struct service_data *data = user_data; + struct btd_profile *p = btd_service_get_profile(data->service); + + dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &p->local_uuid); + + return TRUE; +} + static const GDBusPropertyTable service_properties[] = { { "State", "s", get_state, NULL, NULL }, { "RemoteUUID", "s", get_remote_uuid, NULL, remote_uuid_exists }, + { "LocalUUID", "s", get_local_uuid, NULL, local_uuid_exists }, { } }; -- cgit v1.2.1