summaryrefslogtreecommitdiff
path: root/gdbus/object.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-10-12 10:55:37 +0200
committerMarcel Holtmann <marcel@holtmann.org>2012-11-26 14:44:48 +0100
commit704a4ef5a925a78d34be5b554de748fc4012c303 (patch)
tree5ec5290af20792aa64f2a5442436fa453531872f /gdbus/object.c
parent6321f8627ccbb74eb7c4d0a45f56a4b5a2ac77fc (diff)
downloadconnman-704a4ef5a925a78d34be5b554de748fc4012c303.tar.gz
connman-704a4ef5a925a78d34be5b554de748fc4012c303.tar.bz2
connman-704a4ef5a925a78d34be5b554de748fc4012c303.zip
gdbus: Add g_dbus_get_properties function
This function can be used to construct custom D-Bus messages containing the properties for a specific interface on a given path.
Diffstat (limited to 'gdbus/object.c')
-rw-r--r--gdbus/object.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdbus/object.c b/gdbus/object.c
index 7acb5635..aa38c07c 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -1615,3 +1615,22 @@ void g_dbus_emit_property_changed(DBusConnection *connection,
return;
}
}
+
+gboolean g_dbus_get_properties(DBusConnection *connection, const char *path,
+ const char *interface, DBusMessageIter *iter)
+{
+ struct generic_data *data;
+ struct interface_data *iface;
+
+ if (!dbus_connection_get_object_path_data(connection, path,
+ (void **) &data) || data == NULL)
+ return FALSE;
+
+ iface = find_interface(data->interfaces, interface);
+ if (iface == NULL)
+ return FALSE;
+
+ append_properties(iface, iter);
+
+ return TRUE;
+}