Open Source Telephony
 help / color / mirror / Atom feed
From: Ryan M. Raasch <ryan.raasch@gmail.com>
To: ofono@ofono.org
Subject: [PATCH] Added test script to enter pin to sim card.
Date: Tue, 24 Nov 2009 10:46:24 +0100	[thread overview]
Message-ID: <1259055984-30527-1-git-send-email-ryan.raasch@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]

---
 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


             reply	other threads:[~2009-11-24  9:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-24  9:46 Ryan M. Raasch [this message]
2009-11-24 10:45 ` [PATCH] Added test script to enter pin to sim card Marcel Holtmann
2009-11-24 12:35   ` [PATCH] Added test script to unlock sim card (revised) Ryan M. Raasch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1259055984-30527-1-git-send-email-ryan.raasch@gmail.com \
    --to=ryan.raasch@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox