Some issue with formatting.I copy message again here
Hello,
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"
I do
dbus-send
--system --dest=net.connman.vpn --type=method_call
--print-reply /
net.connman.vpn.Manager.GetConnections
and I get
array [
struct {
==> object path "/net/connman/vpn/connection /uk_london_privateinternetaccess_com_privateinternetaccess_com"
array [
dict entry(
string "State"
variant string "idle"
)
dict entry(
string "Type"
variant string "openvpn"
)
dict entry(
string "Name"
variant string "PIA VPN"
)
dict entry(
string "Host"
-==> variant string "uk-london.privateinternetaccess.com"
)
dict entry(
string "Index"
variant int32 0
)
dict entry(
string "Domain"
variant string "privateinternetaccess.com"
)
dict entry(
string "Immutable"
variant boolean true
)
dict entry(
string "Nameservers"
variant array [
]
)
dict entry(
string "UserRoutes"
variant array [
]
)
dict entry(
string "ServerRoutes"
variant array [
]
)
]
}
]
struct {
==> object path "/net/connman/vpn/connection /uk_london_privateinternetaccess_com_privateinternetaccess_com"
array [
dict entry(
string "State"
variant string "idle"
)
dict entry(
string "Type"
variant string "openvpn"
)
dict entry(
string "Name"
variant string "PIA VPN"
)
dict entry(
string "Host"
-==> variant string "uk-london.privateinternetaccess.com"
)
dict entry(
string "Index"
variant int32 0
)
dict entry(
string "Domain"
variant string "privateinternetaccess.com"
)
dict entry(
string "Immutable"
variant boolean true
)
dict entry(
string "Nameservers"
variant array [
]
)
dict entry(
string "UserRoutes"
variant array [
]
)
dict entry(
string "ServerRoutes"
variant array [
]
)
]
}
]
In my application I am doing
r = sd_bus_call_method( bus,
"net.connman.vpn",
"/",
"net.connman.vpn.Manager",
"GetConnections",
&error,
&m, NULL, NULL);
"net.connman.vpn",
"/",
"net.connman.vpn.Manager",
"GetConnections",
&error,
&m, NULL, NULL);
Which succeeds.
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?
Any help would be much appreciated
Salman
On Fri, Jun 7, 2019 at 8:07 PM Salman Ahmed <salman.isd@xxxxxxxxx> wrote:
Hello,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)I dodbus-send --system --dest=net.connman.vpn --type=method_call --print-reply / net.connman.vpn.Manager.GetConnectionsand I getarray [
struct {
object path "/net/connman/vpn/connection/uk_london_privateinternetaccess_com_privateinternetaccess_com"
array [
dict entry(
string "State"
variant string "idle"
)
dict entry(
string "Type"
variant string "openvpn"
)
dict entry(
string "Name"
variant string "PIA VPN"
)
dict entry(
string "Host"
variant string "uk-london.privateinternetaccess.com"
)
dict entry(
string "Index"
variant int32 0
)
dict entry(
string "Domain"
variant string "privateinternetaccess.com"
)
dict entry(
string "Immutable"
variant boolean true
)
dict entry(
string "Nameservers"
variant array [
]
)
dict entry(
string "UserRoutes"
variant array [
]
)
dict entry(
string "ServerRoutes"
variant array [
]
)
]
}
]In my application I am doingr = sd_bus_call_method( bus,
"net.connman.vpn",
"/",
"net.connman.vpn.Manager",
"GetConnections",
&error,
&m, NULL, NULL);Which succeeds.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?Any help would be much appreciatedSalman
_______________________________________________ systemd-devel mailing list systemd-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/systemd-devel