code source dbus & excuses

"Charles Hervé Tchoutat Tchabo" t_charles at gmx.de
Fri Oct 12 07:59:11 PDT 2007


Hi,
I would say first of all that I learned much from your suggestions, and I hope I am in the good way now.
I will try to explain the problem I have now with array of struct and Dbus, I hope anyone can understand what I mean and answer me if possible.
I already get it to send and receive struct like "(dduu)" and "a(ssddi)" for example, but I now get problem with struct like "a(dds(bbds)(ssui))". 
in my code I proceeded as follows:
I create a GValueArray container for each intern struct (bbds) and (ssui), then a create a GvalueArray* container for "(dds(bbds)(ssui))" where I recorded dds and each interne struct as pointer with code like 
  GValue val ={0};
  g_value_init(&val, G_TYPE_POINTER);
  g_value_set_pointer(&val, v_pointer);
  g_value_array_append(g_val_array, &val);
  g_value_unset(&val);

then I recorded each occurences of the complet struct "(dds(bbds)(ssui))" in a GPtrArray* 

I receive "dds" very well, the problem appears at the server side as I try to receive the sent pointers: "(bbds)" and "(ssui)".
The code I use to receive the pointer look as follows:
if (!G_IS_VALUE(val)) 
	g_print ("dont have a value \n"); 
else{ g_print ("have value \n");
	if (g_value_type_compatible (G_VALUE_TYPE (val), G_TYPE_POINTER))
		if (G_VALUE_HOLDS_POINTER(val)){
		     _print_vector(g_value_get_pointer(val));
		}else g_print ("error G_VALUE_HOLDS_POINTER \n");		
	else g_print("error with g_value_type_compatible G_TYPE_POINTER \n");
I get the value and the programm breaks by "g_value_type_compatible" and I get faults like:
(process:7330): GLib-GObject-CRITICAL **: g_value_copy: assertion `g_value_type_compatible (G_VALUE_TYPE (src_value), G_VALUE_TYPE (dest_value))' failed

(process:7330): GLib-GObject-CRITICAL **: g_value_array_get_nth: assertion `value_array != NULL' failed

(process:7330): GLib-GObject-CRITICAL **: g_value_copy: assertion `G_IS_VALUE (src_value)' failed

(process:7330): GLib-GObject-CRITICAL **: g_value_array_get_nth: assertion `value_array != NULL' failed

(process:7330): GLib-GObject-CRITICAL **: g_value_copy: assertion `G_IS_VALUE (src_value)' failed

(process:7330): GLib-GObject-CRITICAL **: g_value_array_get_nth: assertion `value_array != NULL' failed
can anyone tell me what's wrong.
Thank to answer me.
Regards.
Charles


-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger


More information about the dbus mailing list