mirror of git://git.sysmocom.de/ofono
Add test script for setting CBS topics
This commit is contained in:
parent
118759d5ba
commit
86caf654de
|
@ -337,6 +337,7 @@ test_scripts = test/activate-context \
|
||||||
test/online-modem \
|
test/online-modem \
|
||||||
test/get-tech-preference \
|
test/get-tech-preference \
|
||||||
test/set-tech-preference \
|
test/set-tech-preference \
|
||||||
|
test/set-cbs-topics \
|
||||||
test/enable-cbs
|
test/enable-cbs
|
||||||
|
|
||||||
if TEST
|
if TEST
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import dbus
|
||||||
|
import sys
|
||||||
|
|
||||||
|
bus = dbus.SystemBus()
|
||||||
|
|
||||||
|
if len(sys.argv) == 3:
|
||||||
|
path = sys.argv[1]
|
||||||
|
topics = 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]
|
||||||
|
topics = sys.argv[1]
|
||||||
|
else:
|
||||||
|
print "%s [PATH] topics" % (sys.argv[0])
|
||||||
|
|
||||||
|
print "Setting cell broadcast topics for modem %s..." % path
|
||||||
|
cbs = dbus.Interface(bus.get_object('org.ofono', path),
|
||||||
|
'org.ofono.CbsManager')
|
||||||
|
|
||||||
|
cbs.SetProperty("Topics", topics);
|
Loading…
Reference in New Issue