5

making this query:

dbus-send --system --print-reply --dest=org.ofono /he910_0 org.ofono.ConnectionManager.GetContexts

I get the following structure:

array [
  struct {
     object path "/he910_0/context1"
     array [
         dict entry(
           string "AccessPointName"
           variant                   string "mobile.vodafone.it"
        )
       ....
        dict entry(
           string "Settings"
           variant                   array [
              ]
        )
     ]
  }

I'd like to set "Settings" property with dbus-send messages. I tried with:

dbus-send --system --print-reply --dest=org.ofono /he910_0/context1 org.ofono.ConnectionContext.SetProperty string:"Settings" variant:array:string:"Interface=ppp0","Method=dhcp" 

But I receive:

dbus-send: Unknown type "array"

So, the final question is: how to set a variant array through dbus-send ?

aldo85ita
  • 496
  • 2
  • 8
  • 19

1 Answers1

5

You can't do this with dbus-send, but you might be able to do what you want with the quite similar tool gdbus. See how to use parameters signature as "a{sv}" in dbus-send

Community
  • 1
  • 1
JoGr
  • 1,457
  • 11
  • 22
  • 1
    Indeed. As per `man dbus-send`: “dbus-send does not permit … nested containers”; a variant containing an array is a nested container. – Philip Withnall Mar 03 '17 at 10:41