diff options
| author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-01-06 16:19:39 +0200 |
|---|---|---|
| committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2016-03-09 18:17:23 +0000 |
| commit | 981981942c8a42976cc90d47c4756fbd99ae4efc (patch) | |
| tree | c59a34ae848070310593f6297aa0bb6c3f3b2bd5 | |
| parent | 6126db0318891dcc5eea17f8fa26881e68ba01a4 (diff) | |
| download | bluez-981981942c8a42976cc90d47c4756fbd99ae4efc.tar.gz | |
plugins/service: Add LocalUUID property
| -rw-r--r-- | plugins/service.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/service.c b/plugins/service.c index 7b5783d33..207ac213b 100644 --- a/plugins/service.c +++ b/plugins/service.c @@ -148,9 +148,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 }, { } }; |
