summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-09-17 18:16:29 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-09-17 18:16:29 -0700
commit9ca3b7008ef544fed7a0c6df6c0fb78415ed77e4 (patch)
treeb7eedbc72e702dbf1d006d9acb31490b647e7a83 /test
parentc667cb5b0b4da182515b83fffda62b5106f46b11 (diff)
downloadconnman-9ca3b7008ef544fed7a0c6df6c0fb78415ed77e4.tar.gz
connman-9ca3b7008ef544fed7a0c6df6c0fb78415ed77e4.tar.bz2
connman-9ca3b7008ef544fed7a0c6df6c0fb78415ed77e4.zip
Add support for setting cellular APN details
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-connman32
1 files changed, 32 insertions, 0 deletions
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 <service> [apn]"
print " passphrase <service> [passphrase]"
print " autoconnect <service> [autoconnect]"
print " connect <service>"
@@ -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"