All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/4] ussd: Recover idle state after a transaction error
@ 2012-09-05 16:56 Philippe Nunes
  2012-09-05 16:56 ` [PATCH v3 2/4] call-forwarding: SS query is done according the class given by SS code Philippe Nunes
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Philippe Nunes @ 2012-09-05 16:56 UTC (permalink / raw)
  To: ofono

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

The "USSD terminated by network" notification is handled to recover
the idle state in case of USSD transaction error.
---
 src/ussd.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/ussd.c b/src/ussd.c
index 74888b2..a35f172 100644
--- a/src/ussd.c
+++ b/src/ussd.c
@@ -414,6 +414,18 @@ void ofono_ussd_notify(struct ofono_ussd *ussd, int status, int dcs,
 		return;
 	}
 
+	if (status == OFONO_USSD_STATUS_TERMINATED &&
+			(ussd->state == USSD_STATE_IDLE ||
+			ussd->state == USSD_STATE_USER_ACTION)) {
+		ussd_change_state(ussd, USSD_STATE_IDLE);
+
+		if (ussd->pending == NULL)
+			return;
+
+		reply = __ofono_error_failed(ussd->pending);
+		goto out;
+	}
+
 	if (status == OFONO_USSD_STATUS_NOT_SUPPORTED) {
 		ussd_change_state(ussd, USSD_STATE_IDLE);
 
-- 
1.7.9.5


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

* [PATCH v3 2/4] call-forwarding: SS query is done according the class given by SS code
  2012-09-05 16:56 [PATCH v3 1/4] ussd: Recover idle state after a transaction error Philippe Nunes
@ 2012-09-05 16:56 ` Philippe Nunes
  2012-09-05 20:05   ` Denis Kenzior
  2012-09-05 16:56 ` [PATCH v3 3/4] call-barring: " Philippe Nunes
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Philippe Nunes @ 2012-09-05 16:56 UTC (permalink / raw)
  To: ofono

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

GCF test cases 31.2.1.6.1/2 are asking to make a query according a
specific class.
The default class is applied in the query form when no class is
specified in the SS code.
---
 src/call-forwarding.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index 91e34c6..2746771 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -1012,7 +1012,15 @@ static void ss_set_query_cf_callback(const struct ofono_error *error, int total,
 
 static void ss_set_query_next_cf_cond(struct ofono_call_forwarding *cf)
 {
-	cf->driver->query(cf, cf->query_next, BEARER_CLASS_DEFAULT,
+	int cls;
+
+	cls = (cf->ss_req->ss_type == SS_CONTROL_TYPE_QUERY) ?
+			cf->ss_req->cls : BEARER_CLASS_DEFAULT;
+
+	if (cls == BEARER_CLASS_SS_DEFAULT)
+			cls = BEARER_CLASS_DEFAULT;
+
+	cf->driver->query(cf, cf->query_next, cls,
 			ss_set_query_cf_callback, cf);
 }
 
-- 
1.7.9.5


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

* [PATCH v3 3/4] call-barring: SS query is done according the class given by SS code
  2012-09-05 16:56 [PATCH v3 1/4] ussd: Recover idle state after a transaction error Philippe Nunes
  2012-09-05 16:56 ` [PATCH v3 2/4] call-forwarding: SS query is done according the class given by SS code Philippe Nunes
@ 2012-09-05 16:56 ` Philippe Nunes
  2012-09-05 16:56 ` [PATCH v3 4/4] atmodem: specify class for call barring query Philippe Nunes
  2012-09-05 19:53 ` [PATCH v3 1/4] ussd: Recover idle state after a transaction error Denis Kenzior
  3 siblings, 0 replies; 6+ messages in thread
From: Philippe Nunes @ 2012-09-05 16:56 UTC (permalink / raw)
  To: ofono

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

The default class is applied in the query form when no class is
specified in the SS code.
---
 src/call-barring.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/call-barring.c b/src/call-barring.c
index 68533c2..845cbc3 100644
--- a/src/call-barring.c
+++ b/src/call-barring.c
@@ -310,7 +310,8 @@ static void cb_ss_query_next_lock(struct ofono_call_barring *cb)
 {
 	int cls;
 
-	cls = cb->ss_req_cls | BEARER_CLASS_DEFAULT;
+	cls = (cb->ss_req_type == SS_CONTROL_TYPE_QUERY) ?
+			cb->ss_req_cls : cb->ss_req_cls | BEARER_CLASS_DEFAULT;
 
 	cb->driver->query(cb, cb_locks[cb->query_next].fac, cls,
 			cb_ss_query_next_lock_callback, cb);
-- 
1.7.9.5


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

* [PATCH v3 4/4] atmodem: specify class for call barring query
  2012-09-05 16:56 [PATCH v3 1/4] ussd: Recover idle state after a transaction error Philippe Nunes
  2012-09-05 16:56 ` [PATCH v3 2/4] call-forwarding: SS query is done according the class given by SS code Philippe Nunes
  2012-09-05 16:56 ` [PATCH v3 3/4] call-barring: " Philippe Nunes
@ 2012-09-05 16:56 ` Philippe Nunes
  2012-09-05 19:53 ` [PATCH v3 1/4] ussd: Recover idle state after a transaction error Denis Kenzior
  3 siblings, 0 replies; 6+ messages in thread
From: Philippe Nunes @ 2012-09-05 16:56 UTC (permalink / raw)
  To: ofono

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

class is specified when querying the call barring status if
the class is not the default (7 - voice, data and fax)
---
 drivers/atmodem/call-barring.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/atmodem/call-barring.c b/drivers/atmodem/call-barring.c
index 2efd4e9..a2417c7 100644
--- a/drivers/atmodem/call-barring.c
+++ b/drivers/atmodem/call-barring.c
@@ -89,7 +89,10 @@ static void at_call_barring_query(struct ofono_call_barring *cb,
 	if (strlen(lock) != 2)
 		goto error;
 
-	snprintf(buf, sizeof(buf), "AT+CLCK=\"%s\",2", lock);
+	if (cls == 7)
+		snprintf(buf, sizeof(buf), "AT+CLCK=\"%s\",2", lock);
+	else
+		snprintf(buf, sizeof(buf), "AT+CLCK=\"%s\",2,,%d", lock, cls);
 
 	if (g_at_chat_send(chat, buf, clck_prefix,
 				clck_query_cb, cbd, g_free) > 0)
-- 
1.7.9.5


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

* Re: [PATCH v3 1/4] ussd: Recover idle state after a transaction error
  2012-09-05 16:56 [PATCH v3 1/4] ussd: Recover idle state after a transaction error Philippe Nunes
                   ` (2 preceding siblings ...)
  2012-09-05 16:56 ` [PATCH v3 4/4] atmodem: specify class for call barring query Philippe Nunes
@ 2012-09-05 19:53 ` Denis Kenzior
  3 siblings, 0 replies; 6+ messages in thread
From: Denis Kenzior @ 2012-09-05 19:53 UTC (permalink / raw)
  To: ofono

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

Hi Philippe,

On 09/05/2012 11:56 AM, Philippe Nunes wrote:
> The "USSD terminated by network" notification is handled to recover
> the idle state in case of USSD transaction error.
> ---
>   src/ussd.c |   12 ++++++++++++
>   1 file changed, 12 insertions(+)
>
> diff --git a/src/ussd.c b/src/ussd.c
> index 74888b2..a35f172 100644
> --- a/src/ussd.c
> +++ b/src/ussd.c
> @@ -414,6 +414,18 @@ void ofono_ussd_notify(struct ofono_ussd *ussd, int status, int dcs,
>   		return;
>   	}
>
> +	if (status == OFONO_USSD_STATUS_TERMINATED&&
> +			(ussd->state == USSD_STATE_IDLE ||

Why do you need this guard?

> +			ussd->state == USSD_STATE_USER_ACTION)) {

Or this one for that matter.  In theory the terminated notification can 
come at any time.

> +		ussd_change_state(ussd, USSD_STATE_IDLE);
> +
> +		if (ussd->pending == NULL)
> +			return;
> +
> +		reply = __ofono_error_failed(ussd->pending);
> +		goto out;
> +	}
> +
>   	if (status == OFONO_USSD_STATUS_NOT_SUPPORTED) {
>   		ussd_change_state(ussd, USSD_STATE_IDLE);
>

Can't we treat it exactly like 'NOT_SUPPORTED' or 'TIMED_OUT' but with a 
different error?

Regards,
-Denis

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

* Re: [PATCH v3 2/4] call-forwarding: SS query is done according the class given by SS code
  2012-09-05 16:56 ` [PATCH v3 2/4] call-forwarding: SS query is done according the class given by SS code Philippe Nunes
@ 2012-09-05 20:05   ` Denis Kenzior
  0 siblings, 0 replies; 6+ messages in thread
From: Denis Kenzior @ 2012-09-05 20:05 UTC (permalink / raw)
  To: ofono

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

Hi Philippe,

On 09/05/2012 11:56 AM, Philippe Nunes wrote:
> GCF test cases 31.2.1.6.1/2 are asking to make a query according a
> specific class.
> The default class is applied in the query form when no class is
> specified in the SS code.
> ---
>   src/call-forwarding.c |   10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>

Patches 2-4 have been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2012-09-05 20:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-05 16:56 [PATCH v3 1/4] ussd: Recover idle state after a transaction error Philippe Nunes
2012-09-05 16:56 ` [PATCH v3 2/4] call-forwarding: SS query is done according the class given by SS code Philippe Nunes
2012-09-05 20:05   ` Denis Kenzior
2012-09-05 16:56 ` [PATCH v3 3/4] call-barring: " Philippe Nunes
2012-09-05 16:56 ` [PATCH v3 4/4] atmodem: specify class for call barring query Philippe Nunes
2012-09-05 19:53 ` [PATCH v3 1/4] ussd: Recover idle state after a transaction error 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.