From 86caf654de520830b819d6fcc99313cdde34ec3c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 9 Jun 2010 18:58:38 -0700 Subject: [PATCH] Add test script for setting CBS topics --- Makefile.am | 1 + test/set-cbs-topics | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100755 test/set-cbs-topics 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);