dbus-glib - passing structs as arguments
s.popov at rsc.bg
Fri Apr 17 06:57:25 PDT 2009
I read D-Bus Tutorial and many other documents!
I have only one problem.
I am using dbus-glib and I am trying to invoke a method with parameters.
I would like to pass structures to dbus_g_proxy_call() function.
For example I have (ss) type.
I tried |DBUS_TYPE_STRUCT which is mentioned in |D-Bus Tutorial| but it
seems it is not working with GLIB.
(process:835): GLib-GObject-WARNING **: gtype.c:3312: type id
`115' is invalid
(process:835): GLib-GObject-WARNING **: can't peek value table for
type `<unknown>' which is not currently referenced
So I did the following:
#define G_STRUCT_STR_STR (dbus_g_type_get_struct("GValueArray",
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID))
value = g_new0 (GValue, 1);
g_value_init (value, G_STRUCT_STR_STR);
g_value_take_boxed (value, dbus_g_type_specialized_construct
dbus_g_type_struct_set (value, 0, "192.168.0.1", 1, "1234", G_MAXUINT);
dbus_g_proxy_call (proxy, "SetInfo", &error, G_STRUCT_STR_STR, value,
but I got Segmentation Fault on dbus_g_proxy_call().
Where am I wrong?
Can you help me, please?
Thanks in advance,
More information about the dbus