All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stk: Additional info for failed Send USSD case
  2010-09-29 12:28 Additional info for failed SAT-Send " Jeevaka Badrappan
@ 2010-09-29 12:28 ` Jeevaka Badrappan
  2010-10-01  0:11   ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: Jeevaka Badrappan @ 2010-09-29 12:28 UTC (permalink / raw)
  To: ofono

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

---
 src/stk.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/stk.c b/src/stk.c
index bbbc4fd..59771b0 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -1621,6 +1621,7 @@ static void send_ussd_callback(int error, int dcs, const unsigned char *msg,
 	struct ofono_error failure = { .type = OFONO_ERROR_TYPE_FAILURE };
 	struct stk_response rsp;
 	enum sms_charset charset;
+	unsigned char addnl;
 
 	if (stk->pending_cmd->send_ussd.alpha_id &&
 			stk->pending_cmd->send_ussd.alpha_id[0])
@@ -1661,7 +1662,14 @@ static void send_ussd_callback(int error, int dcs, const unsigned char *msg,
 		break;
 
 	default:
-		send_simple_response(stk, STK_RESULT_TYPE_USSD_RETURN_ERROR);
+		rsp.result.type = STK_RESULT_TYPE_USSD_RETURN_ERROR;
+		addnl = 0; /* No specific cause can be given */
+		rsp.result.additional = &addnl;
+		rsp.result.additional_len = 1;
+
+		if (stk_respond(stk, &rsp, stk_command_cb))
+			stk_command_cb(&failure, stk);
+
 		break;
 	}
 }
-- 
1.7.0.4


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

* Re: [PATCH] stk: Additional info for failed Send USSD case
  2010-09-29 12:28 ` [PATCH] stk: Additional info for failed Send " Jeevaka Badrappan
@ 2010-10-01  0:11   ` Denis Kenzior
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2010-10-01  0:11 UTC (permalink / raw)
  To: ofono

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

Hi Jeevaka,

> +	unsigned char addnl;

Lets try to be consistent with other parts of stk.c.
Use unsigned char no_cause[] = { 0x00 };

>  
>  	if (stk->pending_cmd->send_ussd.alpha_id &&
>  			stk->pending_cmd->send_ussd.alpha_id[0])
> @@ -1661,7 +1662,14 @@ static void send_ussd_callback(int error, int dcs, const unsigned char *msg,
>  		break;
>  
>  	default:
> -		send_simple_response(stk, STK_RESULT_TYPE_USSD_RETURN_ERROR);
> +		rsp.result.type = STK_RESULT_TYPE_USSD_RETURN_ERROR;
> +		addnl = 0; /* No specific cause can be given */
> +		rsp.result.additional = &addnl;
> +		rsp.result.additional_len = 1;
> +

Then rsp.result.additional_len = sizeof(no_cause);
rsp.result.additional = no_cause

> +		if (stk_respond(stk, &rsp, stk_command_cb))
> +			stk_command_cb(&failure, stk);
> +
>  		break;
>  	}
>  }

Otherwise looks good.

Regards,
-Denis

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

* [PATCH] stk: Additional info for failed Send USSD case
@ 2010-10-01  6:32 Jeevaka Badrappan
  2010-10-02 22:25 ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: Jeevaka Badrappan @ 2010-10-01  6:32 UTC (permalink / raw)
  To: ofono

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

---
 src/stk.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/stk.c b/src/stk.c
index bbbc4fd..80b4d23 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -1621,6 +1621,7 @@ static void send_ussd_callback(int error, int dcs, const unsigned char *msg,
 	struct ofono_error failure = { .type = OFONO_ERROR_TYPE_FAILURE };
 	struct stk_response rsp;
 	enum sms_charset charset;
+	unsigned char no_cause[] = { 0x00 };
 
 	if (stk->pending_cmd->send_ussd.alpha_id &&
 			stk->pending_cmd->send_ussd.alpha_id[0])
@@ -1661,7 +1662,13 @@ static void send_ussd_callback(int error, int dcs, const unsigned char *msg,
 		break;
 
 	default:
-		send_simple_response(stk, STK_RESULT_TYPE_USSD_RETURN_ERROR);
+		rsp.result.type = STK_RESULT_TYPE_USSD_RETURN_ERROR;
+		rsp.result.additional_len = sizeof(no_cause);
+		rsp.result.additional = no_cause;
+
+		if (stk_respond(stk, &rsp, stk_command_cb))
+			stk_command_cb(&failure, stk);
+
 		break;
 	}
 }
-- 
1.7.0.4


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

* Re: [PATCH] stk: Additional info for failed Send USSD case
  2010-10-01  6:32 [PATCH] stk: Additional info for failed Send USSD case Jeevaka Badrappan
@ 2010-10-02 22:25 ` Denis Kenzior
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2010-10-02 22:25 UTC (permalink / raw)
  To: ofono

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

Hi Jeevaka,

On 10/01/2010 01:32 AM, Jeevaka Badrappan wrote:
> ---
>  src/stk.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 

This patch has been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2010-10-02 22:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-01  6:32 [PATCH] stk: Additional info for failed Send USSD case Jeevaka Badrappan
2010-10-02 22:25 ` Denis Kenzior
  -- strict thread matches above, loose matches on Subject: below --
2010-09-29 12:28 Additional info for failed SAT-Send " Jeevaka Badrappan
2010-09-29 12:28 ` [PATCH] stk: Additional info for failed Send " Jeevaka Badrappan
2010-10-01  0:11   ` 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.