---
Makefile.am | 3 ++-
test/change-pin | 29 +++++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 1 deletions(-)
create mode 100755 test/change-pin
diff --git a/Makefile.am b/Makefile.am
index cc30624..4c9add4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -446,7 +446,8 @@ test_scripts = test/backtrace \
test/set-tty \
test/set-gsm-band \
test/set-umts-band \
- test/lockdown-modem
+ test/lockdown-modem \
+ test/change-pin
if TEST
testdir = $(pkglibdir)/test
diff --git a/test/change-pin b/test/change-pin new file mode 100755 index
0000000..a2444d6
--- /dev/null
+++ b/test/change-pin
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+
+import dbus
+import sys
+
+bus = dbus.SystemBus()
+
+if len(sys.argv) == 5:
+ path = sys.argv[1]
+ pin_type = sys.argv[2]
+ orig_pin = sys.argv[3]
+ new_pin = sys.argv[4]
+elif len(sys.argv) == 4:
+ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+ modems = manager.GetModems()
+ path = modems[0][0]
+ pin_type = sys.argv[1]
+ orig_pin = sys.argv[2]
+ new_pin = sys.argv[3]
+else:
+ print "%s [PATH] pin_type pin" % (sys.argv[0])
+ sys.exit(0)
+
+print "Change Pin for modem %s..." % path simmanager =
+dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.SimManager')
+
+simmanager.ChangePin(pin_type, orig_pin, new_pin)
--
1.7.1
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono