summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-02-07 16:04:32 +0200
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-03-09 18:21:42 +0000
commit01224227bb26ad264a1c6ecf02a18e8683857284 (patch)
tree73586ee501a6d5d261cb5afa96a3273e2f1608f8
parent839f50fb3cb0db9d0f8a1d1b35f9cb2ee87d1fc6 (diff)
downloadbluez-01224227bb26ad264a1c6ecf02a18e8683857284.tar.gz
plugins/service: Add Version property
-rw-r--r--plugins/service.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/service.c b/plugins/service.c
index 128ad7cf3..c2584c07b 100644
--- a/plugins/service.c
+++ b/plugins/service.c
@@ -216,11 +216,32 @@ static gboolean get_local_uuid(const GDBusPropertyTable *property,
return TRUE;
}
+static gboolean version_exists(const GDBusPropertyTable *property,
+ void *user_data)
+{
+ struct service_data *data = user_data;
+ uint16_t version = btd_service_get_version(data->service);
+
+ return version != 0x0000;
+}
+
+static gboolean get_version(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *user_data)
+{
+ struct service_data *data = user_data;
+ uint16_t version = btd_service_get_version(data->service);
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &version);
+
+ return TRUE;
+}
+
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 },
+ { "Version", "q", get_version, NULL, version_exists },
{ }
};