From cad4d1ce976733eb942d25e9527d136f69e11fa0 Mon Sep 17 00:00:00 2001 From: Mika Liljeberg Date: Tue, 26 Oct 2010 18:31:51 +0300 Subject: [PATCH] test: add script to control fast dormancy --- Makefile.am | 3 ++- test/set-fast-dormancy | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 test/set-fast-dormancy 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));