summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-01-28 09:43:53 -0800
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-03-09 18:21:42 +0000
commit839f50fb3cb0db9d0f8a1d1b35f9cb2ee87d1fc6 (patch)
tree85f17e80fa6015b20cea7fa4e5e20ea71cef28ff
parent565b820bcd45b0adbac0289a24849edef56f8c95 (diff)
downloadbluez-839f50fb3cb0db9d0f8a1d1b35f9cb2ee87d1fc6.tar.gz
plugins/service: Add Device property
-rw-r--r--plugins/service.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/service.c b/plugins/service.c
index 69bae8f7e..128ad7cf3 100644
--- a/plugins/service.c
+++ b/plugins/service.c
@@ -150,6 +150,18 @@ static const char *data_get_state(struct service_data *data)
return "unknown";
}
+static gboolean get_device(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *user_data)
+{
+ struct service_data *data = user_data;
+ struct btd_device *dev = btd_service_get_device(data->service);
+ const char *path = btd_device_get_path(dev);
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, &path);
+
+ return TRUE;
+}
+
static gboolean get_state(const GDBusPropertyTable *property,
DBusMessageIter *iter, void *user_data)
{
@@ -205,6 +217,7 @@ static gboolean get_local_uuid(const GDBusPropertyTable *property,
}
static const GDBusPropertyTable service_properties[] = {
+ { "Device", "o", get_device, NULL, NULL },
{ "State", "s", get_state, NULL, NULL },
{ "RemoteUUID", "s", get_remote_uuid, NULL, remote_uuid_exists },
{ "LocalUUID", "s", get_local_uuid, NULL, local_uuid_exists },