Skip to contentSkip to conversation

Immediate digit response

PATCH Superseded Philippe Nunes 2 participants 7 messages Aug 24, 2012

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Immediate digit response

For GET-INPUT proactive command, the command qualifier can require to send the response immediately after the user has entered a digit. In this mode, the entered digit shall not be displayed and the character '+' is not allowed for user input.

Philippe Nunes (4):
stk: check if immediate digit response is requested
stkagent: Add argument to notify when immediate digit response is
required
doc: Update STK API regarding the new argument immediate_response
test: Print the immediate_response argument for RequestDigit

 doc/stk-api.txt    |   13 +++++++++----
 src/stk.c          |    6 ++++--
 src/stkagent.c     |    6 ++++--
 src/stkagent.h     |    5 +++--
 test/test-stk-menu |    5 +++--
 5 files changed, 23 insertions(+), 12 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/4 stk: check if immediate digit response is requested

---
 src/stk.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
src/stk.c +4 -2
index 7a7bd75..3883d11 100644
@@ -1519,6 +1519,7 @@ static gboolean handle_command_get_inkey(const struct stk_command *cmd,
 	gboolean alphabet = (qualifier & (1 << 0)) != 0;
 	gboolean ucs2 = (qualifier & (1 << 1)) != 0;
 	gboolean yesno = (qualifier & (1 << 2)) != 0;
+	gboolean immediate = (qualifier & (1 << 3)) != 0;
 	/*
 	 * Note: immediate response and help parameter values are not
 	 * provided by current api.
@@ -1547,8 +1548,9 @@ static gboolean handle_command_get_inkey(const struct stk_command *cmd,
 						timeout);
 	else
 		err = stk_agent_request_digit(stk->current_agent, text,
-						&gi->icon_id, request_key_cb,
-						stk, NULL, timeout);
+						&gi->icon_id, immediate,
+						request_key_cb, stk, NULL,
+						timeout);
 
 	g_free(text);
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/4 stkagent: Add argument to notify when immediate digit response is required

In reply to Philippe Nunes
---
 src/stkagent.c |    6 ++++--
 src/stkagent.h |    5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
src/stkagent.c +4 -2
index 7c3f697..ed5d28a 100644
@@ -554,8 +554,9 @@ static void get_digit_cb(DBusPendingCall *call, void *data)
 
 int stk_agent_request_digit(struct stk_agent *agent, const char *text,
 				const struct stk_icon_id *icon,
-				stk_agent_string_cb cb, void *user_data,
-				ofono_destroy_func destroy, int timeout)
+				ofono_bool_t immediate, stk_agent_string_cb cb,
+				void *user_data, ofono_destroy_func destroy,
+				int timeout)
 {
 	DBusConnection *conn = ofono_dbus_get_connection();
 
@@ -568,6 +569,7 @@ int stk_agent_request_digit(struct stk_agent *agent, const char *text,
 	dbus_message_append_args(agent->msg,
 					DBUS_TYPE_STRING, &text,
 					DBUS_TYPE_BYTE, &icon->id,
+					DBUS_TYPE_BOOLEAN, &immediate,
 					DBUS_TYPE_INVALID);
 
 	if (dbus_connection_send_with_reply(conn, agent->msg, &agent->call,
src/stkagent.h +3 -2
index 6e267fc..e797c1e 100644
@@ -99,8 +99,9 @@ int stk_agent_request_confirmation(struct stk_agent *agent, const char *text,
 
 int stk_agent_request_digit(struct stk_agent *agent, const char *text,
 				const struct stk_icon_id *icon,
-				stk_agent_string_cb cb, void *user_data,
-				ofono_destroy_func destroy, int timeout);
+				ofono_bool_t immediate, stk_agent_string_cb cb,
+				void *user_data, ofono_destroy_func destroy,
+				int timeout);
 
 int stk_agent_request_key(struct stk_agent *agent, const char *text,
 				const struct stk_icon_id *icon,
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/4 doc: Update STK API regarding the new argument immediate_response

In reply to Philippe Nunes
---
 doc/stk-api.txt |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
doc/stk-api.txt +9 -4
index 471e5d6..0d96246 100644
@@ -170,8 +170,9 @@ Methods		byte RequestSelection(string title, byte icon_id,
 					string default, byte min, byte max,
 					boolean hide_typing)
 
-			Same as GetInput but only digit characters (0-9, *#+)
-			are expected.
+			Same as RequestInput but only digit characters
+			(0-9, *#+) are expected. In hidden entry mode, "+" is
+			not allowed for user input.
 
 			Possible Errors: [service].Error.SimToolkit.GoBack
 					 [service].Error.SimToolkit.EndSession
@@ -185,10 +186,14 @@ Methods		byte RequestSelection(string title, byte icon_id,
 			Possible Errors: [service].Error.SimToolkit.GoBack
 					 [service].Error.SimToolkit.EndSession
 
-		string RequestDigit(string alpha, byte icon_id)
+		string RequestDigit(string alpha, byte icon_id,
+					boolean immediate_response)
 
 			Same as above, but only digits (0-9, *#+) are
-			expected.
+			expected. The parameter immediate_response indicates
+			that the entered digit shall not be displayed and the
+			response shall be sent immediately after the key press.
+			"+" is not allowed for user input in this mode.
 
 			Possible Errors: [service].Error.SimToolkit.GoBack
 					 [service].Error.SimToolkit.EndSession
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 4/4 test: Print the immediate_response argument for RequestDigit

In reply to Philippe Nunes
---
 test/test-stk-menu |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
test/test-stk-menu +3 -2
index a9f92e8..3bd4483 100755
@@ -113,10 +113,11 @@ class StkAgent(dbus.service.Object):
 			return key
 
 	@dbus.service.method("org.ofono.SimToolkitAgent",
-				in_signature="sy", out_signature="s")
-	def RequestDigit(self, title, icon):
+				in_signature="sys", out_signature="s")
+	def RequestDigit(self, title, icon, immediate_response):
 		print "Title: (%s)" % (title)
 		print "Icon: (%d)" % (icon)
+		print "Immediate response: (%s)" % (immediate_response)
 		key = raw_input("Enter Digit (t, b):")
 
 		if key == 'b':
Signature · 1 line
1.7.9.5
#4 lore raw

Re: [PATCH 3/4] doc: Update STK API regarding the new argument immediate_response

In reply to Philippe Nunes

Hi Philippe,

Quoted 10 lines · Philippe Nunes
---
  doc/stk-api.txt |   13 +++++++++----
  1 file changed, 9 insertions(+), 4 deletions(-)
doc/stk-api.txt +0 -0
index 471e5d6..0d96246 100644
@@ -170,8 +170,9 @@ Methods		byte RequestSelection(string title, byte icon_id,
  					string default, byte min, byte max,

doc/stk-api.txt Methods byte RequestSelection(string title, byte icon_id, · line 178

Quoted 10 lines
doc/stk-api.txt +3 -2
  					boolean hide_typing)
 
-			Same as GetInput but only digit characters (0-9, *#+)
-			are expected.
+			Same as RequestInput but only digit characters
+			(0-9, *#+) are expected. In hidden entry mode, "+" is
+			not allowed for user input.
 
  			Possible Errors: [service].Error.SimToolkit.GoBack
  					 [service].Error.SimToolkit.EndSession

Why is this chunk in this patch? What you're changing here does not match the patch description at all.

Quoted 7 lines
doc/stk-api.txt +2 -1
@@ -185,10 +186,14 @@ Methods		byte RequestSelection(string title, byte icon_id,
  			Possible Errors: [service].Error.SimToolkit.GoBack
  					 [service].Error.SimToolkit.EndSession
 
-		string RequestDigit(string alpha, byte icon_id)
+		string RequestDigit(string alpha, byte icon_id,
+					boolean immediate_response)

doc/stk-api.txt Methods byte RequestSelection(string title, byte icon_id, · line 199

Quoted 10 lines
doc/stk-api.txt +4 -1
 
  			Same as above, but only digits (0-9, *#+) are
-			expected.
+			expected. The parameter immediate_response indicates
+			that the entered digit shall not be displayed and the
+			response shall be sent immediately after the key press.
+			"+" is not allowed for user input in this mode.
 
  			Possible Errors: [service].Error.SimToolkit.GoBack
  					 [service].Error.SimToolkit.EndSession

Unfortunately we cannot do it this way, the oFono API is frozen, we can only add new Methods, not change their arguments. Naming is tricky since the immediate_response crap in the STK spec is utterly stupid. Name it RequestQuickDigit for now and I will think on it some more.

Regards,
-Denis

#6 lore raw
In reply to Philippe Nunes

Hi Philippe,

Quoted 5 lines · Philippe Nunes

For GET-INPUT proactive command, the command qualifier can require to send the response immediately after the user has entered a digit. In this mode, the entered digit shall not be displayed and the character '+' is not allowed for user input.

Quoted 7 lines

Philippe Nunes (4):
stk: check if immediate digit response is requested
stkagent: Add argument to notify when immediate digit response is
required
doc: Update STK API regarding the new argument immediate_response
test: Print the immediate_response argument for RequestDigit

This patch ordering makes no sense. The doc changes should be first, followed by stkagent changes followed by stk changes and then the test scripts. Remember you want to break git bisect as little as possible.

Regards,
-Denis