diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2012-10-12 10:55:37 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-10-12 18:03:09 +0300 |
commit | 1d862e73f4d008a6d5ba8c5444b55dea00485465 (patch) | |
tree | 8c36da7add8d79a65ab0a2d3dacf2e6bb745861a /gdbus/object.c | |
parent | 293bbb4a47950f9bf1ecacbbf3193047fc5e555a (diff) | |
download | bluez-1d862e73f4d008a6d5ba8c5444b55dea00485465.tar.gz |
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.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gdbus/object.c b/gdbus/object.c index 7acb56358..aa38c07cc 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; +} |