mirror of git://git.sysmocom.de/ofono
Add some more test scripts for SMS and voice call testing
This commit is contained in:
parent
6a6213670c
commit
81f2f74dfd
|
@ -204,7 +204,8 @@ test_files = test/test-manager test/test-modem test/test-voicecall \
|
|||
test/test-ss-control-cb test/test-ss-control-cf \
|
||||
test/test-ss-control-cs \
|
||||
test/monitor-ofono test/list-modems test/enable-modem \
|
||||
test/list-operators
|
||||
test/list-operators test/dial-number test/hangup-all \
|
||||
test/receive-sms test/send-sms
|
||||
|
||||
conf_files = src/ofono.conf plugins/modem.conf
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
||||
properties = manager.GetProperties()
|
||||
|
||||
path = properties["Modems"][0]
|
||||
|
||||
manager = dbus.Interface(bus.get_object('org.ofono', path),
|
||||
'org.ofono.VoiceCallManager')
|
||||
|
||||
path = manager.Dial(sys.argv[1], sys.argv[2])
|
||||
|
||||
print path
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
import dbus
|
||||
|
||||
bus = dbus.SystemBus()
|
||||
|
||||
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
||||
'org.ofono.Manager')
|
||||
|
||||
properties = manager.GetProperties()
|
||||
|
||||
path = properties["Modems"][0]
|
||||
|
||||
manager = dbus.Interface(bus.get_object('org.ofono', path),
|
||||
'org.ofono.VoiceCallManager')
|
||||
|
||||
manager.HangupAll()
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import gobject
|
||||
|
||||
import dbus
|
||||
import dbus.mainloop.glib
|
||||
|
||||
def incoming_message(message, details, path, interface):
|
||||
print "%s" % (message)
|
||||
|
||||
for key in details:
|
||||
val = details[key]
|
||||
print " %s = %s" % (key, val)
|
||||
|
||||
if __name__ == '__main__':
|
||||
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
|
||||
|
||||
bus = dbus.SystemBus()
|
||||
|
||||
bus.add_signal_receiver(incoming_message,
|
||||
bus_name="org.ofono",
|
||||
signal_name = "ImmediateMessage",
|
||||
path_keyword="path",
|
||||
interface_keyword="interface")
|
||||
|
||||
bus.add_signal_receiver(incoming_message,
|
||||
bus_name="org.ofono",
|
||||
signal_name = "IncomingMessage",
|
||||
path_keyword="path",
|
||||
interface_keyword="interface")
|
||||
|
||||
mainloop = gobject.MainLoop()
|
||||
mainloop.run()
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
import dbus
|
||||
|
||||
bus = dbus.SystemBus()
|
||||
|
||||
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
||||
'org.ofono.Manager')
|
||||
|
||||
properties = manager.GetProperties()
|
||||
|
||||
path = properties["Modems"][0]
|
||||
|
||||
manager = dbus.Interface(bus.get_object('org.ofono', path),
|
||||
'org.ofono.SmsManager')
|
||||
|
||||
manager.SendMessage([ sys.argv[1] ], sys.argv[2])
|
Loading…
Reference in New Issue