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 unlock sim card (revised).
Date: Tue, 24 Nov 2009 13:35:42 +0100	[thread overview]
Message-ID: <1259066142-4601-1-git-send-email-ryan.raasch@gmail.com> (raw)
In-Reply-To: <1259059544.2967.33.camel@violet>

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

---
 Makefile.am     |    3 ++-
 test/unlock-sim |   25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletions(-)
 create mode 100755 test/unlock-sim

diff --git a/Makefile.am b/Makefile.am
index 4b0d7e8..2420c2c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -242,7 +242,8 @@ test_files = test/test-manager test/test-modem test/test-voicecall \
 		test/receive-sms test/send-sms \
 		test/list-contexts test/create-context \
 		test/activate-context test/deactivate-context \
-		test/process-context-settings
+		test/process-context-settings \
+		test/unlock-sim
 
 conf_files = src/ofono.conf plugins/modem.conf
 
diff --git a/test/unlock-sim b/test/unlock-sim
new file mode 100755
index 0000000..38ae38d
--- /dev/null
+++ b/test/unlock-sim
@@ -0,0 +1,25 @@
+#!/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()
+
+try:
+    path = properties["Modems"][0]
+except:
+    print "No modems found "
+    sys.exit(2)
+
+modem = dbus.Interface(bus.get_object('org.ofono', path),
+                    'org.ofono.SimManager')
+properties = modem.GetProperties()
+
+try:
+    modem.EnterPin(properties['PinRequired'], sys.argv[1])
+except:
+    print "PinRequried = %s " % properties['PinRequired']
-- 
1.6.4.GIT


      reply	other threads:[~2009-11-24 12:35 UTC|newest]

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

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=1259066142-4601-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