---
Makefile.am | 3 ++-
test/set-gps | 29 +++++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 1 deletions(-)
create mode 100644 test/set-gps
diff --git a/Makefile.am b/Makefile.am
index 12b3c33..cf678ec 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -423,7 +423,8 @@ test_scripts = test/backtrace \
test/test-push-notification \
test/test-smart-messaging \
test/send-vcard \
- test/set-tty
+ test/set-tty \
+ test/set-gps
if TEST
testdir = $(pkglibdir)/test
diff --git a/test/set-gps b/test/set-gps
new file mode 100644
index 0000000..5e38cae
--- /dev/null
+++ b/test/set-gps
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+
+import dbus
+import sys
+
+bus = dbus.SystemBus()
+
+if len(sys.argv) == 3:
+ path = sys.argv[1]
+ power = int(sys.argv[2])
+elif len(sys.argv) == 2:
+ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+ modems = manager.GetModems()
+ path = modems[0][0]
+ power = int(sys.argv[1])
+else:
+ print "%s [PATH] {0|1}" % (sys.argv[0])
+ exit(1)
+
+if power > 0:
+ print "Turning ON GPS for modem %s..." % path
+else:
+ print "Turning OFF GPS for modem %s..." % path
+
+gps = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.Gps')
+
+gps.SetProperty("Powered", dbus.Boolean(power));
--
1.7.2.3
Show replies by date