mirror of git://git.sysmocom.de/ofono
test: update create-context to the new API
This commit is contained in:
parent
b4c1938d8a
commit
b775c434d9
|
@ -16,21 +16,21 @@ for path in properties["Modems"]:
|
||||||
|
|
||||||
properties = modem.GetProperties()
|
properties = modem.GetProperties()
|
||||||
|
|
||||||
if "org.ofono.DataConnectionManager" not in properties["Interfaces"]:
|
if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
connmgr = dbus.Interface(bus.get_object('org.ofono', path),
|
connman = dbus.Interface(bus.get_object('org.ofono', path),
|
||||||
'org.ofono.DataConnectionManager')
|
'org.ofono.ConnectionManager')
|
||||||
|
|
||||||
properties = connmgr.GetProperties()
|
contexts = connman.GetContexts()
|
||||||
|
|
||||||
if (properties["PrimaryContexts"] == []):
|
if (len(contexts) == 0):
|
||||||
path = connmgr.CreateContext("Internet access", "internet")
|
path = connman.AddContext("internet")
|
||||||
else:
|
else:
|
||||||
path = properties["PrimaryContexts"][0]
|
path = contexts[0][0]
|
||||||
|
|
||||||
context = dbus.Interface(bus.get_object('org.ofono', path),
|
context = dbus.Interface(bus.get_object('org.ofono', path),
|
||||||
'org.ofono.PrimaryDataContext')
|
'org.ofono.ConnectionContext')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
context.SetProperty("AccessPointName", sys.argv[1])
|
context.SetProperty("AccessPointName", sys.argv[1])
|
||||||
|
|
Loading…
Reference in New Issue