test: add script to control fast dormancy

This commit is contained in:
Mika Liljeberg 2010-10-26 18:31:51 +03:00 committed by Denis Kenzior
parent bef003059e
commit cad4d1ce97
2 changed files with 27 additions and 1 deletions

View File

@ -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

25
test/set-fast-dormancy Executable file
View File

@ -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));