D-Bus low-lewel API - sending an array of structures

Bogdan Lotko boguslaw.lotko at chello.at
Sun May 8 03:12:34 PDT 2011


Many thanks for your help. Everything works perfect now.
I was confused reading the Low-level API it was not obvious that the 
exact type signature shall be given.
What for is the "r" code then, and when is it used?

To your question: Actually the whole module is written using  dbus-glib 
binding. There are only some methods written using low-level API.
They give me more flexibility in addressing of different interfaces and 
objects in the receiver process.
The whole sender process is a legacy software running on older LINUX 
versions (SuSE 8.2 and SLES 10), so I am not sure if the gdbus would be 
the right solution.

Once more thank you  for your help,

with best regards,


On 5/7/2011 13:33, Thiago Macieira wrote:
> On Saturday, 7 de May de 2011 11:13:41 Bogdan Lotko wrote:
>>       // Open the a structure within an array
>>       // Here run-time error  !!!!!!!!!!!!!!!!!!!
>>       dbus_message_iter_open_container(&arr,
>>                                         DBUS_TYPE_STRUCT,
>>                                         NULL,
>> &strct );
> No, it's not.
> The error is actually here:
>>     dbus_message_iter_open_container(&iter,
>>                                       DBUS_TYPE_ARRAY,
>>                                       "r",
>> &arr );
> It told you:
> "process 6585: Array or variant type requires that type struct be
> written, but begin_struct was written"
> As you can see, you sent "r". You should pass the actual type of
> the structure you're trying to send. In this case, "(ss)".
> By the way, you're using the D-Bus low-level API, but you have glib constructs
> in your code. Why aren't you using dbus-glib or, even better, gdbus?
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus

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

More information about the dbus mailing list