test: Add CDMA MO Call Support scripts

This commit is contained in:
Dara Spieker-Doyle 2011-01-13 12:19:12 -08:00 committed by Denis Kenzior
parent 58574e61bc
commit 99d10bfc2c
4 changed files with 73 additions and 1 deletions

View File

@ -455,7 +455,10 @@ test_scripts = test/backtrace \
test/set-gsm-band \
test/set-umts-band \
test/lockdown-modem \
test/set-call-forwarding
test/set-call-forwarding \
test/cdma-list-call \
test/cdma-dial-number \
test/cdma-hangup
if TEST
testdir = $(pkglibdir)/test

24
test/cdma-dial-number Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/python
import sys
import dbus
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
if len(sys.argv) > 2:
path = sys.argv[1]
number = sys.argv[2]
else:
modems = manager.GetModems()
path, properties = modems[0]
number = sys.argv[1]
print "Using modem %s" % path
manager = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.cdma.VoiceCallManager')
manager.Dial(number)

20
test/cdma-hangup Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/python
import sys
import dbus
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
if len(sys.argv) > 2:
path = sys.argv[1]
else:
modems = manager.GetModems()
path, properties = modems[0]
manager = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.cdma.VoiceCallManager')
manager.Hangup()

25
test/cdma-list-call Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/python
import dbus
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
modems = manager.GetModems()
for path, properties in modems:
print "[ %s ]" % (path)
if "org.ofono.cdma.VoiceCallManager" not in properties["Interfaces"]:
continue
mgr = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.cdma.VoiceCallManager')
properties = mgr.GetProperties()
for key in properties.keys():
val = str(properties[key])
print " %s = %s" % (key, val)