[PATCH] Added test script to enter pin to sim card.

Ryan M. Raasch ryan.raasch at gmail.com
Tue Nov 24 01:46:24 PST 2009


---
 test/enter-pin.py |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
 create mode 100755 test/enter-pin.py

diff --git a/test/enter-pin.py b/test/enter-pin.py
new file mode 100755
index 0000000..77de93a
--- /dev/null
+++ b/test/enter-pin.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+import dbus
+import sys
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+                         'org.ofono.Manager')
+
+properties = manager.GetProperties()
+
+path = properties["Modems"][0]
+
+if len(path)==0:
+    print "No modems found"
+    exit
+
+modem = dbus.Interface(bus.get_object('org.ofono', path),
+                       'org.ofono.SimManager')
+properties = modem.GetProperties()
+if properties.has_key('PinRequired') and properties['PinRequired'] == sys.argv[1] :
+    modem.EnterPin(sys.argv[1], sys.argv[2])
+elif properties.has_key('PinRequired') and properties['PinRequired'] == 'none' :
+    print "Pin not needed"
+elif properties.has_key('PinRequired'):
+    print "Error: Pin type not supported (%s != %s)" % (sys.argv[1],properties['PinRequired'])
+
+
-- 
1.6.4.GIT



More information about the ofono mailing list