how can I receive an ARRAY via dbus_message_get_args interface?

Mike Gorse mgorse at novell.com
Thu May 26 06:49:23 PDT 2011


Hi Songyue,

On Thu, 26 May 2011, Wang, Songyue wrote:

> Mike:
> Sincerely thanks very much!
> But I am still puzzled.
> when I changed to
> dbus_message_get_args (message, &dberr,DBUS_TYPE_ARRAY,3,&v_ARRAY, DBUS_TYPE_INVALID);
> still not ok!

You need to do something like:

dbus_int32_t *v_array;
dbus_int32_t count;

dbus_message_get_args (message, &dberr, DBUS_TYPE_ARRAY, DBUS_TYPE_INT32, 
&v_array, &count, DBUS_TYPE_INVALID);

I think this should work, although I haven't tested.  v_array now points 
into the message, and the value of count should be set to 3.

-Mike


More information about the dbus mailing list