mirror of git://git.sysmocom.de/ofono
test: Add test/set-ddr
Script to set DistractedDrivingReduction property
This commit is contained in:
parent
d3560b3784
commit
fb1b213e22
|
@ -665,7 +665,8 @@ test_scripts = test/backtrace \
|
|||
test/hangup-multiparty \
|
||||
test/hangup-call \
|
||||
test/display-icon \
|
||||
test/set-msisdn
|
||||
test/set-msisdn \
|
||||
test/set-ddr
|
||||
|
||||
if TEST
|
||||
testdir = $(pkglibdir)/test
|
||||
|
|
|
@ -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])))
|
Loading…
Reference in New Issue