Passing structure from Server to Client on DBus

Rakesh rkumar at celestialsys.com
Wed Mar 31 02:49:24 PDT 2010


Thank you very much Colin for your great help.

Thanks
Rakesh

On Tue, 2010-03-30 at 17:28 -0400, Colin Walters wrote:
> Hi,
> 
> On Tue, Mar 30, 2010 at 2:50 AM, Rakesh <rkumar at celestialsys.com> wrote:
> > I am using Glib binding. Please give me some code which explain the
> > procedure.
> 
> DBus structures are represented in the dbus-glib binding as a
> GValueArray.  You need to call
> dbus_g_type_get_struct:
> http://dbus.freedesktop.org/doc/dbus-glib/dbus-glib-Specializable-GType-System.html#dbus-g-type-get-struct
> 
> Then you can pass that to a dbus_g_proxy_call like:
> GValueArray *vals = g_value_array_new (3);
> 
> // Set vals, see the docs for GValueArray
> 
> dbus_g_proxy_call (proxy, "Foo", &error, dbus_g_type_get_struct
> (G_TYPE_INT, G_TYPE_INT, G_TYPE_INVALID), vals, G_TYPE_INVALID,
> G_TYPE_INVALID)
> 
> There's a full code example in the test suite:
> 
> http://cgit.freedesktop.org/dbus/dbus-glib/tree/test/core/test-dbus-glib.c#n1145




More information about the dbus mailing list