All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] test: Update with RequestQuickDigit API
@ 2012-09-06 14:38 Philippe Nunes
  2012-09-06 14:38 ` [PATCH 2/3] test: playtone waits for single tone playback Philippe Nunes
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Philippe Nunes @ 2012-09-06 14:38 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 932 bytes --]

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

diff --git a/test/test-stk-menu b/test/test-stk-menu
index a9f92e8..6e7f7b7 100755
--- a/test/test-stk-menu
+++ b/test/test-stk-menu
@@ -127,6 +127,20 @@ 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)
+		key = raw_input("Quick digit (0-9, *, #, t, b):")
+
+		if key == 'b':
+			raise GoBack("User wishes to go back");
+		elif key == 't':
+			raise EndSession("User wishes to terminate session");
+		else:
+			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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] test: playtone waits for single tone playback
  2012-09-06 14:38 [PATCH 1/3] test: Update with RequestQuickDigit API Philippe Nunes
@ 2012-09-06 14:38 ` Philippe Nunes
  2012-09-06 14:38 ` [PATCH 3/3] test: iconId value is not a printable character Philippe Nunes
  2012-09-12  4:27 ` [PATCH 1/3] test: Update with RequestQuickDigit API Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Nunes @ 2012-09-06 14:38 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1288 bytes --]

To simulate the single tone playback (avoiding the stkagent method
to return immediately), a timeout is started (5 seconds).
During this time, the user can terminate the session.
---
 test/test-stk-menu |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/test/test-stk-menu b/test/test-stk-menu
index 6e7f7b7..f4553d1 100755
--- a/test/test-stk-menu
+++ b/test/test-stk-menu
@@ -6,6 +6,10 @@ import sys
 import dbus
 import dbus.service
 import dbus.mainloop.glib
+import signal
+
+def handler(signum, frame):
+	raise Exception("\nSingle tone is finished!")
 
 class GoBack(dbus.DBusException):
 	_dbus_error_name = "org.ofono.Error.GoBack"
@@ -195,6 +199,20 @@ class StkAgent(dbus.service.Object):
 		print "Text: %s" % (text)
 		print "Icon: %d" % (icon)
 
+		signal.signal(signal.SIGALRM, handler)
+		signal.alarm(5)
+
+		try:
+			key = raw_input("Press return to end before end of"
+							 " single tone (t):")
+			signal.alarm(0)
+
+			if key == 't':
+				raise EndSession("User wishes to terminate"
+								 " session");
+		except Exception, exc:
+			print exc
+
 	@dbus.service.method("org.ofono.SimToolkitAgent",
 					in_signature="ssy", out_signature="")
 	def LoopTone(self, tone, text, icon):
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] test: iconId value is not a printable character
  2012-09-06 14:38 [PATCH 1/3] test: Update with RequestQuickDigit API Philippe Nunes
  2012-09-06 14:38 ` [PATCH 2/3] test: playtone waits for single tone playback Philippe Nunes
@ 2012-09-06 14:38 ` Philippe Nunes
  2012-09-12  4:27 ` [PATCH 1/3] test: Update with RequestQuickDigit API Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Nunes @ 2012-09-06 14:38 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 605 bytes --]

---
 test/list-calls |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/test/list-calls b/test/list-calls
index 53124dc..2332b50 100755
--- a/test/list-calls
+++ b/test/list-calls
@@ -24,7 +24,8 @@ for path, properties in modems:
 		print "    [ %s ]" % (path)
 
 		for key in properties.keys():
-			val = str(properties[key])
-			print "        %s = %s" % (key, val)
-
-		print
+			if key == 'Icon':
+				print "        %s = %d" % (key, properties[key])
+			else:
+				val = str(properties[key])
+				print "        %s = %s" % (key, val)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] test: Update with RequestQuickDigit API
  2012-09-06 14:38 [PATCH 1/3] test: Update with RequestQuickDigit API Philippe Nunes
  2012-09-06 14:38 ` [PATCH 2/3] test: playtone waits for single tone playback Philippe Nunes
  2012-09-06 14:38 ` [PATCH 3/3] test: iconId value is not a printable character Philippe Nunes
@ 2012-09-12  4:27 ` Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2012-09-12  4:27 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

Hi Philippe,

On 09/06/2012 09:38 AM, Philippe Nunes wrote:
> ---
>   test/test-stk-menu |   14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>

All three patches have been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-12  4:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-06 14:38 [PATCH 1/3] test: Update with RequestQuickDigit API Philippe Nunes
2012-09-06 14:38 ` [PATCH 2/3] test: playtone waits for single tone playback Philippe Nunes
2012-09-06 14:38 ` [PATCH 3/3] test: iconId value is not a printable character Philippe Nunes
2012-09-12  4:27 ` [PATCH 1/3] test: Update with RequestQuickDigit API Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.