diff options
-rw-r--r-- | Makefile.am | 3 | ||||
-rwxr-xr-x | test/dial-number | 20 | ||||
-rwxr-xr-x | test/hangup-all | 18 | ||||
-rwxr-xr-x | test/receive-sms | 33 | ||||
-rwxr-xr-x | test/send-sms | 18 |
5 files changed, 91 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 02f88352..4517ea6c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/test/dial-number b/test/dial-number new file mode 100755 index 00000000..f2c445eb --- /dev/null +++ b/test/dial-number @@ -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 diff --git a/test/hangup-all b/test/hangup-all new file mode 100755 index 00000000..d75a29c6 --- /dev/null +++ b/test/hangup-all @@ -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() diff --git a/test/receive-sms b/test/receive-sms new file mode 100755 index 00000000..a658c587 --- /dev/null +++ b/test/receive-sms @@ -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() diff --git a/test/send-sms b/test/send-sms new file mode 100755 index 00000000..99e237a2 --- /dev/null +++ b/test/send-sms @@ -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]) |