Re: [PATCH 1/2] voicecall: add ofono_voicecall_en_list_notify api

2011-03-25 Thread Denis Kenzior
Hi Jeevaka,

On 03/25/2011 09:08 AM, Jeevaka Badrappan wrote:
> ---
>  include/voicecall.h |3 +++

Please break this up into two patches.

>  src/voicecall.c |   12 
>  2 files changed, 15 insertions(+), 0 deletions(-)
> 



> +void ofono_voicecall_en_list_notify(struct ofono_voicecall *vc,
> + GSList *new_en_list)
> +{
> + GSList *l;
> +
> + for (l = new_en_list; l; l = l->next)
> + vc->new_en_list = g_slist_prepend(vc->new_en_list,
> + g_strdup(l->data));

The pure 27.007 version of this function assumes that the en set is
being signaled by the cell tower.  This set needs to be union-ed with
the set obtained from the sim.

Likely you will need to track the sim list separately from the one
obtained from the cell tower and remove any duplicates.

> +
> + set_new_ecc(vc);
> +}
> +
>  int ofono_voicecall_driver_register(const struct ofono_voicecall_driver *d)
>  {
>   DBG("driver: %p, name: %s", d, d->name);

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH v2] gatserver: add v250 ATL and ATM commands

2011-03-25 Thread Denis Kenzior
Hi Olivier,

On 03/25/2011 05:07 AM, Olivier Guiter wrote:
> ---
>  gatchat/gatserver.c |   18 ++
>  1 files changed, 18 insertions(+), 0 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH] dun: Add ATX command in emulator (X0 only)

2011-03-25 Thread Denis Kenzior
Hi Olivier,

On 03/24/2011 10:29 AM, Olivier Guiter wrote:
> ---
>  src/emulator.c |   57 
> +++-
>  1 files changed, 56 insertions(+), 1 deletions(-)
> 

I applied this patch, however...



> + case G_AT_SERVER_REQUEST_TYPE_QUERY:
> + g_at_server_send_info(server, "000", TRUE);

This seems fishy to me.  Shouldn't this be X: 0?

> + g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
> + break;



Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH 5/6] stkutil: Complete the TLV parsing/builder to support BIP commands

2011-03-25 Thread Denis Kenzior
Hi Philippe,



> Indeed the size to be returned in the Terminal response is encoded with
> one byte (reason why you can find an unsigned char in the structures
> stk_response_receive_data and stk_response_send_data).
> I understand also the logic that fills the Data Length structure:
> stk_tlv_builder_append_byte(tlv, MIN(*length, 255))
> 
> but I really need to store the real number of bytes remaining/available,
> and this number can exceed 255. So, I would like to keep this data type
> or at least go for an unsigned short.
> 
>

Then go with unsigned short for now and I'll try to pay attention as to
why you think you need this on my next review.

> 
> Regarding the modifications I did in the enum section/structures, you
> wrote:
> 
>>Can you do me a favor and add the Section # for the enums / structs
>>you're modifying / introducing where needed.  We were supposed to be
>>doing this but somehow were not consistent enough over time.
> 
> Could you clarify with an example ?

Just have a look at stkutil.h, there are plenty of examples.

e.g.

/*
 * TS 101.220, Section 7.2, Card Application Toolkit assigned templates,
 * These are the same as 3GPP 11.14 Sections 13.1 and 13.2
 */
enum stk_envelope_type {

or

/* TS 102.223 Section 9.4 */
enum stk_command_type {

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH 5/6] stkutil: Complete the TLV parsing/builder to support BIP commands

2011-03-25 Thread Philippe Nunes

Hi Denis,

On 03/24/2011 03:32 PM, Denis Kenzior wrote:

Hi Philippe,


   struct stk_network_access_name {
-unsigned char name[127];
+unsigned char name[100];
   unsigned char len;


This part really makes no sense.  Since you parse it into a string,
might as well just use that.


All the above comments are just relevant. Thank you for having spent
time to point all these remarks and especially all the coding style
noncompliances. I will apply your comments in a new patch and separate
cleaning/typo modifications in another dedicated patch.

Here, the apn string is indeed extracted from the encoded buffer.
As the encoded apn just can't exceeed 100 bytes as per the spec and as
the extracted string is lesser than 100 bytes since we are removing the
octet length field , I considered that the string buffer was better
sized with 100 bytes than 127. But perhaps, I'm over thinking here...



Then just remove this structure and use a static buffer for the apn/nan...




   };

@@ -1250,6 +1298,21 @@ struct stk_command_launch_browser {
   char *text_passwd;
   };

+struct stk_command_open_channel {
+char *alpha_id;
+struct stk_icon_id icon_id;
+struct stk_bearer_description bearer_desc;
+unsigned short buf_size;
+struct stk_network_access_name network_name;


E.g. char *network_name;



e.g. char name[100] here.


+/* The number of bytes remaining in the Rx buffer */
+unsigned int data_left_length;


So maybe rx_remaining is a better name?


+/*
+ * The number of bytes of empty space available
+ * in the Tx buffer
+ */
+unsigned int empty_data_length;


And tx_avail here?

Then you don't need the comments ;)

Also, why do you use unsigned int instead of unsigned char?



In practice, the size (rx_remaining or tx_avail) can reach 65535 as the
buffer size it self given by the UICC is encoded by 2 bytes. I could
consider indeed to use at least an unsigned short, but to be homogeneous
with the type of the buffer size given by data.len, I preferred to go
with an unsigned int.


Stick with actual datatypes used on the wire.  If this is an 8 bit
sequence with FF used to mean 255 bytes or more, then use that.  The
logic that fills this structure will have to take care of that.

Besides, you use unsigned char in stk_response_receive_data and
stk_response_send_data, so might as well be consistent.

Use of unsigned int should be limited to the length field of the TLV,
and even then we might have to change this later for fields that are short.

Regards,
-Denis



Indeed the size to be returned in the Terminal response is encoded with 
one byte (reason why you can find an unsigned char in the structures 
stk_response_receive_data and stk_response_send_data).

I understand also the logic that fills the Data Length structure:
stk_tlv_builder_append_byte(tlv, MIN(*length, 255))

but I really need to store the real number of bytes remaining/available, 
and this number can exceed 255. So, I would like to keep this data type 
or at least go for an unsigned short.




Regarding the modifications I did in the enum section/structures, you wrote:

>Can you do me a favor and add the Section # for the enums / structs
>you're modifying / introducing where needed.  We were supposed to be
>doing this but somehow were not consistent enough over time.

Could you clarify with an example ?
Thanks.

Regards,

Philippe.






___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 17/18] gsmdial: add new option to test sending escape sequence

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gsmdial.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/gatchat/gsmdial.c b/gatchat/gsmdial.c
index a10e7cb..92a7ff2 100644
--- a/gatchat/gsmdial.c
+++ b/gatchat/gsmdial.c
@@ -57,6 +57,7 @@ static gchar *option_username = NULL;
 static gchar *option_password = NULL;
 static gchar *option_pppdump = NULL;
 static gboolean option_bluetooth = FALSE;
+static gboolean option_esc = FALSE;
 
 static GAtPPP *ppp;
 static GAtChat *control;
@@ -624,6 +625,8 @@ static GOptionEntry options[] = {
"Use ATD*99***#" },
{ "bluetooth", 'b', 0, G_OPTION_ARG_NONE, &option_bluetooth,
"Use only ATD*99" },
+   { "esc_seq", 'e', 0, G_OPTION_ARG_NONE, &option_esc,
+   "Send escape sequence test" },
{ "username", 'u', 0, G_OPTION_ARG_STRING, &option_username,
"Specify PPP username" },
{ "password", 'w', 0, G_OPTION_ARG_STRING, &option_password,
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 18/18] gsmdial: implement mechanism to send +++ -> ATO0 -> +++ -> ATH0

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gsmdial.c |  164 
 1 files changed, 138 insertions(+), 26 deletions(-)

diff --git a/gatchat/gsmdial.c b/gatchat/gsmdial.c
index 92a7ff2..f1b485e 100644
--- a/gatchat/gsmdial.c
+++ b/gatchat/gsmdial.c
@@ -40,6 +40,8 @@
 
 #define IFCONFIG_PATH "/sbin/ifconfig"
 
+#define GUARD_TIMEOUTS 1500
+
 static const char *none_prefix[] = { NULL };
 static const char *cfun_prefix[] = { "+CFUN:", NULL };
 static const char *creg_prefix[] = { "+CREG:", NULL };
@@ -238,32 +240,6 @@ static gboolean execute(const char *cmd)
return TRUE;
 }
 
-static void ppp_connect(const char *iface, const char *local, const char *peer,
-   const char *dns1, const char *dns2,
-   gpointer user_data)
-{
-   char buf[512];
-
-   /* print out the negotiated address and dns server */
-   g_print("Network Device: %s\n", iface);
-   g_print("IP Address: %s\n", local);
-   g_print("Peer IP Address: %s\n", peer);
-   g_print("Primary DNS Server: %s\n", dns1);
-   g_print("Secondary DNS Server: %s\n", dns2);
-
-   if (getuid() != 0) {
-   g_print("Need root privilege to config PPP interface\n");
-   return;
-   }
-
-   snprintf(buf, sizeof(buf), "%s %s up", IFCONFIG_PATH, iface);
-   execute(buf);
-
-   snprintf(buf, sizeof(buf), "%s %s %s pointopoint %s", IFCONFIG_PATH,
-   iface, local, peer);
-   execute(buf);
-}
-
 static void no_carrier_notify(GAtResult *result, gpointer user_data)
 {
char buf[64];
@@ -294,6 +270,142 @@ static void ppp_disconnect(GAtPPPDisconnectReason reason, 
gpointer user_data)
g_at_chat_resume(modem);
 }
 
+static void power_down_ppp(gboolean ok, GAtResult *result, gpointer user_data)
+{
+   if (!ok)
+   return;
+
+   g_at_ppp_unref(ppp);
+   ppp = NULL;
+}
+
+static gboolean send_ATH0(gpointer user_data)
+{
+   /* Resume AT chat to send ATH0 */
+   g_at_chat_resume(modem);
+   g_at_chat_send(modem, "ATH0", none_prefix, power_down_ppp, NULL, NULL);
+
+   return FALSE;
+}
+
+static gboolean suspend_and_close(gpointer user_data)
+{
+   g_print("Send +++\n");
+   /* Send the escape sequence to suspend PPP server*/
+   g_at_io_write(g_at_chat_get_io(modem), "+++", 3);
+   
+   /*
+* Wait GUARD_TIMEOUTS ms before sending ATH0 cmd
+* according to guard timeouts
+*/
+   g_timeout_add(GUARD_TIMEOUTS, send_ATH0, NULL);
+
+   return FALSE;
+}
+
+static void ppp_suspend_close(gpointer data)
+{
+   /* Delete the write done CB */
+   g_at_io_set_write_done(g_at_chat_get_io(modem), NULL, NULL);
+
+   /*
+* We are sure there are no more PPP packets to be written,
+* we can suspend PPP client
+*/
+   g_at_ppp_suspend(ppp);
+
+   /* Wait GUARD_TIMEOUTS ms before sending escape sequence */
+   g_timeout_add(GUARD_TIMEOUTS, suspend_and_close, NULL);
+}
+
+static void suspend_gat_chat(gboolean ok, GAtResult *result, gpointer 
user_data)
+{
+   /*
+* As soon as the command is treated by AT server
+* we can suspend AT chat and resume PPP client
+*/
+   g_at_chat_suspend(modem);
+   g_at_ppp_resume(ppp);
+
+   /*
+* We wait for another PPP packet to be written
+* to suspend again PPP server and close it
+*/
+   g_at_io_set_write_done(g_at_chat_get_io(modem), ppp_suspend_close, 
NULL);
+}
+
+static gboolean send_ATO0(gpointer user_data)
+{
+   /* Resume AT chat to send ATO0 */
+   g_at_chat_resume(modem);
+   g_at_chat_send(modem, "ATO0", none_prefix, suspend_gat_chat, NULL, 
NULL);
+
+   return FALSE;
+}
+
+static gboolean suspend_resume(gpointer user_data)
+{
+   g_print("Send +++\n");
+   /* Send the escape sequence to suspend PPP server*/
+   g_at_io_write(g_at_chat_get_io(modem), "+++", 3);
+
+   /*
+* Wait GUARD_TIMEOUTS ms before sending ATO0 cmd
+* according to guard timeouts
+*/
+   g_timeout_add(GUARD_TIMEOUTS, send_ATO0, NULL);
+
+   return FALSE;
+}
+
+static void ppp_suspend_resume(gpointer data)
+{
+   /* Delete the write done CB */
+   g_at_io_set_write_done(g_at_chat_get_io(modem), NULL, NULL);
+
+   /*
+* We are sure there are no more PPP packets to be written,
+* we can suspend PPP client
+*/
+   g_at_ppp_suspend(ppp);
+
+   /* Wait GUARD_TIMEOUTS ms before sending escape sequence */
+   g_timeout_add(GUARD_TIMEOUTS, suspend_resume, NULL);
+}
+
+static void ppp_connect(const char *iface, const char *local, const char *peer,
+   const char *dns1, const char *dns2,
+   gpointer user_data)
+{
+   char buf[512];
+
+   /* print out the negotiated address and dns server */
+   g_print("Network Device: %s\n", iface);
+   g_print("IP Add

[PATCH 16/18] gatppp: add g_at_ppp_suspend() definition

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gatppp.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
index 29271e4..27b7e96 100644
--- a/gatchat/gatppp.c
+++ b/gatchat/gatppp.c
@@ -484,6 +484,14 @@ void g_at_ppp_shutdown(GAtPPP *ppp)
pppcp_signal_close(ppp->lcp);
 }
 
+void g_at_ppp_suspend(GAtPPP *ppp)
+{
+   if (ppp == NULL)
+   return;
+
+   g_at_hdlc_suspend(ppp->hdlc);
+}
+
 void g_at_ppp_ref(GAtPPP *ppp)
 {
g_atomic_int_inc(&ppp->ref_count);
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 15/18] gatppp: add prototype to suspend ppp server externally

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gatppp.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gatchat/gatppp.h b/gatchat/gatppp.h
index 71e0afe..61ffb4a 100644
--- a/gatchat/gatppp.h
+++ b/gatchat/gatppp.h
@@ -64,6 +64,7 @@ void g_at_ppp_set_debug(GAtPPP *ppp, GAtDebugFunc func, 
gpointer user_data);
 void g_at_ppp_set_suspend_function(GAtPPP *ppp, GAtSuspendFunc func,
gpointer user_data);
 void g_at_ppp_shutdown(GAtPPP *ppp);
+void g_at_ppp_suspend(GAtPPP *ppp);
 void g_at_ppp_ref(GAtPPP *ppp);
 void g_at_ppp_unref(GAtPPP *ppp);
 
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 14/18] gathdlc: add g_at_hdlc_suspend() definition

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gathdlc.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/gatchat/gathdlc.c b/gatchat/gathdlc.c
index 16d803d..90de4e9 100644
--- a/gatchat/gathdlc.c
+++ b/gatchat/gathdlc.c
@@ -642,3 +642,16 @@ void g_at_hdlc_resume(GAtHDLC *hdlc)
paused_timeout_cb,
hdlc);
 }
+
+void g_at_hdlc_suspend(GAtHDLC *hdlc)
+{
+   if (hdlc == NULL)
+   return;
+
+   g_at_io_set_write_handler(hdlc->io, NULL, NULL);
+   g_at_io_set_read_handler(hdlc->io, NULL, NULL);
+
+   if (hdlc->suspend_func)
+   hdlc->suspend_func(hdlc->suspend_data);
+}
+
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 12/18] emulator: add AT online_data_state_cb() and register it

2011-03-25 Thread Guillaume Zajac
---
 src/emulator.c |   46 ++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/src/emulator.c b/src/emulator.c
index e1b078d..220d0b5 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -222,6 +222,51 @@ error:
g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
 }
 
+static gboolean resume_ppp(gpointer user_data)
+{
+   struct ofono_emulator *em = user_data;
+
+   g_at_server_suspend(em->server);
+   g_at_ppp_resume(em->ppp);
+
+   return FALSE;
+}
+
+static void online_data_state_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+   struct ofono_emulator *em = user_data;
+   GAtResultIter iter;
+   int val;
+
+   DBG("");
+
+   if (em->ppp == NULL) {
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_NO_CARRIER);
+   return;
+   }
+
+   if (type != G_AT_SERVER_REQUEST_TYPE_SET)
+   goto error;
+
+   g_at_result_iter_init(&iter, result);
+   g_at_result_iter_next(&iter, "");
+
+   if (g_at_result_iter_next_number(&iter, &val) == FALSE)
+   goto error;
+
+   if (val != 0)
+   goto error;
+
+   g_at_server_send_intermediate(em->server, "CONNECT");
+   em->source = g_idle_add(resume_ppp, em);
+
+   return;
+
+error:
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+}
+
 static void brsf_cb(GAtServer *server, GAtServerRequestType type,
GAtResult *result, gpointer user_data)
 {
@@ -514,6 +559,7 @@ void ofono_emulator_register(struct ofono_emulator *em, int 
fd)
if (em->type == OFONO_EMULATOR_TYPE_DUN) {
g_at_server_register(em->server, "D", dial_cb, em, NULL);
g_at_server_register(em->server, "H", hook_control_cb, em, 
NULL);
+   g_at_server_register(em->server, "O", online_data_state_cb, em, 
NULL);
} else {
if (em->type == OFONO_EMULATOR_TYPE_HFP)
g_at_server_set_echo(em->server, FALSE);
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 13/18] gathdlc: add prototype to suspend gathdlc externally

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gathdlc.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/gatchat/gathdlc.h b/gatchat/gathdlc.h
index 9719816..e5a5c29 100644
--- a/gatchat/gathdlc.h
+++ b/gatchat/gathdlc.h
@@ -62,6 +62,8 @@ void g_at_hdlc_set_suspend_function(GAtHDLC *hdlc, 
GAtSuspendFunc func,
 
 void g_at_hdlc_resume(GAtHDLC *hdlc);
 
+void g_at_hdlc_suspend(GAtHDLC *hdlc);
+
 #ifdef __cplusplus
 }
 #endif
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 11/18] gatppp: add g_at_ppp_resume() definition.

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gatppp.c |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
index 9df6b8e..29271e4 100644
--- a/gatchat/gatppp.c
+++ b/gatchat/gatppp.c
@@ -537,6 +537,22 @@ void g_at_ppp_set_server_info(GAtPPP *ppp, const char 
*remote,
ipcp_set_server_info(ppp->ipcp, r, d1, d2);
 }
 
+void g_at_ppp_resume(GAtPPP *ppp)
+{
+   if (ppp == NULL)
+   return;
+
+   if (g_at_hdlc_get_io(ppp->hdlc) == NULL) {
+   io_disconnect(ppp);
+   return;
+   }
+
+   g_at_io_set_disconnect_function(g_at_hdlc_get_io(ppp->hdlc),
+   io_disconnect, ppp);
+
+   g_at_hdlc_resume(ppp->hdlc);
+}
+
 static GAtPPP *ppp_init_common(GAtHDLC *hdlc, gboolean is_server, guint32 ip)
 {
GAtPPP *ppp;
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 10/18] gatppp: add g_at_ppp_resume() prototype

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gatppp.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/gatchat/gatppp.h b/gatchat/gatppp.h
index 7835d1f..71e0afe 100644
--- a/gatchat/gatppp.h
+++ b/gatchat/gatppp.h
@@ -77,6 +77,8 @@ void g_at_ppp_set_recording(GAtPPP *ppp, const char 
*filename);
 void g_at_ppp_set_server_info(GAtPPP *ppp, const char *remote_ip,
const char *dns1, const char *dns2);
 
+void g_at_ppp_resume(GAtPPP *ppp);
+
 #ifdef __cplusplus
 }
 #endif
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 09/18] gathdlc: add g_at_hdlc_resume() definition.

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gathdlc.c |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/gatchat/gathdlc.c b/gatchat/gathdlc.c
index 21e4533..16d803d 100644
--- a/gatchat/gathdlc.c
+++ b/gatchat/gathdlc.c
@@ -617,3 +617,28 @@ void g_at_hdlc_set_no_carrier_detect(GAtHDLC *hdlc, 
gboolean detect)
 
hdlc->no_carrier_detect = detect;
 }
+
+static void hdlc_wakeup_writer(GAtHDLC *hdlc)
+{
+   g_at_io_set_write_handler(hdlc->io, can_write_data, hdlc);
+}
+
+void g_at_hdlc_resume(GAtHDLC *hdlc)
+{
+   if (hdlc == NULL)
+   return;
+
+   g_at_io_set_read_handler(hdlc->io, new_bytes, hdlc);
+
+   if (g_queue_get_length(hdlc->write_queue) > 0)
+   hdlc_wakeup_writer(hdlc);
+
+   /*
+* As soon as we resume HDLC we can start checking for
+* guard timeouts pause.
+*/
+   if (!hdlc->paused)
+   hdlc->pause_timeout = g_timeout_add (GUARD_TIMEOUTS,
+   paused_timeout_cb,
+   hdlc);
+}
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 07/18] emulator: add AT hook_control_cb() and register it

2011-03-25 Thread Guillaume Zajac
---
 src/emulator.c |   44 +---
 1 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/src/emulator.c b/src/emulator.c
index c1ceb36..e1b078d 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -187,6 +187,41 @@ error:
g_at_server_send_final(em->server, G_AT_SERVER_RESULT_ERROR);
 }
 
+static void hook_control_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+   struct ofono_emulator *em = user_data;
+   GAtResultIter iter;
+   int val;
+
+   DBG("");
+
+   if (type != G_AT_SERVER_REQUEST_TYPE_SET)
+   goto error;
+
+   if (em->ppp == NULL)
+   goto error;
+
+   g_at_result_iter_init(&iter, result);
+   g_at_result_iter_next(&iter, "");
+
+   if (g_at_result_iter_next_number(&iter, &val) == FALSE)
+   goto error;
+
+   if (val != 0)
+   goto error;
+
+   g_at_ppp_unref(em->ppp);
+   em->ppp = NULL;
+
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+
+   return;
+
+error:
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+}
+
 static void brsf_cb(GAtServer *server, GAtServerRequestType type,
GAtResult *result, gpointer user_data)
 {
@@ -476,10 +511,13 @@ void ofono_emulator_register(struct ofono_emulator *em, 
int fd)
 
__ofono_atom_register(em->atom, emulator_unregister);
 
-   if (em->type == OFONO_EMULATOR_TYPE_DUN)
+   if (em->type == OFONO_EMULATOR_TYPE_DUN) {
g_at_server_register(em->server, "D", dial_cb, em, NULL);
-   else if (em->type == OFONO_EMULATOR_TYPE_HFP)
-   g_at_server_set_echo(em->server, FALSE);
+   g_at_server_register(em->server, "H", hook_control_cb, em, 
NULL);
+   } else {
+   if (em->type == OFONO_EMULATOR_TYPE_HFP)
+   g_at_server_set_echo(em->server, FALSE);
+   }
 }
 
 static void emulator_remove(struct ofono_atom *atom)
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 08/18] gathdlc: add g_at_resume_hdlc() prototype.

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gathdlc.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/gatchat/gathdlc.h b/gatchat/gathdlc.h
index 158f27f..9719816 100644
--- a/gatchat/gathdlc.h
+++ b/gatchat/gathdlc.h
@@ -60,6 +60,8 @@ void g_at_hdlc_set_no_carrier_detect(GAtHDLC *hdlc, gboolean 
detect);
 void g_at_hdlc_set_suspend_function(GAtHDLC *hdlc, GAtSuspendFunc func,
gpointer user_data);
 
+void g_at_hdlc_resume(GAtHDLC *hdlc);
+
 #ifdef __cplusplus
 }
 #endif
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 06/18] emulator: add ppp_suspend() CB and register it

2011-03-25 Thread Guillaume Zajac
---
 src/emulator.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/emulator.c b/src/emulator.c
index c84f0a9..c1ceb36 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -99,6 +99,15 @@ static void ppp_disconnect(GAtPPPDisconnectReason reason, 
gpointer user_data)
g_at_server_resume(em->server);
 }
 
+static void ppp_suspend(gpointer user_data)
+{
+   struct ofono_emulator *em = user_data;
+
+   DBG("");
+
+   g_at_server_resume(em->server);
+}
+
 static gboolean setup_ppp(gpointer user_data)
 {
struct ofono_emulator *em = user_data;
@@ -126,6 +135,7 @@ static gboolean setup_ppp(gpointer user_data)
 
g_at_ppp_set_connect_function(em->ppp, ppp_connect, em);
g_at_ppp_set_disconnect_function(em->ppp, ppp_disconnect, em);
+   g_at_ppp_set_suspend_function(em->ppp, ppp_suspend, em);
 
return FALSE;
 }
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 05/18] gatppp: add g_at_ppp_set_suspend_function() definition

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gatppp.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
index 993b5ea..9df6b8e 100644
--- a/gatchat/gatppp.c
+++ b/gatchat/gatppp.c
@@ -467,6 +467,14 @@ void g_at_ppp_set_debug(GAtPPP *ppp, GAtDebugFunc func, 
gpointer user_data)
ppp->debug_data = user_data;
 }
 
+void g_at_ppp_set_suspend_function(GAtPPP *ppp, GAtSuspendFunc func, gpointer 
user_data)
+{
+   if (ppp == NULL)
+   return;
+
+   g_at_hdlc_set_suspend_function(ppp->hdlc, func, user_data);
+}
+
 void g_at_ppp_shutdown(GAtPPP *ppp)
 {
if (ppp->phase == PPP_PHASE_DEAD || ppp->phase == PPP_PHASE_TERMINATION)
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 04/18] gatppp: add g_at_ppp_set_suspend_function() prototype

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gatppp.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/gatchat/gatppp.h b/gatchat/gatppp.h
index fb5de4c..7835d1f 100644
--- a/gatchat/gatppp.h
+++ b/gatchat/gatppp.h
@@ -61,6 +61,8 @@ void g_at_ppp_set_connect_function(GAtPPP *ppp, 
GAtPPPConnectFunc callback,
 void g_at_ppp_set_disconnect_function(GAtPPP *ppp, GAtPPPDisconnectFunc func,
gpointer user_data);
 void g_at_ppp_set_debug(GAtPPP *ppp, GAtDebugFunc func, gpointer user_data);
+void g_at_ppp_set_suspend_function(GAtPPP *ppp, GAtSuspendFunc func,
+   gpointer user_data);
 void g_at_ppp_shutdown(GAtPPP *ppp);
 void g_at_ppp_ref(GAtPPP *ppp);
 void g_at_ppp_unref(GAtPPP *ppp);
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 02/18] gathdlc: add g_at_hdlc_set_suspend_function() prototype

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gathdlc.h |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/gatchat/gathdlc.h b/gatchat/gathdlc.h
index 95c389e..158f27f 100644
--- a/gatchat/gathdlc.h
+++ b/gatchat/gathdlc.h
@@ -57,6 +57,9 @@ GAtIO *g_at_hdlc_get_io(GAtHDLC *hdlc);
 
 void g_at_hdlc_set_no_carrier_detect(GAtHDLC *hdlc, gboolean detect);
 
+void g_at_hdlc_set_suspend_function(GAtHDLC *hdlc, GAtSuspendFunc func,
+   gpointer user_data);
+
 #ifdef __cplusplus
 }
 #endif
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 03/18] gathdlc: add mechansim to detect '+++' escape sequence

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gathdlc.c |  114 +
 1 files changed, 114 insertions(+), 0 deletions(-)

diff --git a/gatchat/gathdlc.c b/gatchat/gathdlc.c
index 7c45454..21e4533 100644
--- a/gatchat/gathdlc.c
+++ b/gatchat/gathdlc.c
@@ -50,6 +50,13 @@
 
 #define HDLC_FCS(fcs, c) crc_ccitt_byte(fcs, c)
 
+/* Amount of fiftieths of second to detect '+++'.
+ * Range is 0 to 0xff.
+ */
+#define ESC_TIME   0x32
+
+#define GUARD_TIMEOUTS 1000/* Pause time before and after '+++' sequence */
+
 struct _GAtHDLC {
gint ref_count;
GAtIO *io;
@@ -68,6 +75,12 @@ struct _GAtHDLC {
gboolean in_read_handler;
gboolean destroyed;
gboolean no_carrier_detect;
+   GAtSuspendFunc suspend_func;
+   gpointer suspend_data;
+   guint cmpt;
+   guint suspend_timeout;
+   guint pause_timeout;
+   gboolean paused;
 };
 
 static void hdlc_record(int fd, gboolean in, guint8 *data, guint16 length)
@@ -130,6 +143,47 @@ guint32 g_at_hdlc_get_recv_accm(GAtHDLC *hdlc)
return hdlc->recv_accm;
 }
 
+void g_at_hdlc_set_suspend_function(GAtHDLC *hdlc, GAtSuspendFunc func,
+   gpointer user_data)
+{
+   if (hdlc == NULL)
+   return;
+
+   hdlc->suspend_func = func;
+   hdlc->suspend_data = user_data;
+}
+
+static gboolean paused_timeout_cb(gpointer user_data)
+{
+   GAtHDLC *hdlc = user_data;
+
+   hdlc->paused = TRUE;
+
+   return FALSE;
+}
+
+static gboolean susp_timeout_cb(gpointer user_data)
+{
+   GAtHDLC *hdlc = user_data;
+
+   hdlc->cmpt = 0;
+
+   return FALSE;
+}
+
+static gboolean hdlc_suspend(gpointer user_data)
+{
+   GAtHDLC *hdlc = user_data;
+
+   g_at_io_set_write_handler(hdlc->io, NULL, NULL);
+   g_at_io_set_read_handler(hdlc->io, NULL, NULL);
+
+   if (hdlc->suspend_func)
+   hdlc->suspend_func(hdlc->suspend_data);
+
+   return FALSE;
+}
+
 static void new_bytes(struct ring_buffer *rbuf, gpointer user_data)
 {
GAtHDLC *hdlc = user_data;
@@ -142,6 +196,13 @@ static void new_bytes(struct ring_buffer *rbuf, gpointer 
user_data)
 
hdlc->in_read_handler = TRUE;
 
+   /*
+* We delete the the paused_timeout_cb or hdlc_suspend as soons as
+* we read a data.
+*/
+   if (hdlc->pause_timeout > 0)
+   g_source_remove(hdlc->pause_timeout);
+
while (pos < len) {
/*
 * We try to detect NO CARRIER conditions here.  We
@@ -153,6 +214,21 @@ static void new_bytes(struct ring_buffer *rbuf, gpointer 
user_data)
hdlc->decode_offset == 0 && *buf == '\r')
break;
 
+   /*
+* If there was no character for 1 second we try to detect
+* the '+' character to suspend data call if 3 '+' are
+* detected in less than 20 * ESC_TIME milliseconds.
+*/
+   if (*buf == '+' && hdlc->paused) {
+   if (hdlc->cmpt == 0)
+   hdlc->suspend_timeout = g_timeout_add (20 * 
ESC_TIME,
+   susp_timeout_cb, hdlc);
+   hdlc->cmpt++;
+   } else {
+   hdlc->cmpt = 0;
+   hdlc->paused = FALSE;
+   }
+
if (hdlc->decode_escape == TRUE) {
unsigned char val = *buf ^ HDLC_TRANS;
 
@@ -190,6 +266,9 @@ static void new_bytes(struct ring_buffer *rbuf, gpointer 
user_data)
}
}
 
+   if (hdlc->cmpt == 3)
+   goto suspend;
+
 out:
ring_buffer_drain(rbuf, pos);
 
@@ -197,6 +276,37 @@ out:
 
if (hdlc->destroyed)
g_free(hdlc);
+
+   /*
+* If there were no data pause for GUARD_TIMEOUTS ms,
+* we try again to check it.
+*/
+   if (!hdlc->paused)
+   hdlc->pause_timeout = g_timeout_add (GUARD_TIMEOUTS,
+   paused_timeout_cb,
+   hdlc);
+
+   return;
+
+suspend:
+   /*
+* If the suspend timeout still exists,
+* delete it.
+*/
+   if (hdlc->suspend_timeout > 0)
+   g_source_remove(hdlc->suspend_timeout);
+
+   /*
+* Restart the counter and reset the ring buffer.
+*/
+   hdlc->cmpt = 0;
+   ring_buffer_reset(rbuf);
+
+   /*
+* Wait for another pause of GUARD_TIMEOUTS ms before returning to 
command mode.
+*/
+   hdlc->paused = FALSE;
+   hdlc->pause_timeout = g_timeout_add (GUARD_TIMEOUTS, hdlc_suspend, 
hdlc);
 }
 
 GAtHDLC *g_at_hdlc_new_from_io(GAtIO *io)
@@ -245,6 +355,10 @@ GAtHDLC *g_at_hdlc_new_from_io(GAtIO *io)
hdlc->io = g_at_io_ref(io);
g_at_io_set_read_handl

[PATCH 01/18] gat: add GAtSuspendFunc CB typedef

2011-03-25 Thread Guillaume Zajac
---
 gatchat/gat.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gatchat/gat.h b/gatchat/gat.h
index ddf8695..f067389 100644
--- a/gatchat/gat.h
+++ b/gatchat/gat.h
@@ -32,6 +32,7 @@ typedef void (*GAtDisconnectFunc)(gpointer user_data);
 typedef void (*GAtReceiveFunc)(const unsigned char *data, gsize size,
gpointer user_data);
 typedef void (*GAtDebugFunc)(const char *str, gpointer user_data);
+typedef void (*GAtSuspendFunc)(gpointer user_data);
 
 #ifdef __cplusplus
 }
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH v3 00/18] Send and detect Escape Sequence implementation

2011-03-25 Thread Guillaume Zajac
Patch 1 to 6:
Implement the "+++" escape sequence detection with guard timeouts.

Patch 7:
Implement the Hook Control Callback into emulator.

Patch 8 to 12:
Implement the return to Online Data State Callback into emulator.
Implement gatppp and gathdlc new APIs to resume PPP server.

Patch 13 to 16:
Implement gatppp and gathdlc new APIs to control PPP client with gsmdial.

Patch 17 and 18 are adding a new option into gsmdial to send an escape sequence 
whether a PPP conection is established.
The "+++" sequence can't be written using GAtChat because it is adding and '\r' 
character at the end of the string.

I have used the write_done GAtIO CB to detect when a PPP packet is written to 
suspend PPP client and write "+++" on GAtIO.
The GUARD_TIMEOUTS value defined into gsmdial is ruling the timing to do:
+++ --> ATO0 --> +++ --> ATH0

If you want to send an escape sequence you have to use gsmdial in this way:

sudo ./gsmdial -i your_inet_addr -p 12346 -b -e

Guillaume Zajac (18):
  gat: add GAtSuspendFunc CB typedef
  gathdlc: add g_at_hdlc_set_suspend_function() prototype
  gathdlc: add mechansim to detect '+++' escape sequence
  gatppp: add g_at_ppp_set_suspend_function() prototype
  gatppp: add g_at_ppp_set_suspend_function() definition
  emulator: add ppp_suspend() CB and register it
  emulator: add AT hook_control_cb() and register it
  gathdlc: add g_at_resume_hdlc() prototype.
  gathdlc: add g_at_hdlc_resume() definition.
  gatppp: add g_at_ppp_resume() prototype
  gatppp: add g_at_ppp_resume() definition.
  emulator: add AT online_data_state_cb() and register it
  gathdlc: add prototype to suspend gathdlc externally
  gathdlc: add g_at_hdlc_suspend() definition
  gatppp: add prototype to suspend ppp server externally
  gatppp: add g_at_ppp_suspend() definition
  gsmdial: add new option to test sending escape sequence
  gsmdial: implement mechanism to send +++ -> ATO0 -> +++ -> ATH0

 gatchat/gat.h |1 +
 gatchat/gathdlc.c |  152 
 gatchat/gathdlc.h |7 ++
 gatchat/gatppp.c  |   32 ++
 gatchat/gatppp.h  |5 ++
 gatchat/gsmdial.c |  167 
 src/emulator.c|  100 +++-
 7 files changed, 435 insertions(+), 29 deletions(-)

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 2/2] ifxmodem: add support for emergency number list

2011-03-25 Thread Jeevaka Badrappan
---
 drivers/ifxmodem/voicecall.c |   98 ++
 1 files changed, 98 insertions(+), 0 deletions(-)

diff --git a/drivers/ifxmodem/voicecall.c b/drivers/ifxmodem/voicecall.c
index 87a48e6..a92ac11 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;
+   GSList *en_list;
 };
 
 struct release_id_req {
@@ -786,6 +788,95 @@ static void xcolp_notify(GAtResult *result, gpointer 
user_data)
ofono_voicecall_notify(vc, call);
 }
 
+static gint number_compare(gconstpointer a, gconstpointer b)
+{
+   const char *s1 = a, *s2 = b;
+   return strcmp(s1, s2);
+}
+
+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;
+
+   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, EN valid with simpresence and mcc fields
+
+   if (!g_slist_find_custom(vd->en_list, number, number_compare))
+   vd->en_list = g_slist_prepend(vd->en_list, g_strdup(number));
+
+   if (index != total_cnt)
+   return;
+
+   vd->en_list = g_slist_reverse(vd->en_list);
+
+   ofono_voicecall_en_list_notify(vc, vd->en_list);
+
+   g_slist_foreach(vd->en_list, (GFunc) g_free, NULL);
+   g_slist_free(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 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:")) {
+   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, EN valid with simpresence and mcc fields
+   g_at_result_iter_skip_next(&iter);
+   g_at_result_iter_skip_next(&iter);
+   g_at_result_iter_skip_next(&iter);
+
+   if (!g_slist_find_custom(vd->en_list, number, number_compare))
+   vd->en_list = g_slist_prepend(vd->en_list,
+   g_strdup(number));
+   }
+
+   vd->en_list = g_slist_reverse(vd->en_list);
+
+   ofono_voicecall_en_list_notify(vc, vd->en_list);
+
+   g_slist_foreach(vd->en_list, (GFunc) g_free, NULL);
+   g_slist_free(vd->en_list);
+   vd->en_list = NULL;
+}
+
 static void ifx_voicecall_initialized(gboolean ok, GAtResult *result,
gpointer user_data)
 {
@@ -803,7 +894,14 @@ static void ifx_voicecall_initialized(gboolean ok, 
GAtResult *result,
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", none_prefix, NULL, NULL, NULL);
+
ofono_voicecall_register(vc);
+
+   g_at_chat_send(vd->chat, "AT+XLEMA?", xlema_prefix, xlema_read, vc,
+   NULL);
 }
 
 static int ifx_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
-- 
1.7.0.4

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 1/2] voicecall: add ofono_voicecall_en_list_notify api

2011-03-25 Thread Jeevaka Badrappan
---
 include/voicecall.h |3 +++
 src/voicecall.c |   12 
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/include/voicecall.h b/include/voicecall.h
index f00eb08..3710646 100644
--- a/include/voicecall.h
+++ b/include/voicecall.h
@@ -140,6 +140,9 @@ struct ofono_voicecall_driver {
ofono_voicecall_cb_t cb, void *data);
 };
 
+void ofono_voicecall_en_list_notify(struct ofono_voicecall *vc,
+   GSList *nw_en_list);
+
 void ofono_voicecall_notify(struct ofono_voicecall *vc,
const struct ofono_call *call);
 void ofono_voicecall_disconnected(struct ofono_voicecall *vc, int id,
diff --git a/src/voicecall.c b/src/voicecall.c
index d6e8539..74fe910 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -2150,6 +2150,18 @@ check:
set_new_ecc(vc);
 }
 
+void ofono_voicecall_en_list_notify(struct ofono_voicecall *vc,
+   GSList *new_en_list)
+{
+   GSList *l;
+
+   for (l = new_en_list; l; l = l->next)
+   vc->new_en_list = g_slist_prepend(vc->new_en_list,
+   g_strdup(l->data));
+
+   set_new_ecc(vc);
+}
+
 int ofono_voicecall_driver_register(const struct ofono_voicecall_driver *d)
 {
DBG("driver: %p, name: %s", d, d->name);
-- 
1.7.0.4

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 0/2] Add support for emergency number list from modem

2011-03-25 Thread Jeevaka Badrappan
Hi,

 Following set of patch adds the emergency number list update from
the modem. Upon emergency number list update from modem, ofono
core will be updated which will result in dbus property change signal
as well. With this patch, even if the emergency number list maintained
in ofono matches with the received emergency number list from modem,
dbus property change will be signalled. If this should be avoided,
then it needs to be decided whether the check should be added in core
or for each modem.

Regards,
Jeevaka

Jeevaka Badrappan (2):
  voicecall: add ofono_voicecall_en_list_notify api
  ifxmodem: add support for emergency number list

 drivers/ifxmodem/voicecall.c |   98 ++
 include/voicecall.h  |3 +
 src/voicecall.c  |   12 +
 3 files changed, 113 insertions(+), 0 deletions(-)

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH 0/1] isimodem: fix network registration for older modems

2011-03-25 Thread claudio Degioanni
On Thu, 2011-03-24 at 14:14 +0200, Mika Liljeberg wrote:
> Hi,
> 
> Here's a patch to fix network registration with older ISI modems.
> Verified with N95.
> 
> Claudio, could you give this a spin and let me know if this fixes
> the problem for your 6760?

Hi Mika,

Thanks very much for the patch :

I have tested the path of isi modem on nokia n95 and nokia 6760, 
and I report the result of my test

1) Using nokia N95 and ofono 
* I have attached the phone to my computer 
* I have used the ./online-modem 
* I have set apn/username/password and activate the context

It works (log onlineUsingOfonoTest file attached to mail)

2) Using nokia N95 and ofono/connma
* I have attached the phone to my computer
* Start connman and I have checked it set OnLine the modem correctly 
* I have set apn/username/password and activate the context
* Using connect of connman, but i receive the message   
org.ofono.Error.NotAttached GPRS is not attached

I reports the log onlineUsingConnmanTest, can be a problem of connman ? 

1) Using nokia 6760 and ofono

* I have attached the phone to my computer 
* I have used the ./online-modem 
* I have set apn/username/password and activate the context

It not works, (log in nokia6760 file attached to mail)

Any suggestion ? 

is it possible to know the list of supported mobile phone as 3g modem ?

regs

> Br,
> 
>   MikaL
> 
> [PATCH 1/1] isimodem: fix network registration for older modems
> 
>  drivers/isimodem/network-registration.c |   10 --
>  1 files changed, 8 insertions(+), 2 deletions(-)

ofonod[8881]: plugins/isiusb.c:isiusb_online() (0x9129fa8) with usbpn0
ofonod[8881]: PN_MTC (0x15): MTC_STATE_REQ [id=0x01 utid=0x03 len=4]:
ofonod[8881]: * 03 01 01 00 : .
ofonod[8881]: PN_MTC (0x15): MTC_STATE_RESP [id=0x64 utid=0x03 len=4]:
ofonod[8881]: * 03 64 06 00 : ..d..
ofonod[8881]: gisi: Success RESP to 0x9118ae0 [res=0x15, id=0x64, utid=0x03]
ofonod[8881]: plugins/isiusb.c:mtc_state_cb() MTC cause: MTC_ALREADY_ACTIVE 
(0x06)
ofonod[8881]: src/modem.c:modem_change_state() old state: 2, new state: 3
ofonod[8881]: plugins/isiusb.c:isiusb_post_online() (0x9129fa8) with usbpn0
ofonod[8881]: gisi: Ping sent COMMON (0x910edb0) [res=0x0A]
ofonod[8881]: gisi: Ping sent COMMON (0x9118168) [res=0xC8]
ofonod[8881]: gisi: Ping sent COMMON (0x9127870) [res=0x02]
ofonod[8881]: PN_SMS (0x02): SMS_GSM_CB_ROUTING_REQ [id=0x0B utid=0x02 len=11]:
ofonod[8881]: * 02 0B 01 0B 01 00 00 00 00 00 00: 

ofonod[8881]: gisi: Ping sent COMMON (0x9127e88) [res=0x31]
ofonod[8881]: gisi: Success COMMON to 0x9127ab0 [res=0x06, id=0x00, utid=0x00]
ofonod[8881]: drivers/isimodem/ussd.c:ussd_reachable_cb() QSO: PN_SS [0x06] 
v009.000
ofonod[8881]: gisi: Subscribed for IND (0x9118ae0) [res=0x06, id=0x06]
ofonod[8881]: gisi: Success COMMON to 0x9127bb8 [res=0x06, id=0x00, utid=0x00]
ofonod[8881]: drivers/isimodem/call-settings.c:reachable_cb() QSO: PN_SS [0x06] 
v009.000
ofonod[8881]: gisi: Success COMMON to 0x9127cd0 [res=0x06, id=0x00, utid=0x00]
ofonod[8881]: drivers/isimodem/call-barring.c:reachable_cb() QSO: PN_SS [0x06] 
v009.000
ofonod[8881]: drivers/isimodem/sim.c:isi_read_file_info() Fileid 6FCA not 
implemented
ofonod[8881]: Unable to read waiting messages numbers from SIM
ofonod[8881]: PN_NETWORK (0x0A): NET_COMMON_MESSAGE [id=0xF0 utid=0x01 len=8]:
ofonod[8881]: * 01 F0 13 09 04 00 00 00 : .
ofonod[8881]: gisi: Success COMMON to 0x910edb0 [res=0x0A, id=0xF0, utid=0x01]
ofonod[8881]: drivers/isimodem/network-registration.c:reachable_cb() QSO: 
PN_NETWORK [0x0A] v009.004
ofonod[8881]: gisi: Subscribed for IND (0x9127cd0) [res=0x0A, id=0x1E]
ofonod[8881]: gisi: Subscribed for IND (0x9127cf8) [res=0x0A, id=0x43]
ofonod[8881]: gisi: Subscribed for IND (0x9127d20) [res=0x0A, id=0x35]
ofonod[8881]: gisi: Subscribed for IND (0x91281d0) [res=0x0A, id=0x27]
ofonod[8881]: gisi: Subscribed for IND (0x91281f8) [res=0x0A, id=0x02]
ofonod[8881]: gisi: Subscribed for IND (0x9128220) [res=0x0A, id=0xE2]
ofonod[8881]: PN_NETWORK (0x0A): NET_RAT_REQ [id=0x36 utid=0x02 len=3]:
ofonod[8881]: * 02 36 00: ..6.
ofonod[8881]: PN_SMS (0x02): SMS_COMMON_MESSAGE [id=0xF0 utid=0x01 len=8]:
ofonod[8881]: * 01 F0 13 04 00 00 00 00 : .
ofonod[8881]: gisi: Success COMMON to 0x9127870 [res=0x02, id=0xF0, utid=0x01]
ofonod[8881]: drivers/isimodem/sms.c:sms_reachable_cb() QSO: PN_SMS [0x02] 
v004.000
ofonod[8881]: PN_GPDS (0x31): GPSD_ [id=0xF0 utid=0x01 len=8]:
ofonod[8881]: * 01 F0 13 11 04 55 55 55 : ..UUU
ofonod[8881]: gisi: Success COMMON to 0x9127e88 [res=0x31, id=0xF0, utid=0x01]
ofonod[8881]: drivers/isimodem/gprs.c:gpds_reachable_cb() QSO: PN_GPDS [0x31] 
v017.004
ofonod[8881]: gisi: Subscribed for IND (0x9128bd8) [res=0x31, id=0x18]
ofonod[

[PATCH v2] gatserver: add v250 ATL and ATM commands

2011-03-25 Thread Olivier Guiter
---
 gatchat/gatserver.c |   18 ++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index 8266ead..35f126f 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -94,6 +94,8 @@ struct v250_settings {
int res_format; /* set by X */
int c109;   /* set by &C */
int c108;   /* set by &D */
+   char l; /* set by L */
+   char m; /* set by M */
 };
 
 /* AT command set that server supported */
@@ -296,6 +298,8 @@ static void v250_settings_create(struct v250_settings *v250)
v250->res_format = 0;
v250->c109 = 1;
v250->c108 = 0;
+   v250->l = 0;
+   v250->m = 1;
 }
 
 static void s_template_cb(GAtServerRequestType type, GAtResult *result,
@@ -360,6 +364,18 @@ static void at_s5_cb(GAtServer *server, 
GAtServerRequestType type,
s_template_cb(type, result, server, &server->v250.s5, "S5", 0, 127);
 }
 
+static void at_l_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+   s_template_cb(type, result, server, &server->v250.l, "L", 0, 3);
+}
+
+static void at_m_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+   s_template_cb(type, result, server, &server->v250.m, "M", 0, 2);
+}
+
 static void at_template_cb(GAtServerRequestType type, GAtResult *result,
GAtServer *server, int *value,
const char *prefix,
@@ -1159,6 +1175,8 @@ static void basic_command_register(GAtServer *server)
g_at_server_register(server, "&D", at_c108_cb, NULL, NULL);
g_at_server_register(server, "Z", at_z_cb, NULL, NULL);
g_at_server_register(server, "&F", at_f_cb, NULL, NULL);
+   g_at_server_register(server, "L", at_l_cb, NULL, NULL);
+   g_at_server_register(server, "M", at_m_cb, NULL, NULL);
 }
 
 GAtServer *g_at_server_new(GIOChannel *io)
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH] gatserver: add v250 ATL and ATM commands

2011-03-25 Thread Olivier Guiter

On 03/24/2011 07:29 PM, Denis Kenzior wrote:

Hi Olivier,


+static void at_l_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+   s_template_cb(type, result, server,&server->v250.s5, "L", 0, 3);

Copy paste error?  I presume you mean v250.l here

Regards,
-Denis

Ops... you re right... sorry
Olivier
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono