Open Source Telephony
 help / color / mirror / Atom feed
From: Gustavo F. Padovan <padovan@profusion.mobi>
To: ofono@ofono.org
Subject: [PATCH 3/3] modem: Add test script for the Lockdown property
Date: Wed, 22 Dec 2010 16:51:05 -0200	[thread overview]
Message-ID: <1293043865-24968-3-git-send-email-padovan@profusion.mobi> (raw)
In-Reply-To: <1293043865-24968-2-git-send-email-padovan@profusion.mobi>

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

---
 Makefile.am         |    1 +
 test/lockdown-modem |   25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)
 create mode 100755 test/lockdown-modem

diff --git a/Makefile.am b/Makefile.am
index 252b5da..94d5c09 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -428,6 +428,7 @@ test_scripts = test/backtrace \
 		test/set-tty \
 		test/set-gsm-band \
 		test/set-umts-band
+		test/lockdown-modem
 
 if TEST
 testdir = $(pkglibdir)/test
diff --git a/test/lockdown-modem b/test/lockdown-modem
new file mode 100755
index 0000000..5d98154
--- /dev/null
+++ b/test/lockdown-modem
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+
+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 "Locking and disconnecting modem %s..." % path
+modem = dbus.Interface(bus.get_object('org.ofono', path),
+						'org.ofono.Modem')
+
+modem.SetProperty("Lockdown", dbus.Boolean(1))
+
+print "press ENTER to unlock the modem %s" % path
+sys.stdin.readline()
+
+modem.SetProperty("Lockdown", dbus.Boolean(0))
-- 
1.7.3.4


  reply	other threads:[~2010-12-22 18:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-22 18:51 [PATCH 1/3] modem: add Lockdown property to Modem interface Gustavo F. Padovan
2010-12-22 18:51 ` [PATCH 2/3] doc: add Lockdown property to Modem Gustavo F. Padovan
2010-12-22 18:51   ` Gustavo F. Padovan [this message]
2010-12-22 20:02 ` [PATCH 1/3] modem: add Lockdown property to Modem interface Denis Kenzior

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=1293043865-24968-3-git-send-email-padovan@profusion.mobi \
    --to=padovan@profusion.mobi \
    --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