mirror of git://git.sysmocom.de/ofono
test: add script to control fast dormancy
This commit is contained in:
parent
bef003059e
commit
cad4d1ce97
|
@ -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
|
||||
|
|
|
@ -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));
|
Loading…
Reference in New Issue