diff --git a/Makefile.am b/Makefile.am index 2922be99..34a0a144 100644 --- a/Makefile.am +++ b/Makefile.am @@ -337,6 +337,7 @@ test_scripts = test/activate-context \ test/online-modem \ test/get-tech-preference \ test/set-tech-preference \ + test/set-cbs-topics \ test/enable-cbs if TEST diff --git a/test/set-cbs-topics b/test/set-cbs-topics new file mode 100755 index 00000000..7cb0f46e --- /dev/null +++ b/test/set-cbs-topics @@ -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);