diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-01-28 09:43:53 -0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2016-01-28 14:08:27 +0200 |
commit | 05a5ce39614bcb82afabe5e4684eeeeea9cfd21e (patch) | |
tree | 16ee517537afe81881d25e433907c36d8e2ced43 | |
parent | aad84e0028a7109ea14094b45c48c79e4aeb0f3f (diff) | |
download | bluez-05a5ce39614bcb82afabe5e4684eeeeea9cfd21e.tar.gz |
plugins/service: Add Device property
-rw-r--r-- | plugins/service.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/service.c b/plugins/service.c index 25dd06ec1..7ce933371 100644 --- a/plugins/service.c +++ b/plugins/service.c @@ -152,6 +152,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) { @@ -207,6 +219,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 }, |