mirror of git://git.sysmocom.de/ofono
Add test scripts for radio technology preference
This commit is contained in:
parent
63d1efdf7f
commit
71335f3d9c
|
@ -333,7 +333,9 @@ test_scripts = test/activate-context \
|
|||
test/test-ussd \
|
||||
test/test-voicecall \
|
||||
test/offline-modem \
|
||||
test/online-modem
|
||||
test/online-modem \
|
||||
test/get-tech-preference \
|
||||
test/set-tech-preference
|
||||
|
||||
if TEST
|
||||
testdir = $(pkglibdir)/test
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import dbus, sys
|
||||
|
||||
bus = dbus.SystemBus()
|
||||
|
||||
if len(sys.argv) == 2:
|
||||
path = sys.argv[1]
|
||||
else:
|
||||
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
||||
'org.ofono.Manager')
|
||||
properties = manager.GetProperties()
|
||||
path = properties["Modems"][0]
|
||||
|
||||
radiosettings = dbus.Interface(bus.get_object('org.ofono', path),
|
||||
'org.ofono.RadioSettings')
|
||||
|
||||
properties = radiosettings.GetProperties()
|
||||
|
||||
print "Technology preference: %s" % (properties["TechnologyPreference"])
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import dbus
|
||||
import sys
|
||||
|
||||
bus = dbus.SystemBus()
|
||||
|
||||
if len(sys.argv) == 3:
|
||||
path = sys.argv[1]
|
||||
tech = sys.argv[2]
|
||||
elif len(sys.argv) == 2:
|
||||
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
||||
'org.ofono.Manager')
|
||||
properties = manager.GetProperties()
|
||||
path = properties["Modems"][0]
|
||||
tech = sys.argv[1]
|
||||
else:
|
||||
print "%s [PATH] technology" % (sys.argv[0])
|
||||
|
||||
print "Setting technology preference for modem %s..." % path
|
||||
radiosettings = dbus.Interface(bus.get_object('org.ofono', path),
|
||||
'org.ofono.RadioSettings')
|
||||
|
||||
radiosettings.SetProperty("TechnologyPreference", tech);
|
Loading…
Reference in New Issue