dbus help needed in sending an a{sv}

M_o_n_k_e_y cavaldan at tin.it
Tue Dec 15 10:02:49 CET 2009

It is possibile to use GLib for this?
Can I find the full code you used? I would save much time for my Freerunner
Have you resolved the problem? You can try to set "\0" value.
Thank you. 

c_c wrote:
> Hi,
>   I'm trying to write the c equivalent of the following python code
> (without the line break)
> 'mdbus -s org.freesmartphone.opimd /org/freesmartphone/PIM/Messages
> org.freesmartphone.PIM.Messages.Query {}'
>   essentially this means sending a array -> dict -> one string(key) -> one
> variant(value). In order to send a query with the key="Direction" and
> value="in" I use the following code
> 	key = "Direction";
> 	value = "in";
> 	dbus_message_iter_init_append(msg, &iter);
> 	dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "{sv}", &array);
> 	dbus_message_iter_open_container(&array, DBUS_TYPE_DICT_ENTRY, 0, &dict);
> 	dbus_message_iter_append_basic(&dict, DBUS_TYPE_STRING, &key);
> 	dbus_message_iter_open_container(&dict, DBUS_TYPE_VARIANT,
> 	dbus_message_iter_append_basic(&variant, DBUS_TYPE_STRING, &value);
> 	dbus_message_iter_close_container(&dict, &variant);
> 	dbus_message_iter_close_container(&array, &dict);
> 	dbus_message_iter_close_container(&iter, &array);
>   and it works fine.
>   But - how do I send a NULL key,value? I assume I'm sending a NULL - not
> sure if that's the way to go about it.
>   Using the code above with key and value = "" or " " causes segmentation
> fault. I'm definitely doing something wrong - but I don't know what.
>  Can anyone help?

View this message in context: http://n2.nabble.com/dbus-help-needed-in-sending-an-a-sv-tp3476909p4168921.html
Sent from the Openmoko Devel mailing list archive at Nabble.com.

More information about the devel mailing list