<div dir="ltr"><div><div><div><div>Hello,<br><br><br></div>It looks like I figured out my problem, I have to use:<br><br>result = sd_bus_message_enter_container(msgCall, 'a', "o");<br><br></div>before I try reading the array with :<br><br>result = sd_bus_message_read(msgCall, "o", &ptr);<br><br></div>Thanks,<br></div>Jimmy<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 17, 2017 at 1:43 PM, James Johnson <span dir="ltr"><<a href="mailto:jjjwallyhome@gmail.com" target="_blank">jjjwallyhome@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hello,<br><br></div>Can someone please point me to the correct method for reading an "ao" signature dbus message using the sd_bus C api?<br><br></div>I am trying to read all the network devices with the following call:<br><br> result = sd_bus_get_property(m_bus, "org.freedesktop.<wbr>NetworkManager",<br> <wbr> "/org/freedesktop/<wbr>NetworkManager",<br> <wbr> "org.freedesktop.<wbr>NetworkManager",<br> <wbr> "AllDevices", &error,<br> <wbr> &msgCall, "ao");<br>I have tried:<br><br>char * ptr;<br>size_t size;<br><br>result = sd_bus_message_read_array(<wbr>msgCall, 'o', &ptr, &size);<br><br></div><div>as well as:<br><br>result = sd_bus_message_read(msgCall, "ao", ptr);<br></div><div><br></div><div>but these both return an error. I am not sure what method to use to parse the returned message when it is an array of path objects.<br></div><br></div>Please note this interface gives me the following when executed via the busctl command:<br><br>[jjohnson@macbookpro]$ busctl --verbose get-property org.freedesktop.NetworkManager /org/freedesktop/<wbr>NetworkManager org.freedesktop.NetworkManager AllDevices<br>ARRAY "o" {<br> OBJECT_PATH "/org/freedesktop/<wbr>NetworkManager/Devices/1";<br> OBJECT_PATH "/org/freedesktop/<wbr>NetworkManager/Devices/3";<br> OBJECT_PATH "/org/freedesktop/<wbr>NetworkManager/Devices/11";<br> OBJECT_PATH "/org/freedesktop/<wbr>NetworkManager/Devices/12";<br>};<br><br><br></div>Thanks!<br></div>Jimmy<br><br></div>
</blockquote></div><br></div>