ofono/test/remove-contexts

24 lines
519 B
Plaintext
Raw Normal View History

#!/usr/bin/python3
import dbus
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
2010-09-09 19:37:37 +00:00
modems = manager.GetModems()
2010-09-09 19:37:37 +00:00
for path, properties in modems:
if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
continue
connman = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.ConnectionManager')
contexts = connman.GetContexts()
for path, properties in contexts:
connman.RemoveContext(path)
print("Removed: [ %s ]" % (path))