diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-08-19 13:24:09 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-08-19 14:20:06 -0500 |
commit | b775c434d9e4f2ab6e8b4005343dfc9076b8ea37 (patch) | |
tree | 8a86c21fbfcfc33ebdb63582af444fc65d07a9ab | |
parent | b4c1938d8a0788c64b923aa0bc112b63cf15e6df (diff) | |
download | ofono-b775c434d9e4f2ab6e8b4005343dfc9076b8ea37.tar.bz2 |
test: update create-context to the new API
-rwxr-xr-x | test/create-context | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/create-context b/test/create-context index 4523c3ac..20f2be59 100755 --- a/test/create-context +++ b/test/create-context @@ -16,21 +16,21 @@ for path in properties["Modems"]: properties = modem.GetProperties() - if "org.ofono.DataConnectionManager" not in properties["Interfaces"]: + if "org.ofono.ConnectionManager" not in properties["Interfaces"]: continue - connmgr = dbus.Interface(bus.get_object('org.ofono', path), - 'org.ofono.DataConnectionManager') + connman = dbus.Interface(bus.get_object('org.ofono', path), + 'org.ofono.ConnectionManager') - properties = connmgr.GetProperties() + contexts = connman.GetContexts() - if (properties["PrimaryContexts"] == []): - path = connmgr.CreateContext("Internet access", "internet") + if (len(contexts) == 0): + path = connman.AddContext("internet") else: - path = properties["PrimaryContexts"][0] + path = contexts[0][0] context = dbus.Interface(bus.get_object('org.ofono', path), - 'org.ofono.PrimaryDataContext') + 'org.ofono.ConnectionContext') try: context.SetProperty("AccessPointName", sys.argv[1]) |