From f3f3dabfac5c2f73114ac0c52dd76a18674e10bc Mon Sep 17 00:00:00 2001 From: Alfonso Sanchez-Beato Date: Mon, 18 May 2015 08:47:08 +0200 Subject: [PATCH] test: Add script for resetting contexts --- test/reset-contexts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/reset-contexts diff --git a/test/reset-contexts b/test/reset-contexts new file mode 100644 index 00000000..16766362 --- /dev/null +++ b/test/reset-contexts @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +import dbus +import sys + +bus = dbus.SystemBus() + +if len(sys.argv) == 2: + path = sys.argv[1] +else: + manager = dbus.Interface(bus.get_object('org.ofono', '/'), + 'org.ofono.Manager') + modems = manager.GetModems() + path = modems[0][0] + +print("Resetting contexts for SIM on modem %s..." % path) +cm = dbus.Interface(bus.get_object('org.ofono', path), + 'org.ofono.ConnectionManager') + +cm.ResetContexts()