summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2014-01-31 15:17:23 -0600
committerDenis Kenzior <denkenz@gmail.com>2014-10-20 13:40:28 -0500
commitfb1b213e22d27f07b5757eea9f082a9c7a9c2ec2 (patch)
treec19685f9819edea766bc2e55ac0f720d086bceb1 /test
parentd3560b3784ac9bbe57bdbe0cc86e64b9a87b0ce0 (diff)
downloadofono-fb1b213e22d27f07b5757eea9f082a9c7a9c2ec2.tar.bz2
test: Add test/set-ddr
Script to set DistractedDrivingReduction property
Diffstat (limited to 'test')
-rwxr-xr-xtest/set-ddr21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/set-ddr b/test/set-ddr
new file mode 100755
index 00000000..5d061b95
--- /dev/null
+++ b/test/set-ddr
@@ -0,0 +1,21 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+
+modems = manager.GetModems()
+
+for path, properties in modems:
+ if "org.ofono.Handsfree" not in properties["Interfaces"]:
+ continue
+
+ handsfree = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.Handsfree')
+
+ handsfree.SetProperty("DistractedDrivingReduction",\
+ dbus.Boolean(int(sys.argv[1])))