summaryrefslogtreecommitdiffstats
path: root/test/set-gsm-band
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 /test/set-gsm-band
parentbb9e26f2a52d6b24e905f19ff777276b3b473c0c (diff)
downloadofono-90cc80e62e33c548770a467b4f8ead088ffb49a7.tar.bz2
test: add scripts for setting frequency band
Diffstat (limited to 'test/set-gsm-band')
-rwxr-xr-xtest/set-gsm-band25
1 files changed, 25 insertions, 0 deletions
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);