how can I receive an ARRAY via dbus_message_get_args interface?

Wang, Songyue songyue.wang at intel.com
Wed May 25 19:01:38 PDT 2011


Hi:
I want to make a dbus_send and dbus_get test.
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);

I can compile, but when run dbus_get in one terminal, and run dbus_send in another terminal, there will be “Segmentation fault
” in dbus_get.
So my question is: how can I receive an ARRAY via dbus_message_get_args interface?

BRs,
Songyue Wang 王松月
Tel: 86-10-5751-1739
iNet: 8751-1739
Mobile: 15710026726
mailto:songyue.wang at intel.com
DRD Atom/Meego Platform Enabling Team




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20110526/d0b13dde/attachment.html>


More information about the dbus mailing list