summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2010-12-09 14:43:35 -0200
committerDenis Kenzior <denkenz@gmail.com>2010-12-21 16:02:49 -0600
commit90cc80e62e33c548770a467b4f8ead088ffb49a7 (patch)
tree36118837830ed75405288f6f6786409df163c1cb
parentbb9e26f2a52d6b24e905f19ff777276b3b473c0c (diff)
downloadofono-90cc80e62e33c548770a467b4f8ead088ffb49a7.tar.bz2
test: add scripts for setting frequency band
-rw-r--r--Makefile.am4
-rwxr-xr-xtest/set-gsm-band25
-rwxr-xr-xtest/set-umts-band25
3 files changed, 53 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 12b3c33d..14efe3c0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -423,7 +423,9 @@ test_scripts = test/backtrace \
test/test-push-notification \
test/test-smart-messaging \
test/send-vcard \
- test/set-tty
+ test/set-tty \
+ test/set-gsm-band \
+ test/set-umts-band
if TEST
testdir = $(pkglibdir)/test
diff --git a/test/set-gsm-band b/test/set-gsm-band
new file mode 100755
index 00000000..9586d811
--- /dev/null
+++ b/test/set-gsm-band
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+
+import dbus
+import sys
+
+bus = dbus.SystemBus()
+
+if len(sys.argv) == 3:
+ path = sys.argv[1]
+ band = sys.argv[2]
+elif len(sys.argv) == 2:
+ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+ modems = manager.GetModems()
+ path = modems[0][0]
+ band = sys.argv[1]
+else:
+ print "%s [PATH] band" % (sys.argv[0])
+ exit(1)
+
+print "Setting gsm band for modem %s..." % path
+radiosettings = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.RadioSettings')
+
+radiosettings.SetProperty("GsmBand", band);
diff --git a/test/set-umts-band b/test/set-umts-band
new file mode 100755
index 00000000..510a40be
--- /dev/null
+++ b/test/set-umts-band
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+
+import dbus
+import sys
+
+bus = dbus.SystemBus()
+
+if len(sys.argv) == 3:
+ path = sys.argv[1]
+ band = sys.argv[2]
+elif len(sys.argv) == 2:
+ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+ modems = manager.GetModems()
+ path = modems[0][0]
+ band = sys.argv[1]
+else:
+ print "%s [PATH] band" % (sys.argv[0])
+ exit(1)
+
+print "Setting umts band for modem %s..." % path
+radiosettings = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.RadioSettings')
+
+radiosettings.SetProperty("UmtsBand", band);