mirror of git://git.sysmocom.de/ofono
test: Update activate-context to the new API
This commit is contained in:
parent
256e01c8c4
commit
b4c1938d8a
|
@ -16,24 +16,24 @@ 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):
|
||||||
print "No context available"
|
print "No context available"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
connmgr.SetProperty("Powered", dbus.Boolean(1))
|
connman.SetProperty("Powered", dbus.Boolean(1))
|
||||||
|
|
||||||
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("Active", dbus.Boolean(1))
|
context.SetProperty("Active", dbus.Boolean(1))
|
||||||
|
|
Loading…
Reference in New Issue