how to pass a{sv} arguments to gdbus?

Solution 1:

a{sv} should be represented like:

"{'String': <'variant_value'>, 'String2': <'variant_value'>}"

To figure this out I called org.freedesktop.DBus.Properties.GetAll on some object interface because that returns a{sv}.

For example, the CreateInterface method in wpa_supplicant takes a{sv}:

gdbus call -y -d fi.w1.wpa_supplicant1 -o /fi/w1/wpa_supplicant1 -m fi.w1.wpa_supplicant1.CreateInterface "{'Ifname': <'wlan0'>}"

or to add multiple interfaces (a true array of string:variant):

"{'Ifname': <'wlan0'>, 'Ifname': <'wlan1'>}"