plugins/service: Add RemoteUUID property
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 6 Jan 2014 14:13:49 +0000 (16:13 +0200)
committerMikko Ylinen <mikko.ylinen@intel.com>
Tue, 23 Sep 2014 18:29:46 +0000 (21:29 +0300)
plugins/service.c

index b660810..7b5783d 100644 (file)
@@ -128,8 +128,29 @@ static gboolean get_state(const GDBusPropertyTable *property,
        return TRUE;
 }
 
+static gboolean remote_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->remote_uuid != NULL;
+}
+
+static gboolean get_remote_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->remote_uuid);
+
+       return TRUE;
+}
+
 static const GDBusPropertyTable service_properties[] = {
        { "State", "s", get_state, NULL, NULL },
+       { "RemoteUUID", "s", get_remote_uuid, NULL, remote_uuid_exists },
        { }
 };