All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] ifxmodem: emergency number list support
  2011-06-08 15:44 [PATCH] ifxmodem: emergency number list support Jeevaka Badrappan
@ 2011-06-06 23:04 ` Denis Kenzior
  2011-06-09 13:44   ` jeevaka.badrappan
  2011-07-20 13:23 ` Paccou, Nicolas
  1 sibling, 1 reply; 5+ messages in thread
From: Denis Kenzior @ 2011-06-06 23:04 UTC (permalink / raw)
  To: ofono

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

Hi Jeevaka,

On 06/08/2011 10:44 AM, Jeevaka Badrappan wrote:
> ---
>  drivers/ifxmodem/voicecall.c |   95 ++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 95 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/ifxmodem/voicecall.c b/drivers/ifxmodem/voicecall.c
> index 87a48e6..0aa83e4 100644
> --- a/drivers/ifxmodem/voicecall.c
> +++ b/drivers/ifxmodem/voicecall.c
> @@ -42,11 +42,13 @@
>  #include "ifxmodem.h"
>  
>  static const char *none_prefix[] = { NULL };
> +static const char *xlema_prefix[] = { "+XLEMA:", NULL };
>  
>  struct voicecall_data {
>  	GSList *calls;
>  	unsigned int local_release;
>  	GAtChat *chat;
> +	char **en_list;
>  };
>  
>  struct release_id_req {
> @@ -786,6 +788,93 @@ static void xcolp_notify(GAtResult *result, gpointer user_data)
>  	ofono_voicecall_notify(vc, call);
>  }
>  
> +static void xlema_notify(GAtResult *result, gpointer user_data)
> +{
> +	struct ofono_voicecall *vc = user_data;
> +	struct voicecall_data *vd = ofono_voicecall_get_data(vc);
> +	GAtResultIter iter;
> +	int index, total_cnt;
> +	const char *number;
> +	int count = (vd->en_list == NULL) ? 0 : g_strv_length(vd->en_list);
> +
> +	g_at_result_iter_init(&iter, result);
> +
> +	if (!g_at_result_iter_next(&iter, "+XLEMA:"))
> +		return;
> +
> +	if (!g_at_result_iter_next_number(&iter, &index))
> +		return;
> +
> +	if (!g_at_result_iter_next_number(&iter, &total_cnt))
> +		return;
> +
> +	if (!g_at_result_iter_next_string(&iter, &number))
> +		return;
> +
> +	/* Skip the category, valid in simpresent and mcc fields */

What is this comment referring to?

> +
> +	if (vd->en_list == NULL)
> +		vd->en_list = g_new0(char *, total_cnt + 1);
> +
> +	vd->en_list[count] = g_strdup(number);
> +
> +	if (index != total_cnt)
> +		return;
> +
> +	ofono_voicecall_en_list_notify(vc, vd->en_list);
> +
> +	g_strfreev(vd->en_list);
> +	vd->en_list = NULL;
> +}
> +
> +static void xlema_read(gboolean ok, GAtResult *result, gpointer user_data)
> +{
> +	struct ofono_voicecall *vc = user_data;
> +	struct voicecall_data *vd = ofono_voicecall_get_data(vc);
> +	GAtResultIter iter;
> +	int num = 0;
> +	int index, total_cnt;
> +	const char *number;
> +
> +	if (!ok) {
> +		DBG("Emergency number list read failed");
> +		return;
> +	}
> +
> +	g_at_result_iter_init(&iter, result);
> +
> +	while (g_at_result_iter_next(&iter, "+XLEMA:"))
> +		num += 1;
> +
> +	vd->en_list = g_new0(char *, num + 1);
> +
> +	num = 0;
> +	g_at_result_iter_init(&iter, result);
> +
> +	while (g_at_result_iter_next(&iter, "+XLEMA:")) {
> +		if (!g_at_result_iter_next_number(&iter, &index))
> +			continue;
> +
> +		if (!g_at_result_iter_next_number(&iter, &total_cnt))
> +			continue;
> +
> +		if (!g_at_result_iter_next_string(&iter, &number))
> +			continue;
> +
> +		/* Skip the category, valid in simpresent and mcc fields */
> +		g_at_result_iter_skip_next(&iter);
> +		g_at_result_iter_skip_next(&iter);
> +		g_at_result_iter_skip_next(&iter);

What are you trying to achieve here?  Since you're not checking the
result, it doesn't look like this code serves any purpose.

> +
> +		vd->en_list[num++] = g_strdup(number);
> +	}
> +
> +	ofono_voicecall_en_list_notify(vc, vd->en_list);
> +
> +	g_strfreev(vd->en_list);
> +	vd->en_list = NULL;
> +}
> +
>  static void ifx_voicecall_initialized(gboolean ok, GAtResult *result,
>  					gpointer user_data)
>  {
> @@ -802,6 +891,10 @@ static void ifx_voicecall_initialized(gboolean ok, GAtResult *result,
>  	g_at_chat_register(vd->chat, "+XCALLSTAT:", xcallstat_notify,
>  							FALSE, vc, NULL);
>  	g_at_chat_register(vd->chat, "+XCOLP:", xcolp_notify, FALSE, vc, NULL);
> +	g_at_chat_register(vd->chat, "+XLEMA:", xlema_notify, FALSE, vc, NULL);
> +	/* Enable emergency number list notification */
> +	g_at_chat_send(vd->chat, "AT+XLEMA=1", xlema_prefix, xlema_read, vc,
> +									NULL);
>  
>  	ofono_voicecall_register(vc);
>  }
> @@ -840,6 +933,8 @@ static void ifx_voicecall_remove(struct ofono_voicecall *vc)
>  	g_slist_foreach(vd->calls, (GFunc) g_free, NULL);
>  	g_slist_free(vd->calls);
>  
> +	g_strfreev(vd->en_list);
> +
>  	ofono_voicecall_set_data(vc, NULL);
>  
>  	g_at_chat_unref(vd->chat);

Otherwise this looks good to me.

Regards,
-Denis

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

* [PATCH] ifxmodem: emergency number list support
@ 2011-06-08 15:44 Jeevaka Badrappan
  2011-06-06 23:04 ` Denis Kenzior
  2011-07-20 13:23 ` Paccou, Nicolas
  0 siblings, 2 replies; 5+ messages in thread
From: Jeevaka Badrappan @ 2011-06-08 15:44 UTC (permalink / raw)
  To: ofono

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

---
 drivers/ifxmodem/voicecall.c |   95 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 95 insertions(+), 0 deletions(-)

diff --git a/drivers/ifxmodem/voicecall.c b/drivers/ifxmodem/voicecall.c
index 87a48e6..0aa83e4 100644
--- a/drivers/ifxmodem/voicecall.c
+++ b/drivers/ifxmodem/voicecall.c
@@ -42,11 +42,13 @@
 #include "ifxmodem.h"
 
 static const char *none_prefix[] = { NULL };
+static const char *xlema_prefix[] = { "+XLEMA:", NULL };
 
 struct voicecall_data {
 	GSList *calls;
 	unsigned int local_release;
 	GAtChat *chat;
+	char **en_list;
 };
 
 struct release_id_req {
@@ -786,6 +788,93 @@ static void xcolp_notify(GAtResult *result, gpointer user_data)
 	ofono_voicecall_notify(vc, call);
 }
 
+static void xlema_notify(GAtResult *result, gpointer user_data)
+{
+	struct ofono_voicecall *vc = user_data;
+	struct voicecall_data *vd = ofono_voicecall_get_data(vc);
+	GAtResultIter iter;
+	int index, total_cnt;
+	const char *number;
+	int count = (vd->en_list == NULL) ? 0 : g_strv_length(vd->en_list);
+
+	g_at_result_iter_init(&iter, result);
+
+	if (!g_at_result_iter_next(&iter, "+XLEMA:"))
+		return;
+
+	if (!g_at_result_iter_next_number(&iter, &index))
+		return;
+
+	if (!g_at_result_iter_next_number(&iter, &total_cnt))
+		return;
+
+	if (!g_at_result_iter_next_string(&iter, &number))
+		return;
+
+	/* Skip the category, valid in simpresent and mcc fields */
+
+	if (vd->en_list == NULL)
+		vd->en_list = g_new0(char *, total_cnt + 1);
+
+	vd->en_list[count] = g_strdup(number);
+
+	if (index != total_cnt)
+		return;
+
+	ofono_voicecall_en_list_notify(vc, vd->en_list);
+
+	g_strfreev(vd->en_list);
+	vd->en_list = NULL;
+}
+
+static void xlema_read(gboolean ok, GAtResult *result, gpointer user_data)
+{
+	struct ofono_voicecall *vc = user_data;
+	struct voicecall_data *vd = ofono_voicecall_get_data(vc);
+	GAtResultIter iter;
+	int num = 0;
+	int index, total_cnt;
+	const char *number;
+
+	if (!ok) {
+		DBG("Emergency number list read failed");
+		return;
+	}
+
+	g_at_result_iter_init(&iter, result);
+
+	while (g_at_result_iter_next(&iter, "+XLEMA:"))
+		num += 1;
+
+	vd->en_list = g_new0(char *, num + 1);
+
+	num = 0;
+	g_at_result_iter_init(&iter, result);
+
+	while (g_at_result_iter_next(&iter, "+XLEMA:")) {
+		if (!g_at_result_iter_next_number(&iter, &index))
+			continue;
+
+		if (!g_at_result_iter_next_number(&iter, &total_cnt))
+			continue;
+
+		if (!g_at_result_iter_next_string(&iter, &number))
+			continue;
+
+		/* Skip the category, valid in simpresent and mcc fields */
+		g_at_result_iter_skip_next(&iter);
+		g_at_result_iter_skip_next(&iter);
+		g_at_result_iter_skip_next(&iter);
+
+		vd->en_list[num++] = g_strdup(number);
+	}
+
+	ofono_voicecall_en_list_notify(vc, vd->en_list);
+
+	g_strfreev(vd->en_list);
+	vd->en_list = NULL;
+}
+
 static void ifx_voicecall_initialized(gboolean ok, GAtResult *result,
 					gpointer user_data)
 {
@@ -802,6 +891,10 @@ static void ifx_voicecall_initialized(gboolean ok, GAtResult *result,
 	g_at_chat_register(vd->chat, "+XCALLSTAT:", xcallstat_notify,
 							FALSE, vc, NULL);
 	g_at_chat_register(vd->chat, "+XCOLP:", xcolp_notify, FALSE, vc, NULL);
+	g_at_chat_register(vd->chat, "+XLEMA:", xlema_notify, FALSE, vc, NULL);
+	/* Enable emergency number list notification */
+	g_at_chat_send(vd->chat, "AT+XLEMA=1", xlema_prefix, xlema_read, vc,
+									NULL);
 
 	ofono_voicecall_register(vc);
 }
@@ -840,6 +933,8 @@ static void ifx_voicecall_remove(struct ofono_voicecall *vc)
 	g_slist_foreach(vd->calls, (GFunc) g_free, NULL);
 	g_slist_free(vd->calls);
 
+	g_strfreev(vd->en_list);
+
 	ofono_voicecall_set_data(vc, NULL);
 
 	g_at_chat_unref(vd->chat);
-- 
1.7.4.1


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

* Re: [PATCH] ifxmodem: emergency number list support
  2011-06-06 23:04 ` Denis Kenzior
@ 2011-06-09 13:44   ` jeevaka.badrappan
  0 siblings, 0 replies; 5+ messages in thread
From: jeevaka.badrappan @ 2011-06-09 13:44 UTC (permalink / raw)
  To: ofono

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

Hi Denis,

>> +
>> +	if (!g_at_result_iter_next_number(&iter, &total_cnt))
>> +		return;
>> +
>> +	if (!g_at_result_iter_next_string(&iter, &number))
>> +		return;
>> +
>> +	/* Skip the category, valid in simpresent and mcc fields */
>
> What is this comment referring to?

Following fields like category, valid in sim present state and mcc are
skipped as we are not going to use it. Just for information purpose.
I'll remove the comment.

>
>> +
>> +	if (vd->en_list == NULL)
>> +		vd->en_list = g_new0(char *, total_cnt + 1);
>> +
>> +	vd->en_list[count] = g_strdup(number);
>> +
>> +	if (index != total_cnt)
>> +		return;
>> +
>> +	ofono_voicecall_en_list_notify(vc, vd->en_list);
>> +
>> +	g_strfreev(vd->en_list);
>> +	vd->en_list = NULL;
>> +}
>> +
>> +static void xlema_read(gboolean ok, GAtResult *result, gpointer
>> user_data)
>> +{
>> +	struct ofono_voicecall *vc = user_data;
>> +	struct voicecall_data *vd = ofono_voicecall_get_data(vc);
>> +	GAtResultIter iter;
>> +	int num = 0;
>> +	int index, total_cnt;
>> +	const char *number;
>> +
>> +	if (!ok) {
>> +		DBG("Emergency number list read failed");
>> +		return;
>> +	}
>> +
>> +	g_at_result_iter_init(&iter, result);
>> +
>> +	while (g_at_result_iter_next(&iter, "+XLEMA:"))
>> +		num += 1;
>> +
>> +	vd->en_list = g_new0(char *, num + 1);
>> +
>> +	num = 0;
>> +	g_at_result_iter_init(&iter, result);
>> +
>> +	while (g_at_result_iter_next(&iter, "+XLEMA:")) {
>> +		if (!g_at_result_iter_next_number(&iter, &index))
>> +			continue;
>> +
>> +		if (!g_at_result_iter_next_number(&iter, &total_cnt))
>> +			continue;
>> +
>> +		if (!g_at_result_iter_next_string(&iter, &number))
>> +			continue;
>> +
>> +		/* Skip the category, valid in simpresent and mcc fields */
>> +		g_at_result_iter_skip_next(&iter);
>> +		g_at_result_iter_skip_next(&iter);
>> +		g_at_result_iter_skip_next(&iter);
>
> What are you trying to achieve here?  Since you're not checking the
> result, it doesn't look like this code serves any purpose.

Agreed no pointing in having this as we are not going to make use of the
fields. Will be removed.

Regards,
Jeevaka

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

* RE: [PATCH] ifxmodem: emergency number list support
  2011-06-08 15:44 [PATCH] ifxmodem: emergency number list support Jeevaka Badrappan
  2011-06-06 23:04 ` Denis Kenzior
@ 2011-07-20 13:23 ` Paccou, Nicolas
  1 sibling, 0 replies; 5+ messages in thread
From: Paccou, Nicolas @ 2011-07-20 13:23 UTC (permalink / raw)
  To: ofono

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

Hi Jeevaka,

I'm Nicolas Paccou, I'm in charge of validating the changes applied in new oFono release.
Unfortunately, I have not the hardware to be able to regress your patch: "Add support for handling IFX emergency number list"

I wanted to know if you have tested your patch on IFX modem ?
If yes, can you tell me if the result is ok ?
If not, do you able to test it and tell me the result please ?

Thanks,
Nicolas

-----Original Message-----
From: ofono-bounces(a)ofono.org [mailto:ofono-bounces(a)ofono.org] On Behalf Of Jeevaka Badrappan
Sent: Wednesday, June 08, 2011 5:45 PM
To: ofono(a)ofono.org
Subject: [PATCH] ifxmodem: emergency number list support

---
 drivers/ifxmodem/voicecall.c |   95 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 95 insertions(+), 0 deletions(-)

diff --git a/drivers/ifxmodem/voicecall.c b/drivers/ifxmodem/voicecall.c
index 87a48e6..0aa83e4 100644
--- a/drivers/ifxmodem/voicecall.c
+++ b/drivers/ifxmodem/voicecall.c
@@ -42,11 +42,13 @@
 #include "ifxmodem.h"
 
 static const char *none_prefix[] = { NULL };
+static const char *xlema_prefix[] = { "+XLEMA:", NULL };
 
 struct voicecall_data {
 	GSList *calls;
 	unsigned int local_release;
 	GAtChat *chat;
+	char **en_list;
 };
 
 struct release_id_req {
@@ -786,6 +788,93 @@ static void xcolp_notify(GAtResult *result, gpointer user_data)
 	ofono_voicecall_notify(vc, call);
 }
 
+static void xlema_notify(GAtResult *result, gpointer user_data)
+{
+	struct ofono_voicecall *vc = user_data;
+	struct voicecall_data *vd = ofono_voicecall_get_data(vc);
+	GAtResultIter iter;
+	int index, total_cnt;
+	const char *number;
+	int count = (vd->en_list == NULL) ? 0 : g_strv_length(vd->en_list);
+
+	g_at_result_iter_init(&iter, result);
+
+	if (!g_at_result_iter_next(&iter, "+XLEMA:"))
+		return;
+
+	if (!g_at_result_iter_next_number(&iter, &index))
+		return;
+
+	if (!g_at_result_iter_next_number(&iter, &total_cnt))
+		return;
+
+	if (!g_at_result_iter_next_string(&iter, &number))
+		return;
+
+	/* Skip the category, valid in simpresent and mcc fields */
+
+	if (vd->en_list == NULL)
+		vd->en_list = g_new0(char *, total_cnt + 1);
+
+	vd->en_list[count] = g_strdup(number);
+
+	if (index != total_cnt)
+		return;
+
+	ofono_voicecall_en_list_notify(vc, vd->en_list);
+
+	g_strfreev(vd->en_list);
+	vd->en_list = NULL;
+}
+
+static void xlema_read(gboolean ok, GAtResult *result, gpointer user_data)
+{
+	struct ofono_voicecall *vc = user_data;
+	struct voicecall_data *vd = ofono_voicecall_get_data(vc);
+	GAtResultIter iter;
+	int num = 0;
+	int index, total_cnt;
+	const char *number;
+
+	if (!ok) {
+		DBG("Emergency number list read failed");
+		return;
+	}
+
+	g_at_result_iter_init(&iter, result);
+
+	while (g_at_result_iter_next(&iter, "+XLEMA:"))
+		num += 1;
+
+	vd->en_list = g_new0(char *, num + 1);
+
+	num = 0;
+	g_at_result_iter_init(&iter, result);
+
+	while (g_at_result_iter_next(&iter, "+XLEMA:")) {
+		if (!g_at_result_iter_next_number(&iter, &index))
+			continue;
+
+		if (!g_at_result_iter_next_number(&iter, &total_cnt))
+			continue;
+
+		if (!g_at_result_iter_next_string(&iter, &number))
+			continue;
+
+		/* Skip the category, valid in simpresent and mcc fields */
+		g_at_result_iter_skip_next(&iter);
+		g_at_result_iter_skip_next(&iter);
+		g_at_result_iter_skip_next(&iter);
+
+		vd->en_list[num++] = g_strdup(number);
+	}
+
+	ofono_voicecall_en_list_notify(vc, vd->en_list);
+
+	g_strfreev(vd->en_list);
+	vd->en_list = NULL;
+}
+
 static void ifx_voicecall_initialized(gboolean ok, GAtResult *result,
 					gpointer user_data)
 {
@@ -802,6 +891,10 @@ static void ifx_voicecall_initialized(gboolean ok, GAtResult *result,
 	g_at_chat_register(vd->chat, "+XCALLSTAT:", xcallstat_notify,
 							FALSE, vc, NULL);
 	g_at_chat_register(vd->chat, "+XCOLP:", xcolp_notify, FALSE, vc, NULL);
+	g_at_chat_register(vd->chat, "+XLEMA:", xlema_notify, FALSE, vc, NULL);
+	/* Enable emergency number list notification */
+	g_at_chat_send(vd->chat, "AT+XLEMA=1", xlema_prefix, xlema_read, vc,
+									NULL);
 
 	ofono_voicecall_register(vc);
 }
@@ -840,6 +933,8 @@ static void ifx_voicecall_remove(struct ofono_voicecall *vc)
 	g_slist_foreach(vd->calls, (GFunc) g_free, NULL);
 	g_slist_free(vd->calls);
 
+	g_strfreev(vd->en_list);
+
 	ofono_voicecall_set_data(vc, NULL);
 
 	g_at_chat_unref(vd->chat);
-- 
1.7.4.1

_______________________________________________
ofono mailing list
ofono(a)ofono.org
http://lists.ofono.org/listinfo/ofono
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


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

* RE: [PATCH] ifxmodem: emergency number list support
       [not found] <8250E4885F9967469CAC3FB5CBA2CE69946ABFF9C4@irsmsx501.ger.corp.intel.c om>
@ 2011-07-20 13:43 ` jeevaka.badrappan
  0 siblings, 0 replies; 5+ messages in thread
From: jeevaka.badrappan @ 2011-07-20 13:43 UTC (permalink / raw)
  To: ofono

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

Hi,

> Hi Jeevaka,
>
> I'm Nicolas Paccou, I'm in charge of validating the changes applied in new
> oFono release.
> Unfortunately, I have not the hardware to be able to regress your patch:
> "Add support for handling IFX emergency number list"
>
> I wanted to know if you have tested your patch on IFX modem ?
> If yes, can you tell me if the result is ok ?
> If not, do you able to test it and tell me the result please ?

Yep, this has been tested with the IFX modem FW which supports XLEMA.

Regards,
Jeevaka

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

end of thread, other threads:[~2011-07-20 13:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-08 15:44 [PATCH] ifxmodem: emergency number list support Jeevaka Badrappan
2011-06-06 23:04 ` Denis Kenzior
2011-06-09 13:44   ` jeevaka.badrappan
2011-07-20 13:23 ` Paccou, Nicolas
     [not found] <8250E4885F9967469CAC3FB5CBA2CE69946ABFF9C4@irsmsx501.ger.corp.intel.c om>
2011-07-20 13:43 ` jeevaka.badrappan

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.