summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rwxr-xr-xtest/set-fast-dormancy25
2 files changed, 27 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index fc6fdce4..25621608 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -411,7 +411,8 @@ test_scripts = test/backtrace \
test/unlock-pin \
test/enable-gprs \
test/disable-gprs \
- test/get-icon
+ test/get-icon \
+ test/set-fast-dormancy
if TEST
testdir = $(pkglibdir)/test
diff --git a/test/set-fast-dormancy b/test/set-fast-dormancy
new file mode 100755
index 00000000..69518130
--- /dev/null
+++ b/test/set-fast-dormancy
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+
+import dbus
+import sys
+
+bus = dbus.SystemBus()
+
+if len(sys.argv) == 3:
+ path = sys.argv[1]
+ enable = int(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]
+ enable = int(sys.argv[1])
+else:
+ print "%s [PATH] {0|1}" % (sys.argv[0])
+ exit(1)
+
+print "Setting fast dormancy for modem %s..." % path
+radiosettings = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.RadioSettings')
+
+radiosettings.SetProperty("FastDormancy", dbus.Boolean(enable));