--- Makefile.am | 4 +++- test/disable-gps | 20 ++++++++++++++++++++ test/enable-gps | 20 ++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletions(-) create mode 100755 test/disable-gps create mode 100755 test/enable-gps
diff --git a/Makefile.am b/Makefile.am index a41b629..3352f24 100644 --- a/Makefile.am +++ b/Makefile.am @@ -444,7 +444,9 @@ test_scripts = test/backtrace \ test/set-tty \ test/set-gsm-band \ test/set-umts-band \ - test/lockdown-modem + test/lockdown-modem \ + test/enable-gps \ + test/disable-gps if TEST testdir = $(pkglibdir)/test diff --git a/test/disable-gps b/test/disable-gps new file mode 100755 index 0000000..adb6ba5 --- /dev/null +++ b/test/disable-gps @@ -0,0 +1,20 @@ +#!/usr/bin/python + +import dbus +import 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') + modems = manager.GetModems() + path = modems[0][0] + +print "Powering OFF the GPS on modem %s..." % path +gps = dbus.Interface(bus.get_object('org.ofono', path), + 'org.ofono.LocationReporting') + +gps.SetProperty("Powered", dbus.Boolean(0)) diff --git a/test/enable-gps b/test/enable-gps new file mode 100755 index 0000000..e70eb2b --- /dev/null +++ b/test/enable-gps @@ -0,0 +1,20 @@ +#!/usr/bin/python + +import dbus +import 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') + modems = manager.GetModems() + path = modems[0][0] + +print "Powering ON the GPS for modem %s..." % path +gps = dbus.Interface(bus.get_object('org.ofono', path), + 'org.ofono.LocationReporting') + +gps.SetProperty("Powered", dbus.Boolean(1)) -- 1.7.2.3 _______________________________________________ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono