From 9ca3b7008ef544fed7a0c6df6c0fb78415ed77e4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 17 Sep 2009 18:16:29 -0700 Subject: Add support for setting cellular APN details --- test/test-connman | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'test') diff --git a/test/test-connman b/test/test-connman index f82150f0..f9ab2017 100755 --- a/test/test-connman +++ b/test/test-connman @@ -13,6 +13,7 @@ if len(sys.argv) < 2: print "" print " state" print " services" + print " apn [apn]" print " passphrase [passphrase]" print " autoconnect [autoconnect]" print " connect " @@ -157,6 +158,37 @@ elif sys.argv[1] in ["services", "list", "show"]: print_services(properties["Services"]) +elif sys.argv[1] in ["apn"]: + if (len(sys.argv) < 3): + print "Need at least service parameter" + sys.exit(1) + + path = "/profile/default/" + sys.argv[2] + + service = dbus.Interface(bus.get_object("org.moblin.connman", path), + "org.moblin.connman.Service") + + if (len(sys.argv) > 3): + apn = sys.argv[3] + + service.SetProperty("APN", apn); + + print "APN %s set for %s" % (apn, sys.argv[2]) + else: + properties = service.GetProperties() + + if "Name" in properties.keys(): + name = properties["Name"] + else: + name = "{" + properties["Type"] + "}" + + if "APN" in properties.keys(): + apn = properties["APN"] + else: + apn = "not set" + + print "APN for %s is %s" % (name, apn) + elif sys.argv[1] in ["passphrase", "pass"]: if (len(sys.argv) < 3): print "Need at least service parameter" -- cgit v1.2.3