---
 test/test-stk-menu |   37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/test/test-stk-menu b/test/test-stk-menu
index a9f92e8..476d949 100755
--- a/test/test-stk-menu
+++ b/test/test-stk-menu
@@ -7,6 +7,27 @@ import dbus
 import dbus.service
 import dbus.mainloop.glib
 
+
+
+class _GetchUnix:
+    def __init__(self):
+        import tty, sys
+
+    def __call__(self):
+        import sys, tty, termios
+        fd = sys.stdin.fileno()
+        old_settings = termios.tcgetattr(fd)
+        try:
+            tty.setraw(sys.stdin.fileno())
+            ch = sys.stdin.read(1)
+        finally:
+            termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
+        return ch
+
+
+getch = _GetchUnix()
+
+
 class GoBack(dbus.DBusException):
        _dbus_error_name = "org.ofono.Error.GoBack"
 
@@ -127,6 +148,22 @@ class StkAgent(dbus.service.Object):
                        return key
 
        @dbus.service.method("org.ofono.SimToolkitAgent",
+                               in_signature="sy", out_signature="s")
+       def RequestQuickDigit(self, title, icon):
+               print "Title: (%s)" % (title)
+               print "Icon: (%d)" % (icon)
+               print "Single key press (t, b, 0-9,*,#)" 
+               key = getch();
+
+               if key == 'b':
+                       raise GoBack("User wishes to go back");
+               elif key == 't':
+                       raise EndSession("User wishes to terminate session");
+               else:
+                       print "."                       
+                       return key
+
+       @dbus.service.method("org.ofono.SimToolkitAgent",
                                in_signature="sy", out_signature="b")
        def RequestConfirmation(self, title, icon):
                print "Title: (%s)" % (title)
-- 
1.7.9.5

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to