<div dir="ltr"><div>Some issue with formatting.I copy message again here<br></div><div>Hello,</div><div><br></div><div>I am trying to communicate with
connman using sdbus from my application. Basically I want to replicate
the following cmd line procedure to get values for "object path" and
string "Host" <br></div><div>I do<br></div><div>dbus-send
--system --dest=net.connman.vpn --type=method_call
--print-reply /
net.connman.vpn.Manager.GetConnections</div><div><br></div><div>and I get</div><div> array [<br> struct {<br> ==> object path "/net/connman/vpn/connection /uk_london_privateinternetaccess_com_privateinternetaccess_com"<br> array [<br> dict entry(<br> string "State"<br> variant string "idle"<br> )<br> dict entry(<br> string "Type"<br> variant string "openvpn"<br> )<br> dict entry(<br> string "Name"<br> variant string "PIA VPN"<br> )<br> dict entry(<br> string "Host"<br> -==> variant string "<a href="http://uk-london.privateinternetaccess.com">uk-london.privateinternetaccess.com</a>"<br> )<br> dict entry(<br> string "Index"<br> variant int32 0<br> )<br> dict entry(<br> string "Domain"<br> variant string "<a href="http://privateinternetaccess.com">privateinternetaccess.com</a>"<br> )<br> dict entry(<br> string "Immutable"<br> variant boolean true<br> )<br> dict entry(<br> string "Nameservers"<br> variant array [<br> ]<br> )<br> dict entry(<br> string "UserRoutes"<br> variant array [<br> ]<br> )<br> dict entry(<br> string "ServerRoutes"<br> variant array [<br> ]<br> )<br> ]<br> }<br> ]</div><div><br></div><div><br></div><div>In my application I am doing</div><div> r = sd_bus_call_method( bus,<br> "net.connman.vpn",<br> "/",<br> "net.connman.vpn.Manager",<br> "GetConnections",<br> &error,<br> &m, NULL, NULL);<br></div><div><br></div><div>Which succeeds. <br></div><div>Afterwards
I want to do sd_bus_message_read(m, "a(oa{sv})") but I have no idea
what kind of arguments should I pass in what order to get object path
and host string. I think I got the a(oa{sv}) part right?<br></div><div><br></div><div>Any help would be much appreciated</div><div><br></div><div>Salman<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 7, 2019 at 8:07 PM Salman Ahmed <<a href="mailto:salman.isd@gmail.com">salman.isd@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div><br></div><div>I am trying to communicate with connman using sdbus from my application. Basically I want to replicate the following cmd line procedure to get values for "object path" and string "Host" (underlined below)<br></div><div>I do<br></div><div><i>dbus-send --system --dest=net.connman.vpn --type=method_call --print-reply / net.connman.vpn.Manager.GetConnections</i></div><div><br></div><div>and I get</div><div><i> array [<br> struct {<br> <u>object path "/net/connman/vpn/connection</u>/uk_london_privateinternetaccess_com_privateinternetaccess_com"<br> array [<br> dict entry(<br> string "State"<br> variant string "idle"<br> )<br> dict entry(<br> string "Type"<br> variant string "openvpn"<br> )<br> dict entry(<br> string "Name"<br> variant string "PIA VPN"<br> )<br> dict entry(<br> string "Host"<br> <u>variant string "<a href="http://uk-london.privateinternetaccess.com" target="_blank">uk-london.privateinternetaccess.com</a>"</u><br> )<br> dict entry(<br> string "Index"<br> variant int32 0<br> )<br> dict entry(<br> string "Domain"<br> variant string "<a href="http://privateinternetaccess.com" target="_blank">privateinternetaccess.com</a>"<br> )<br> dict entry(<br> string "Immutable"<br> variant boolean true<br> )<br> dict entry(<br> string "Nameservers"<br> variant array [<br> ]<br> )<br> dict entry(<br> string "UserRoutes"<br> variant array [<br> ]<br> )<br> dict entry(<br> string "ServerRoutes"<br> variant array [<br> ]<br> )<br> ]<br> }<br> ]</i></div><div><i><br></i></div><div><br></div><div>In my application I am doing</div><div> r = sd_bus_call_method( bus,<br> "net.connman.vpn",<br> "/",<br> "net.connman.vpn.Manager",<br> "GetConnections",<br> &error,<br> &m, NULL, NULL);<i><br></i></div><div><i><br></i></div><div>Which succeeds. <br></div><div>Afterwards I want to do sd_bus_message_read(m, "a(oa{sv})") but I have no idea what kind of arguments should I pass in what order to get object path and host string. I think I got the a(oa{sv}) part right?<br></div><div><br></div><div>Any help would be much appreciated</div><div><br></div><div>Salman<br></div></div>
</blockquote></div>