title: Golang and DBUS
body: <p>I would like to convert this <code>Python</code> code in <code>Go</code>:</p>
  
  <pre><code>#!/usr/bin/python3
  
  import sys
  import dbus
  
  if (len(sys.argv) &lt; 2):
      print("Usage: %s &lt;modem&gt; &lt;ussd-string&gt;" % (sys.argv[0]))
      sys.exit(1)
  
  bus = dbus.SystemBus()
  path = sys.argv[1]
  ussdstring = sys.argv[2]
  
  ussd = dbus.Interface(bus.get_object('org.ofono', path),
                        'org.ofono.SupplementaryServices')
  
  properties = ussd.GetProperties()
  state = properties["State"]
  
  if state == "idle":
      result = ussd.Initiate(ussdstring, timeout=100)[1]
  elif state == "user-response":
      result = ussd.Respond(ussdstring, timeout=100)
  else:
      sys.exit(1);
  
  properties = ussd.GetProperties()
  state = properties["State"]
  print('USSD RESPONSE:\n', result)
  print('USSD SESSION:\n', state)
  </code></pre>
  
  <p>I made a try with the <code>github.com/guelfey/go.dbus</code> library:</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "os"
  
      "github.com/guelfey/go.dbus"
  )
  
  func main() {
      fmt.Printf("DBUS Test.\n")
      conn, err := dbus.SessionBus()
      if err != nil {
          fmt.Fprintln(os.Stderr, "Failed to connect to session bus:", err)
          os.Exit(1)
      }
  
      busObject := conn.Object("org.ofono", "/ril_0")
      fmt.Println("busObject:", busObject)
      var list []string
      busObject.Call("org.ofono.SupplementaryServices.Initiate", 0, "#101#").Store(&amp;list)
      fmt.Println("list:", list)
      for _, v := range list {
          fmt.Println(v)
      }
  }
  </code></pre>
  
  <p>But I got the following response:</p>
  
  <pre><code>DBUS Test.
  Failed to connect to session bus: user: Current not implemented on linux/arm
  </code></pre>
  
  <p>Do you know how to use this DBUS library? Is this library the best one for <code>go</code> on ARM7?</p>
  
  <p>Thank you</p>