how can I receive an ARRAY via dbus_message_get_args interface?

Wang, Songyue songyue.wang at intel.com
Thu May 26 02:08:23 PDT 2011


I want to get the data.
How can I write the code to get the data?

In dbus_send.c:
 dbus_int32_t array[] = { 1, 2, 3 };
 dbus_int32_t *v_ARRAY = array;
dbus_message_append_args (dbmsg, DBUS_TYPE_ARRAY, DBUS_TYPE_INT32, &v_ARRAY, 3, DBUS_TYPE_INVALID);   

In dbus_get.c:
dbus_int32_t array[] = {0,0,0};
dbus_int32_t *v_ARRAY = array;
dbus_message_get_args (message, &dberr,DBUS_TYPE_ARRAY,DBUS_TYPE_INT32,&v_ARRAY,3, DBUS_TYPE_INVALID); printf ("wsy Received TestSignal with value of: 'x=%d,y=%d,z=%d'\r\n", array[0],array[1],array[2]);

when run dbus_get 
there is" Segmentation fault"
what is the right method to use dbus_message_get_args?


More information about the dbus mailing list