Re: Dedug Log for Huawei EC168C

2011-05-04 Thread Olivier Guiter

On 05/04/2011 05:35 PM, rajeshkumar s.a wrote:

PFA, the debug log with AT commands

I am still getting a timeout on enable-modem operation

and list-modem gives following o/p

$ ./list-modems
[ /huawei0 ]
Features =
Emergency = 0
Powered = 0
Lockdown = 0
Interfaces =
Online = 0

Regards,
Rajesh

As far i can see, ofono communicates using the wrong USB interface  
I suggest you to modify the //etc/udev/rules.d/ofono.rules///to use the 
correct one

First, get the idvendor and id product of your key (e.g: lsusb)
Then check in the ofono.rules  a line like this one:
|ATTRS{idVendor}==19d2, 
ATTRS{idProduct}==0121,ENV{OFONO_IFACE_NUM}==04,  
ENV{OFONO_ZTE_TYPE}=modem

|And update the OFONO_IFACE_NUM
These keys publish multiple interfaces with different purposes (like 
modem diag, traces, etc...)

Hope this help
Olivier


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


[PATCH] emulator: add AT+CMEE support for HFP

2011-04-01 Thread Olivier Guiter
---
 src/emulator.c |   59 +++-
 1 files changed, 58 insertions(+), 1 deletions(-)

diff --git a/src/emulator.c b/src/emulator.c
index c84f0a9..24897b4 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -29,6 +29,7 @@
 #include glib.h
 
 #include ofono.h
+#include common.h
 #include gatserver.h
 #include gatppp.h
 
@@ -48,6 +49,7 @@ struct ofono_emulator {
int r_features;
int events_mode;
gboolean events_ind;
+   char cme_error_ind;
GSList *indicators;
 };
 
@@ -387,6 +389,52 @@ fail:
}
 }
 
+static void cmee_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+   struct ofono_emulator *em = user_data;
+   GAtResultIter iter;
+   int val;
+   char buf[16];
+
+   switch (type) {
+   case G_AT_SERVER_REQUEST_TYPE_SET:
+   g_at_result_iter_init(iter, result);
+   g_at_result_iter_next(iter, );
+
+   if (g_at_result_iter_next_number(iter, val) == FALSE)
+   goto fail;
+
+   if ((val  0)  (val  1))
+   goto fail;
+
+   em-cme_error_ind = (char)val;
+
+   sprintf(buf, +CMEE: %d, em-cme_error_ind);
+   g_at_server_send_info(em-server, buf, TRUE);
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+
+   case G_AT_SERVER_REQUEST_TYPE_QUERY:
+   sprintf(buf, +CMEE: %d, em-cme_error_ind);
+   g_at_server_send_info(em-server, buf, TRUE);
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+
+   case G_AT_SERVER_REQUEST_TYPE_SUPPORT:
+   /* HFP only support 0 and 1 */
+   sprintf(buf, +CMEE: (0,1));
+   g_at_server_send_info(em-server, buf, TRUE);
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+
+   default:
+fail:
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+   break;
+   }
+}
+
 static void emulator_add_indicator(struct ofono_emulator *em, const char* name,
int min, int max, int dflt)
 {
@@ -462,6 +510,7 @@ void ofono_emulator_register(struct ofono_emulator *em, int 
fd)
g_at_server_register(em-server, +BRSF, brsf_cb, em, NULL);
g_at_server_register(em-server, +CIND, cind_cb, em, NULL);
g_at_server_register(em-server, +CMER, cmer_cb, em, NULL);
+   g_at_server_register(em-server, +CMEE, cmee_cb, em, NULL);
}
 
__ofono_atom_register(em-atom, emulator_unregister);
@@ -505,6 +554,7 @@ struct ofono_emulator *ofono_emulator_create(struct 
ofono_modem *modem,
/* TODO: Check real local features */
em-l_features = 32;
em-events_mode = 3;/* default mode is forwarding events */
+   em-cme_error_ind = 0;  /* numeric only */
 
em-atom = __ofono_modem_add_atom_offline(modem, atom_t,
emulator_remove, em);
@@ -533,7 +583,14 @@ void ofono_emulator_send_final(struct ofono_emulator *em,
break;
 
case OFONO_ERROR_TYPE_CME:
-   sprintf(buf, +CME ERROR: %d, final-error);
+   /* default string */
+   sprintf(buf, ERROR);
+
+   if (em-cme_error_ind == 1)
+   sprintf(buf, +CME ERROR: %d, final-error);
+   else if (em-cme_error_ind == 2)
+   sprintf(buf, +CME ERROR: %s, 
telephony_error_to_str(final));
+
g_at_server_send_ext_final(em-server, buf);
break;
 
-- 
1.7.1

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


[PATCH] gnss: fix build broken

2011-03-29 Thread Olivier Guiter
---
 drivers/atmodem/gnss.c |1 -
 plugins/phonesim.c |1 +
 2 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/atmodem/gnss.c b/drivers/atmodem/gnss.c
index 4954bb8..e102815 100644
--- a/drivers/atmodem/gnss.c
+++ b/drivers/atmodem/gnss.c
@@ -153,7 +153,6 @@ static gboolean gnss_parse_report(GAtResult *result, const 
char *prefix,
 
 static void gnss_report(GAtResult *result, gpointer user_data)
 {
-   struct ofono_gnss *gnss = user_data;
const char *xml;
 
DBG();
diff --git a/plugins/phonesim.c b/plugins/phonesim.c
index 6bb5977..1a6703d 100644
--- a/plugins/phonesim.c
+++ b/plugins/phonesim.c
@@ -58,6 +58,7 @@
 #include ofono/voicecall.h
 #include ofono/gprs.h
 #include ofono/gprs-context.h
+#include ofono/gnss.h
 
 #include drivers/atmodem/vendor.h
 #include drivers/atmodem/sim-poll.h
-- 
1.7.1

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


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

2011-03-28 Thread Olivier Guiter

On 03/25/2011 06:36 PM, Denis Kenzior wrote:

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...

snip


+   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;

snip

Regards,
-Denis
It should be ;) but i tried to keep the answer format consistent with 
other AT command answers... Maybe i m wrong ?

Olivier


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


[PATCH] gatserver: add tone and pulse dialing AT commands

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

diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index 35f126f..3a996cb 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -96,6 +96,7 @@ struct v250_settings {
int c108;   /* set by Dval */
char l; /* set by Lval */
char m; /* set by Mval */
+   char dial_mode; /* set by P or T */
 };
 
 /* AT command set that server supported */
@@ -300,6 +301,7 @@ static void v250_settings_create(struct v250_settings *v250)
v250-c108 = 0;
v250-l = 0;
v250-m = 1;
+   v250-dial_mode = 'T';
 }
 
 static void s_template_cb(GAtServerRequestType type, GAtResult *result,
@@ -481,6 +483,40 @@ static void at_c108_cb(GAtServer *server, 
GAtServerRequestType type,
at_template_cb(type, result, server, server-v250.c108, D, 0, 2, 2);
 }
 
+/* According to ITU V.250 6.3.2 and 6.3.3: Implementation of this command
+ * is mandatory; however, if DTMF or pulse dialling is not implemented,
+ * this command will have no effect
+ */
+static void at_t_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+   switch (type) {
+   case G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY:
+   server-v250.dial_mode = 'T';
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+
+   default:
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+   break;
+   }
+}
+
+static void at_p_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+   switch (type) {
+   case G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY:
+   server-v250.dial_mode = 'P';
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+
+   default:
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+   break;
+   }
+}
+
 static void at_f_cb(GAtServer *server, GAtServerRequestType type,
GAtResult *result, gpointer user_data)
 {
@@ -1177,6 +1213,8 @@ static void basic_command_register(GAtServer *server)
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);
+   g_at_server_register(server, T, at_t_cb, NULL, NULL);
+   g_at_server_register(server, P, at_p_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


[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 Xval */
int c109;   /* set by Cval */
int c108;   /* set by Dval */
+   char l; /* set by Lval */
+   char m; /* set by Mval */
 };
 
 /* 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


[PATCH] gatserver: add ATF command

2011-03-24 Thread Olivier Guiter
---
 gatchat/gatserver.c |   29 +++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index 57cc58e..8266ead 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -274,7 +274,8 @@ static gboolean get_result_value(GAtServer *server, 
GAtResult *result,
if (val  min || val  max)
return FALSE;
 
-   *value = val;
+   if (value)
+   *value = val;
 
return TRUE;
 }
@@ -464,10 +465,33 @@ static void at_c108_cb(GAtServer *server, 
GAtServerRequestType type,
at_template_cb(type, result, server, server-v250.c108, D, 0, 2, 2);
 }
 
-static void at_z_cb(GAtServer *server, GAtServerRequestType type,
+static void at_f_cb(GAtServer *server, GAtServerRequestType type,
GAtResult *result, gpointer user_data)
 {
+   switch (type) {
+   case G_AT_SERVER_REQUEST_TYPE_SET:
+   if (!get_result_value(server, result, 0, 0, NULL)) {
+   g_at_server_send_final(server,
+   G_AT_SERVER_RESULT_ERROR);
+   return;
+   }
+   /* intentional fallback here */
 
+   case G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY:
+   /* default behavior on ATF same as ATZ */
+   v250_settings_create(server-v250);
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+
+   default:
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+   break;
+   }
+}
+
+static void at_z_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
switch (type) {
case G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY:
v250_settings_create(server-v250);
@@ -1134,6 +1158,7 @@ static void basic_command_register(GAtServer *server)
g_at_server_register(server, C, at_c109_cb, NULL, NULL);
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);
 }
 
 GAtServer *g_at_server_new(GIOChannel *io)
-- 
1.7.1

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


[PATCH] gatserver: add v250 ATL and ATM commands

2011-03-24 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..0381723 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -94,6 +94,8 @@ struct v250_settings {
int res_format; /* set by Xval */
int c109;   /* set by Cval */
int c108;   /* set by Dval */
+   char l; /* set by Lval */
+   char m; /* set by Mval */
 };
 
 /* 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.s5, 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


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

2011-03-24 Thread Olivier Guiter
---
 src/emulator.c |   57 +++-
 1 files changed, 56 insertions(+), 1 deletions(-)

diff --git a/src/emulator.c b/src/emulator.c
index c84f0a9..101d6b8 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -177,6 +177,59 @@ error:
g_at_server_send_final(em-server, G_AT_SERVER_RESULT_ERROR);
 }
 
+static gboolean get_result_value(GAtServer *server, GAtResult *result,
+   int min, int max, int *value)
+{
+   GAtResultIter iter;
+   int val;
+
+   g_at_result_iter_init(iter, result);
+
+   if (!g_at_result_iter_next(iter, ))
+   return FALSE;
+
+   if (!g_at_result_iter_next_number(iter, val))
+   return FALSE;
+
+   if (val  min || val  max)
+   return FALSE;
+
+   if (value != NULL)
+   *value = val;
+
+   return TRUE;
+}
+
+static void at_x_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+   switch (type) {
+   case G_AT_SERVER_REQUEST_TYPE_SET:
+   if (!get_result_value(server, result, 0, 0, NULL)) {
+   g_at_server_send_final(server,
+   G_AT_SERVER_RESULT_ERROR);
+   return;
+   }
+   /* the value is not stored, as there's only one choice */
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+
+   case G_AT_SERVER_REQUEST_TYPE_QUERY:
+   g_at_server_send_info(server, 000, TRUE);
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+
+   case G_AT_SERVER_REQUEST_TYPE_SUPPORT:
+   g_at_server_send_info(server, X: (0-0), TRUE);
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+
+   default:
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+   break;
+   }
+}
+
 static void brsf_cb(GAtServer *server, GAtServerRequestType type,
GAtResult *result, gpointer user_data)
 {
@@ -466,8 +519,10 @@ 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);
+   g_at_server_register(em-server, X, at_x_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] modem: add AT+GCAP command

2011-03-23 Thread Olivier Guiter
---
 src/modem.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/modem.c b/src/modem.c
index 26468e8..655994b 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -1386,6 +1386,12 @@ static void gmr_cb(struct ofono_emulator *em,
attr_template(em, req, info-revision);
 }
 
+static void gcap_cb(struct ofono_emulator *em,
+   struct ofono_emulator_request *req, void *userdata)
+{
+   attr_template(em, req, +GCAP: +CGSM);
+}
+
 static void dun_watch(struct ofono_atom *atom,
enum ofono_atom_watch_condition cond, void *data)
 {
@@ -1397,6 +1403,7 @@ static void dun_watch(struct ofono_atom *atom,
ofono_emulator_add_handler(em, +GMI, gmi_cb, data, NULL);
ofono_emulator_add_handler(em, +GMM, gmm_cb, data, NULL);
ofono_emulator_add_handler(em, +GMR, gmr_cb, data, NULL);
+   ofono_emulator_add_handler(em, +GCAP, gcap_cb, data, NULL);
 }
 
 int ofono_devinfo_driver_register(const struct ofono_devinfo_driver *d)
-- 
1.7.1

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


[PATCH] gatserver: add ATZ command

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

diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index 4a211ad..57cc58e 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -279,6 +279,24 @@ static gboolean get_result_value(GAtServer *server, 
GAtResult *result,
return TRUE;
 }
 
+static void v250_settings_create(struct v250_settings *v250)
+{
+   v250-s0 = 0;
+   v250-s3 = '\r';
+   v250-s4 = '\n';
+   v250-s5 = '\b';
+   v250-s6 = 2;
+   v250-s7 = 50;
+   v250-s8 = 2;
+   v250-s10 = 2;
+   v250-echo = TRUE;
+   v250-quiet = FALSE;
+   v250-is_v1 = TRUE;
+   v250-res_format = 0;
+   v250-c109 = 1;
+   v250-c108 = 0;
+}
+
 static void s_template_cb(GAtServerRequestType type, GAtResult *result,
GAtServer *server, char *sreg,
const char *prefix, int min, int max)
@@ -446,6 +464,22 @@ static void at_c108_cb(GAtServer *server, 
GAtServerRequestType type,
at_template_cb(type, result, server, server-v250.c108, D, 0, 2, 2);
 }
 
+static void at_z_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+
+   switch (type) {
+   case G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY:
+   v250_settings_create(server-v250);
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+
+   default:
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+   break;
+   }
+}
+
 static inline gboolean is_extended_command_prefix(const char c)
 {
switch (c) {
@@ -1073,24 +1107,6 @@ static void server_resume(GAtServer *server)
g_at_io_set_read_handler(server-io, new_bytes, server);
 }
 
-static void v250_settings_create(struct v250_settings *v250)
-{
-   v250-s0 = 0;
-   v250-s3 = '\r';
-   v250-s4 = '\n';
-   v250-s5 = '\b';
-   v250-s6 = 2;
-   v250-s7 = 50;
-   v250-s8 = 2;
-   v250-s10 = 2;
-   v250-echo = TRUE;
-   v250-quiet = FALSE;
-   v250-is_v1 = TRUE;
-   v250-res_format = 0;
-   v250-c109 = 1;
-   v250-c108 = 0;
-}
-
 static void at_notify_node_destroy(gpointer data)
 {
struct at_command *node = data;
@@ -1117,6 +1133,7 @@ static void basic_command_register(GAtServer *server)
g_at_server_register(server, S10, at_s10_cb, NULL, NULL);
g_at_server_register(server, C, at_c109_cb, NULL, NULL);
g_at_server_register(server, D, at_c108_cb, NULL, NULL);
+   g_at_server_register(server, Z, at_z_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


[PATCH 0/3] Emulator CGDCONT

2011-03-21 Thread Olivier Guiter
This first set of patches proposes an partial implementation 
of AT+CGDCONT command (for the AT Emulator), as specified in the 
dialup-command-set.txt doc file. The current code handles only
list parameters and list existing contexts.

Olivier Guiter (3):
  gprs.c: add emulator CGDCONT handler
  idmap.c: add get size function
  gprs.c: add list contexts for emulator

 src/gprs.c  |   86 ++-
 src/idmap.c |5 +++
 src/idmap.h |1 +
 3 files changed, 91 insertions(+), 1 deletions(-)

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


[PATCH 1/3] gprs.c: add emulator CGDCONT handler

2011-03-21 Thread Olivier Guiter
---
 src/gprs.c |   64 +++-
 1 files changed, 63 insertions(+), 1 deletions(-)

diff --git a/src/gprs.c b/src/gprs.c
index 00f6d6d..04432c3 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -90,6 +90,7 @@ struct ofono_gprs {
struct ofono_netreg *netreg;
unsigned int netreg_watch;
unsigned int status_watch;
+   unsigned int dun_watch;
GKeyFile *settings;
char *imsi;
DBusMessage *pending;
@@ -2294,7 +2295,7 @@ struct ofono_modem *ofono_gprs_context_get_modem(struct 
ofono_gprs_context *gc)
 }
 
 void ofono_gprs_context_set_type(struct ofono_gprs_context *gc,
-enum ofono_gprs_context_type type)
+   enum ofono_gprs_context_type type)
 {
DBG(type %d, type);
 
@@ -2862,12 +2863,63 @@ static void provision_contexts(struct ofono_gprs *gprs, 
const char *mcc,
__ofono_gprs_provision_free_settings(settings, count);
 }
 
+/* Process the usual AT+CGDCONT command
+ */
+static void cgdcont_cb(struct ofono_emulator *em,
+   struct ofono_emulator_request *req, void *userdata)
+{
+   struct ofono_error result;
+   char buf[256];
+
+   result.error = 0;
+
+   switch (ofono_emulator_request_get_type(req)) {
+   case OFONO_EMULATOR_REQUEST_TYPE_SUPPORT:
+   /* TODO: check additionnal parameters */
+   snprintf(buf, 255, +CGDCONT: 
(1-2),\IP\,,,(0-2),(0,1,2,3,4));
+   ofono_emulator_send_info(em, buf, FALSE);
+   result.type = OFONO_ERROR_TYPE_NO_ERROR;
+   ofono_emulator_send_final(em, result);
+   break;
+
+   case OFONO_EMULATOR_REQUEST_TYPE_COMMAND_ONLY:
+   result.type = OFONO_ERROR_TYPE_FAILURE;
+   ofono_emulator_send_final(em, result);
+   break;
+
+   case OFONO_EMULATOR_REQUEST_TYPE_QUERY:
+   result.type = OFONO_ERROR_TYPE_FAILURE;
+   ofono_emulator_send_final(em, result);
+   break;
+   case OFONO_EMULATOR_REQUEST_TYPE_SET:
+   result.type = OFONO_ERROR_TYPE_FAILURE;
+   ofono_emulator_send_final(em, result);
+   break;
+   default:
+   result.type = OFONO_ERROR_TYPE_FAILURE;
+   ofono_emulator_send_final(em, result);
+   };
+}
+
+static void gprs_dun_watch(struct ofono_atom *atom,
+   enum ofono_atom_watch_condition cond, void *data)
+{
+   struct ofono_emulator *em = __ofono_atom_get_data(atom);
+
+   if (cond == OFONO_ATOM_WATCH_CONDITION_UNREGISTERED)
+   return;
+
+   ofono_emulator_add_handler(em, +CGDCONT, cgdcont_cb, data, NULL);
+}
+
+
 static void ofono_gprs_finish_register(struct ofono_gprs *gprs)
 {
DBusConnection *conn = ofono_dbus_get_connection();
struct ofono_modem *modem = __ofono_atom_get_modem(gprs-atom);
const char *path = __ofono_atom_get_path(gprs-atom);
struct ofono_atom *netreg_atom;
+   struct ofono_atom *dun_atom;
 
if (gprs-contexts == NULL) /* Automatic provisioning failed */
add_context(gprs, NULL, OFONO_GPRS_CONTEXT_TYPE_INTERNET);
@@ -2896,6 +2948,16 @@ static void ofono_gprs_finish_register(struct ofono_gprs 
*gprs)
netreg_watch(netreg_atom,
OFONO_ATOM_WATCH_CONDITION_REGISTERED, gprs);
 
+   gprs-dun_watch = __ofono_modem_add_atom_watch(modem,
+   OFONO_ATOM_TYPE_EMULATOR_DUN,
+   gprs_dun_watch, gprs, NULL);
+
+   dun_atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_EMULATOR_DUN);
+
+   if (dun_atom  __ofono_atom_get_registered(dun_atom))
+   gprs_dun_watch(dun_atom, OFONO_ATOM_WATCH_CONDITION_REGISTERED,
+   gprs);
+
__ofono_atom_register(gprs-atom, gprs_unregister);
 }
 
-- 
1.7.1

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


[PATCH 3/3] gprs.c: add list contexts for emulator

2011-03-21 Thread Olivier Guiter
---
 src/gprs.c |   26 --
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/gprs.c b/src/gprs.c
index 04432c3..06d52f3 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -2863,11 +2863,31 @@ static void provision_contexts(struct ofono_gprs *gprs, 
const char *mcc,
__ofono_gprs_provision_free_settings(settings, count);
 }
 
+static void ofono_gprs_list_contexts(struct ofono_emulator *em, void *userdata)
+{
+   struct ofono_gprs *gprs = userdata;
+   GSList *l;
+   char buf[256];
+
+   struct pri_context *ctx;
+
+   for (l = gprs-contexts; l; l = l-next) {
+   ctx = l-data;
+
+   snprintf(buf, 255, +CGDCONT: %d,\%s\,\%s\,
+   ctx-id, 
gprs_proto_to_string(ctx-context.proto),
+   ctx-context.apn);
+   ofono_emulator_send_info(em, buf, FALSE);
+   }
+}
+
 /* Process the usual AT+CGDCONT command
  */
 static void cgdcont_cb(struct ofono_emulator *em,
struct ofono_emulator_request *req, void *userdata)
 {
+   struct ofono_gprs *gprs = userdata;
+   struct idmap *cid = gprs-cid_map;
struct ofono_error result;
char buf[256];
 
@@ -2876,7 +2896,8 @@ static void cgdcont_cb(struct ofono_emulator *em,
switch (ofono_emulator_request_get_type(req)) {
case OFONO_EMULATOR_REQUEST_TYPE_SUPPORT:
/* TODO: check additionnal parameters */
-   snprintf(buf, 255, +CGDCONT: 
(1-2),\IP\,,,(0-2),(0,1,2,3,4));
+   snprintf(buf, 255, +CGDCONT: 
(1-%d),\IP\,,,(0-2),(0,1,2,3,4),
+   idmap_get_size(cid));
ofono_emulator_send_info(em, buf, FALSE);
result.type = OFONO_ERROR_TYPE_NO_ERROR;
ofono_emulator_send_final(em, result);
@@ -2888,7 +2909,8 @@ static void cgdcont_cb(struct ofono_emulator *em,
break;
 
case OFONO_EMULATOR_REQUEST_TYPE_QUERY:
-   result.type = OFONO_ERROR_TYPE_FAILURE;
+   ofono_gprs_list_contexts(em, gprs);
+   result.type = OFONO_ERROR_TYPE_NO_ERROR;
ofono_emulator_send_final(em, result);
break;
case OFONO_EMULATOR_REQUEST_TYPE_SET:
-- 
1.7.1

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


[PATCH 2/3] idmap.c: add get size function

2011-03-21 Thread Olivier Guiter
---
 src/idmap.c |5 +
 src/idmap.h |1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/idmap.c b/src/idmap.c
index 6d46e8a..967adbd 100644
--- a/src/idmap.c
+++ b/src/idmap.c
@@ -200,3 +200,8 @@ unsigned int idmap_get_max(struct idmap *idmap)
 {
return idmap-max;
 }
+
+unsigned int idmap_get_size(struct idmap *idmap)
+{
+   return idmap-size;
+}
diff --git a/src/idmap.h b/src/idmap.h
index d6141c2..6fc29fd 100644
--- a/src/idmap.h
+++ b/src/idmap.h
@@ -30,3 +30,4 @@ unsigned int idmap_alloc_next(struct idmap *idmap, unsigned 
int last);
 struct idmap *idmap_new_from_range(unsigned int min, unsigned int max);
 unsigned int idmap_get_min(struct idmap *idmap);
 unsigned int idmap_get_max(struct idmap *idmap);
+unsigned int idmap_get_size(struct idmap *idmap);
-- 
1.7.1

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


[PATCH 01/12] doc: fix typo and incorrect line length

2011-03-18 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |   70 ++-
 1 files changed, 36 insertions(+), 34 deletions(-)

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
index a7a1df3..3e40aae 100644
--- a/doc/dialup-command-set.txt
+++ b/doc/dialup-command-set.txt
@@ -1,45 +1,47 @@
-This document specifies the AT command set used in the bluetooth ofono plugins.
+This document specifies the AT command supported in the AT Emulator and atoms.
 
 Bluetooth Dial-up Networking Profile Features Description
 =
-(Ref. document: Dial-up Networking Profile - Bluetooth specification version 
1.1 - 22 February 2001)
+(Ref. document: Dial-up Networking Profile - Bluetooth specification
+version 1.1- 22 February 2001)
 
-- AT COMMAND SET USED:
+- AT COMMAND set used:
 Commands:
-   C  Circuit 109 (DCD) Control
-   D  Circuit 108 (DTR) Response
-   F  Set to Factory Defined Configuration
-   +GCAP   Request Complete Capabilities List
-   +GMIRequest Manufacturer Identification
-   +GMMRead Model Identification
-   +GMRRead Revision Identification
-   A   Answer Incoming Call
-   D   Dial
-   E   Command Echo
-   H   Hang Up
-   L   Monitor Speaker Loudness
-   M   Monitor Speaker Control
-   O   Return to Online Data Mode
-   P   Select Pulse Dialling
-   Q   Result Code Suppression
-   S0  Automatic Answer Control
-   S10 Automatic Disconnect Delay Control
-   S3  Command Line Termination Character
-   S4  Response Formatting Character
-   S5  Command Line Editing Character (BACKSPACE)
-   S6  Blind Dial Delay Control
-   S7  Connection Completion Timeout
-   S8  Comma Dial Modifier Delay Control
-   T   Select Tone Dialling
-   V   DCE Response Format
-   X   Call Progress Monitoring Control
-   Z   Reset to Default Configuration
+   C  Circuit 109 (DCD) Control
+   D  Circuit 108 (DTR) Response
+   F  Set to Factory Defined Configuration
+   +GCAP   Request Complete Capabilities List
+   +GMIRequest Manufacturer Identification
+   +GMMRead Model Identification
+   +GMRRead Revision Identification
+   A   Answer Incoming Call
+   D   Dial
+   E   Command Echo
+   H   Hang Up
+   L   Monitor Speaker Loudness
+   M   Monitor Speaker Control
+   O   Return to Online Data Mode
+   P   Select Pulse Dialling
+   Q   Result Code Suppression
+   S0  Automatic Answer Control
+   S10 Automatic Disconnect Delay Control
+   S3  Command Line Termination Character
+   S4  Response Formatting Character
+   S5  Command Line Editing Character (BACKSPACE)
+   S6  Blind Dial Delay Control
+   S7  Connection Completion Timeout
+   S8  Comma Dial Modifier Delay Control
+   T   Select Tone Dialling
+   V   DCE Response Format
+   X   Call Progress Monitoring Control
+   Z   Reset to Default Configuration
 Result codes:
OK  Acknowledge execution of a command
CONNECT Connection has been established
-   RINGThe DCE has detected an incoming call signal from 
network
-   NO CARRIER  The connection has been terminated, or attempt to 
establish
-   a connection failed
+   RINGThe DCE has detected an incoming call signal 
+   from network
+   NO CARRIER  The connection has been terminated, or attempt to
+   establish a connection failed
ERROR   Error
NO DIALTONE No dial-tone detected
BUSYBusy signal detected
-- 
1.7.1

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


[PATCH 02/12] doc: Add BT HFP AT commands list

2011-03-18 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |   38 ++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
index 3e40aae..2067dfb 100644
--- a/doc/dialup-command-set.txt
+++ b/doc/dialup-command-set.txt
@@ -45,3 +45,41 @@ Result codes:
ERROR   Error
NO DIALTONE No dial-tone detected
BUSYBusy signal detected
+   
+Bluetooth Hands-Free Profile Description
+=
+(Ref. document: HFP1.5_SPEC (Car Working Group) - version V10r00 - 2005-11-25)
+
+- AT COMMAND set used:
+Commands:
+   D  Extension of the standard ATD command, intended for
+   memory dialing. Only voice calls are covered here
+   +CIND   Standard indicator update AT command.   
+
+   +NREC   Noise Reduction and Echo Canceling  
+   +VGMGain of Microphone  
+   +VGSGain of Speaker
+   +BINP   Bluetooth INPut 
+   +BLDN   Bluetooth Last Dialed Number
+   +BVRA   Bluetooth Voice Recognition Activation
+   +BRSF   Bluetooth Retrieve Supported Features   
+   +BTRH   Bluetooth Response and Hold Feature 
+   +CCWA   
+   +CHLD
+   +CHUP
+   +CLCC
+   +COPS
+   +CMEE
+   +CLIP
+   +CMER
+   +VTS
+   +CNUM   
+   
+Unsolicited result:
+   +CIEV
+   +BSIR   Bluetooth Setting of In-band Ring tone  
+Result codes:
+   NO ANSWER
+   DELAYED
+   BLACKLISTED
+   
\ No newline at end of file
-- 
1.7.1

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


[PATCH 00/12] doc: Add AT commands list to be supported in emulator

2011-03-18 Thread Olivier Guiter
Hi,
These patches only add a list of AT commands that should be added in
the emulator. This list is not only related to bluetooth stuff.

Olivier Guiter (12):
  doc: fix typo and incorrect line length
  doc: Add BT HFP AT commands list
  doc: Add AT command reference mark
  doc: Add AT commands for Call Management
  doc:Add AT commands for GPRS
  doc:Add AT commands for Network support
  doc: AT commands for supplementary services
  doc: AT commands for SMS
  doc: AT commands for device management
  doc: AT commands for SIM
  doc: Add AT command for debugging purpose
  doc: AT commands for Location based services

 doc/dialup-command-set.txt |  228 +---
 1 files changed, 194 insertions(+), 34 deletions(-)

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


[PATCH 03/12] doc: Add AT command reference mark

2011-03-18 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |   29 +++--
 1 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
index 2067dfb..5d7a43d 100644
--- a/doc/dialup-command-set.txt
+++ b/doc/dialup-command-set.txt
@@ -11,9 +11,9 @@ Commands:
D  Circuit 108 (DTR) Response
F  Set to Factory Defined Configuration
+GCAP   Request Complete Capabilities List
-   +GMIRequest Manufacturer Identification
-   +GMMRead Model Identification
-   +GMRRead Revision Identification
+*  +GMIRequest Manufacturer Identification
+*  +GMMRead Model Identification
+*  +GMRRead Revision Identification
A   Answer Incoming Call
D   Dial
E   Command Echo
@@ -64,17 +64,18 @@ Commands:
+BVRA   Bluetooth Voice Recognition Activation
+BRSF   Bluetooth Retrieve Supported Features   
+BTRH   Bluetooth Response and Hold Feature 
-   +CCWA   
-   +CHLD
-   +CHUP
-   +CLCC
-   +COPS
-   +CMEE
-   +CLIP
-   +CMER
-   +VTS
-   +CNUM   
-   
+*  +CCWA   
+*  +CHLD
+*  +CHUP
+*  +CLCC
+*  +COPS
+*  +CMEE
+*  +CLIP
+*  +CMER
+*  +VTS
+*  +CNUM   
+ (*: AT command referenced below)   
+   
 Unsolicited result:
+CIEV
+BSIR   Bluetooth Setting of In-band Ring tone  
-- 
1.7.1

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


[PATCH 04/12] doc: Add AT commands for Call Management

2011-03-18 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
index 5d7a43d..735d626 100644
--- a/doc/dialup-command-set.txt
+++ b/doc/dialup-command-set.txt
@@ -83,4 +83,21 @@ Result codes:
NO ANSWER
DELAYED
BLACKLISTED
+  
+AT commands supported in emulator:
+=
+
+Call management:
+
+   +CBST   Select bearer service type
+   +CHLD   Standard call hold and multiparty handling AT command
+   +CHUP   Hangup call
+   +CMOD   Call mode
+   +CPAS   Phone activity status
+   +CVHU   Voice Hangup Control
+   +CLIP   Calling line identification presentation
+   +CNUM   Subscriber number
+   +VTSDTMF and tone generation
+   +CACM   Accumulated Call Meter
+   +COLP   Connected Line Identification Presentation

\ No newline at end of file
-- 
1.7.1

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


[PATCH 06/12] doc:Add AT commands for Network support

2011-03-18 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
index 2bec5e4..74b54ab 100644
--- a/doc/dialup-command-set.txt
+++ b/doc/dialup-command-set.txt
@@ -121,4 +121,12 @@ GPRS:
+CGCLASSGPRS Mobile Station Class
+DR Data Compression Reporting
+DS Data Compression
-   
\ No newline at end of file
+Network:
+
+   *CNTI   Network RAT capabilities
+   +COPS   PLMN selection
+   +CPOL   Preferred PLMN list
+   +CREG   Network registration
+   +CSQSignal quality
+   +CTZU   Automatic Time Zone Update
+   +CTZR   Time Zone Reporting
-- 
1.7.1

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


[PATCH 07/12] doc: Add AT commands for supplementary services

2011-03-18 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
index 74b54ab..a0599df 100644
--- a/doc/dialup-command-set.txt
+++ b/doc/dialup-command-set.txt
@@ -130,3 +130,11 @@ Network:
+CSQSignal quality
+CTZU   Automatic Time Zone Update
+CTZR   Time Zone Reporting
+Supplementary Services:
+---
+   +CCFC   Call forwarding number and conditions
+   +CCWA   Call waiting
+   +CLCC   List current calls
+   +CLIR   Calling line identification restriction
+   +CSSN   Supplementary Service Notifications
+   +CUSD   Unstructured supplementary service data
-- 
1.7.1

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


[PATCH 05/12] doc:Add AT commands for GPRS

2011-03-18 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |   21 +
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
index 735d626..2bec5e4 100644
--- a/doc/dialup-command-set.txt
+++ b/doc/dialup-command-set.txt
@@ -100,4 +100,25 @@ Call management:
+VTSDTMF and tone generation
+CACM   Accumulated Call Meter
+COLP   Connected Line Identification Presentation
+GPRS:
+-
+   +CGACT  PDP context activate or deactivate
+   +CGATT  PS attach or detach
+   +CGCMOD PDP Context Modify
+   +CGDCONTDefine PDP Context
+   +CGEQREQ3G Quality of Service Profile (Requested)
+   +CGEQMIN3G Quality of Service Profile (Minimum acceptable)
+   +CGEQNEG3G Quality of Service Profile (Negotiated) 
+   +CGQREQ Quality of Service Profile (Requested)
+   +CGQMIN Quality of Service Profile (Minimum Acceptable)
+   +CGREG  GPRS network registration status
+   +CGDSCONT   Define Secondary PDP Context
+   +CGDATA Enter Data State
+   +CGTFT  Traffic Flow Template
+   +CGCMOD PDP Context Modify
+   +CGCLASSGPRS Mobile Station Class
+   +CGPADDRShow PDP address
+   +CGCLASSGPRS Mobile Station Class
+   +DR Data Compression Reporting
+   +DS Data Compression

\ No newline at end of file
-- 
1.7.1

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


[PATCH 08/12] doc: Add AT commands for SMS

2011-03-18 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |   29 +
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
index a0599df..6480577 100644
--- a/doc/dialup-command-set.txt
+++ b/doc/dialup-command-set.txt
@@ -138,3 +138,32 @@ Supplementary Services:
+CLIR   Calling line identification restriction
+CSSN   Supplementary Service Notifications
+CUSD   Unstructured supplementary service data
+SMS:
+
+   +CMTI   A GSM/GPRS modem or mobile phone uses +CMTI to notify 
+   the computer / PC that a new SMS message has been 
+   received and the memory location where it is stored.
+   +CMTA GSM/GPRS modem or mobile phone uses +CMT to forward
+   a newly received SMS message to the computer / PC.
+   +CGSMS  Select service for MO SMS messages
+   +CMGF   Message Format
+   +CMGS   Send Message
+   +CSCA   Service Centre Address
+   +CESP   Enter SMS Block Mode Protocol
+   +CMGC   Send Command
+   +CMGD   Delete Message
+   +CMGL   List Messages
+   +CMGR   Read Message
+   +CMGW   Write Message to Memory
+   +CMMS   More Messages to Send
+   +CMSS   Send Message from Storage
+   +CNMA   New Message Acknowledgement to ME/TA
+   +CNMI   New Message Indications to TE
+   +CPMS   Preferred Message Storage
+   +CSCS   Select TE Character Set
+   +CSCB   Select Cell Broadcast Message Types
+   +CSDH   Show Text Mode Parameters
+   +CSMP   Set Text Mode Parameters
+   +CSMS   Select Message Service
+   +CRES   Restore Settings (SMS)
+   +CSAS   Save Settings  (SMS)
-- 
1.7.1

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


[PATCH 09/12] doc: Add AT commands for device management

2011-03-18 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |   18 ++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
index 6480577..647d269 100644
--- a/doc/dialup-command-set.txt
+++ b/doc/dialup-command-set.txt
@@ -167,3 +167,21 @@ SMS:
+CSMS   Select Message Service
+CRES   Restore Settings (SMS)
+CSAS   Save Settings  (SMS)
+Device:
+
+   +CBCBattery charge
+   +CBKLT  Backlight
+   +CCLK   Clock
+   +CSOCommand Screen Orientation
+   +CPWROFFSwitch off MS
+   +CPOS   Positioning Control
+   +CSSCommand Screen Size
+   +CGMI   Request manufacturer identification
+   +CGMM   Request model identification
+   +CGMR   Request revision identification
+   +GMIRequest Manufacturer Identification
+   +GMMRequest Model Identification
+   +GMRRequest Revision Identification
+   +CGSN   Request product serial number identification
+   +CKPD   Keypad control
+
-- 
1.7.1

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


[PATCH 11/12] doc: Add AT command for debugging purpose

2011-03-18 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
index 97ff009..554707d 100644
--- a/doc/dialup-command-set.txt
+++ b/doc/dialup-command-set.txt
@@ -184,6 +184,7 @@ Device:
+GMRRequest Revision Identification
+CGSN   Request product serial number identification
+CKPD   Keypad control
+   +TRACE  Switch Trace ON/OFF
 SIM
 
+CPBR   Read phonebook entries
-- 
1.7.1

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


[PATCH 10/12] doc: Add AT commands for SIM

2011-03-18 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |   14 +-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
index 647d269..97ff009 100644
--- a/doc/dialup-command-set.txt
+++ b/doc/dialup-command-set.txt
@@ -184,4 +184,16 @@ Device:
+GMRRequest Revision Identification
+CGSN   Request product serial number identification
+CKPD   Keypad control
-
+SIM
+
+   +CPBR   Read phonebook entries
+   +CPBS   Select phonebook memory storage
+   +CPBW   Write phonebook entry
+   +CPBF   Find Phonebook Entries
+   +CPIN   Enter PIN
+   +CRSM   Restricted SIM access
+   +CSIM   Generic SIM access
+   +CASIM  SIM Slot
+   +CRES   Restore Settings (SMS)
+   +CSAS   Save Settings  (SMS)
+   +CCID   Request SIM Card Identification
-- 
1.7.1

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


[PATCH 12/12] doc: Add AT commands for Location based services

2011-03-18 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
index 554707d..f06033b 100644
--- a/doc/dialup-command-set.txt
+++ b/doc/dialup-command-set.txt
@@ -198,3 +198,8 @@ SIM
+CRES   Restore Settings (SMS)
+CSAS   Save Settings  (SMS)
+CCID   Request SIM Card Identification
+Location:
+-
+   +CMOLR  Mobile Originated Location Request 
+   +CCLRAD Needed for clearing of old Assistance Data stored 
+   for AGPS positioning
-- 
1.7.1

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


[PATCH] doc: Update BT HFP / Add Emulator AT command set

2011-03-17 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |  252 ++--
 1 files changed, 218 insertions(+), 34 deletions(-)

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
index a7a1df3..9d80170 100644
--- a/doc/dialup-command-set.txt
+++ b/doc/dialup-command-set.txt
@@ -1,45 +1,229 @@
-This document specifies the AT command set used in the bluetooth ofono plugins.
+This document specifies the AT command supported in the AT Emulator and atoms.
 
 Bluetooth Dial-up Networking Profile Features Description
 =
-(Ref. document: Dial-up Networking Profile - Bluetooth specification version 
1.1 - 22 February 2001)
+(Ref. document: Dial-up Networking Profile - Bluetooth specification
+version 1.1- 22 February 2001)
 
-- AT COMMAND SET USED:
+- AT COMMAND set used:
 Commands:
-   C  Circuit 109 (DCD) Control
-   D  Circuit 108 (DTR) Response
-   F  Set to Factory Defined Configuration
-   +GCAP   Request Complete Capabilities List
-   +GMIRequest Manufacturer Identification
-   +GMMRead Model Identification
-   +GMRRead Revision Identification
-   A   Answer Incoming Call
-   D   Dial
-   E   Command Echo
-   H   Hang Up
-   L   Monitor Speaker Loudness
-   M   Monitor Speaker Control
-   O   Return to Online Data Mode
-   P   Select Pulse Dialling
-   Q   Result Code Suppression
-   S0  Automatic Answer Control
-   S10 Automatic Disconnect Delay Control
-   S3  Command Line Termination Character
-   S4  Response Formatting Character
-   S5  Command Line Editing Character (BACKSPACE)
-   S6  Blind Dial Delay Control
-   S7  Connection Completion Timeout
-   S8  Comma Dial Modifier Delay Control
-   T   Select Tone Dialling
-   V   DCE Response Format
-   X   Call Progress Monitoring Control
-   Z   Reset to Default Configuration
+   C  Circuit 109 (DCD) Control
+   D  Circuit 108 (DTR) Response
+   F  Set to Factory Defined Configuration
+   +GCAP   Request Complete Capabilities List
+*  +GMIRequest Manufacturer Identification
+*  +GMMRead Model Identification
+*  +GMRRead Revision Identification
+   A   Answer Incoming Call
+   D   Dial
+   E   Command Echo
+   H   Hang Up
+   L   Monitor Speaker Loudness
+   M   Monitor Speaker Control
+   O   Return to Online Data Mode
+   P   Select Pulse Dialling
+   Q   Result Code Suppression
+   S0  Automatic Answer Control
+   S10 Automatic Disconnect Delay Control
+   S3  Command Line Termination Character
+   S4  Response Formatting Character
+   S5  Command Line Editing Character (BACKSPACE)
+   S6  Blind Dial Delay Control
+   S7  Connection Completion Timeout
+   S8  Comma Dial Modifier Delay Control
+   T   Select Tone Dialling
+   V   DCE Response Format
+   X   Call Progress Monitoring Control
+   Z   Reset to Default Configuration
 Result codes:
OK  Acknowledge execution of a command
CONNECT Connection has been established
-   RINGThe DCE has detected an incoming call signal from 
network
-   NO CARRIER  The connection has been terminated, or attempt to 
establish
-   a connection failed
+   RINGThe DCE has detected an incoming call signal 
+   from network
+   NO CARRIER  The connection has been terminated, or attempt to
+   establish a connection failed
ERROR   Error
NO DIALTONE No dial-tone detected
BUSYBusy signal detected
+
+Bluetooth Hands-Free Profile Description
+=
+(Ref. document: HFP1.5_SPEC (Car Working Group) - version V10r00 - 2005-11-25)
+
+- AT COMMAND set used:
+Commands:
+   D  Extension of the standard ATD command, intended for
+   memory dialing. Only voice calls are covered here
+   +CIND   Standard indicator update AT command.   
+
+   +NREC   Noise Reduction and Echo Canceling  
+   +VGMGain of Microphone  
+   +VGSGain of Speaker
+   +BINP   Bluetooth INPut 
+   +BLDN   Bluetooth Last Dialed Number
+   +BVRA   Bluetooth Voice Recognition Activation
+   +BRSF   Bluetooth 

[PATCH] gatserver: Add various ATSx handlers

2011-02-22 Thread Olivier Guiter
---
 gatchat/gatserver.c |   36 
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index b092a68..cd86781 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -80,10 +80,14 @@ static const char *server_result_to_string(GAtServerResult 
result)
 
 /* Basic command setting for V.250 */
 struct v250_settings {
+   char s0;/* set by S0=val */
char s3;/* set by S3=val */
char s4;/* set by S4=val */
char s5;/* set by S5=val */
int s6; /* set by S6=val */
+   int s7; /* set by S7=val */
+   int s8; /* set by S8=val */
+   int s10;/* set by S10=val */
gboolean echo;  /* set by Eval */
gboolean quiet; /* set by Qval */
gboolean is_v1; /* set by Vval, v0 or v1 */
@@ -319,6 +323,12 @@ static void s_template_cb(GAtServerRequestType type, 
GAtResult *result,
}
 }
 
+static void at_s0_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+   s_template_cb(type, result, server, server-v250.s0, S0, 0, 7);
+}
+
 static void at_s3_cb(GAtServer *server, GAtServerRequestType type,
GAtResult *result, gpointer user_data)
 {
@@ -412,6 +422,24 @@ static void at_s6_cb(GAtServer *server, 
GAtServerRequestType type,
at_template_cb(type, result, server, server-v250.s6, S6, 0, 1, 1);
 }
 
+static void at_s7_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+   at_template_cb(type, result, server, server-v250.s7, S7, 1, 255, 
50);
+}
+
+static void at_s8_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+   at_template_cb(type, result, server, server-v250.s8, S8, 1, 255, 2);
+}
+
+static void at_s10_cb(GAtServer *server, GAtServerRequestType type,
+   GAtResult *result, gpointer user_data)
+{
+   at_template_cb(type, result, server, server-v250.s10, S10, 1, 254, 
2);
+}
+
 static void at_c109_cb(GAtServer *server, GAtServerRequestType type,
GAtResult *result, gpointer user_data)
 {
@@ -1044,10 +1072,14 @@ static void server_wakeup_writer(GAtServer *server)
 
 static void v250_settings_create(struct v250_settings *v250)
 {
+   v250-s0 = 0;
v250-s3 = '\r';
v250-s4 = '\n';
v250-s5 = '\b';
v250-s6 = 2;
+   v250-s7 = 50;
+   v250-s8 = 2;
+   v250-s10 = 2;
v250-echo = TRUE;
v250-quiet = FALSE;
v250-is_v1 = TRUE;
@@ -1068,6 +1100,7 @@ static void at_notify_node_destroy(gpointer data)
 
 static void basic_command_register(GAtServer *server)
 {
+   g_at_server_register(server, S0, at_s0_cb, NULL, NULL);
g_at_server_register(server, S3, at_s3_cb, NULL, NULL);
g_at_server_register(server, S4, at_s4_cb, NULL, NULL);
g_at_server_register(server, S5, at_s5_cb, NULL, NULL);
@@ -1076,6 +1109,9 @@ static void basic_command_register(GAtServer *server)
g_at_server_register(server, V, at_v_cb, NULL, NULL);
g_at_server_register(server, X, at_x_cb, NULL, NULL);
g_at_server_register(server, S6, at_s6_cb, NULL, NULL);
+   g_at_server_register(server, S7, at_s7_cb, NULL, NULL);
+   g_at_server_register(server, S8, at_s8_cb, NULL, NULL);
+   g_at_server_register(server, S10, at_s10_cb, NULL, NULL);
g_at_server_register(server, C, at_c109_cb, NULL, NULL);
g_at_server_register(server, D, at_c108_cb, NULL, NULL);
 }
-- 
1.7.1

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


Re: [PATCH 1/2] gprs:Add code to handle AT+CGDCONT

2011-02-16 Thread Olivier Guiter

Hi Denis and Marcel,


Hi Denis,


---
  include/gprs.h |2 +
  src/gprs.c |   63 
  2 files changed, 65 insertions(+), 0 deletions(-)

So I went in a slightly different direction with the emulator API.  Can
you please have a look?

Also, I'd really rather hold off trying to implement CGDCONT right now.
  That piece is quite nasty and generally of lower priority.  I'd like to
get the emulator a bit more hashed out first and implement the base BT
DUN  BT HFP profiles.

for the sake of testing, I would be fine with the real basic CGDCONT and
just offering IP and CID 1. And then of course accepting any APN in that
range and rejecting any other command.
The submitted code is just an how-to, and need to be updated to 
implement the complete CGDCONT (up to now, the function displays the 
existings contexts, and the default range values.
The idea behind this code was to provide the complete chain to handle AT 
commands in atoms. I m not sure the current handler mechanism fit with 
Denis's view ;)

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


[PATCH 0/2] Add AT commands handler in emulator

2011-02-15 Thread Olivier Guiter
Hi,
This series of patches implements a skeleton for handling AT commands.
These handlers can be local to emulator or stored in a specific atom (e.g. 
gprs).
Registration mechanism is subject to change.

Olivier Guiter (2):
  gprs:Add code to handle AT+CGDCONT
  emulator: Add +CGMI and +CGDCONT commands

 include/emulator.h |7 +-
 include/gprs.h |2 +
 src/emulator.c |   28 +++---
 src/gprs.c |   63 
 4 files changed, 95 insertions(+), 5 deletions(-)

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


[PATCH 1/2] gprs:Add code to handle AT+CGDCONT

2011-02-15 Thread Olivier Guiter
---
 include/gprs.h |2 +
 src/gprs.c |   63 
 2 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/include/gprs.h b/include/gprs.h
index 157a6f9..1901329 100644
--- a/include/gprs.h
+++ b/include/gprs.h
@@ -73,6 +73,8 @@ void ofono_gprs_remove(struct ofono_gprs *gprs);
 void ofono_gprs_set_data(struct ofono_gprs *gprs, void *data);
 void *ofono_gprs_get_data(struct ofono_gprs *gprs);
 
+void ofono_gprs_add_emulator_handler(void *user);
+
 void ofono_gprs_set_cid_range(struct ofono_gprs *gprs,
unsigned int min, unsigned int max);
 void ofono_gprs_add_context(struct ofono_gprs *gprs,
diff --git a/src/gprs.c b/src/gprs.c
index 33711dc..b36f94d 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -45,6 +45,7 @@
 #include idmap.h
 #include simutil.h
 #include util.h
+#include gatserver.h
 
 #define GPRS_FLAG_ATTACHING 0x1
 #define GPRS_FLAG_RECHECK 0x2
@@ -2762,3 +2763,65 @@ void *ofono_gprs_get_data(struct ofono_gprs *gprs)
 {
return gprs-driver_data;
 }
+
+static void ofono_gprs_list_contexts(struct ofono_gprs *gprs, gpointer user)
+{
+   GAtServer *server = user;
+   GSList *l;
+   char buf[256];
+   int i;
+
+   struct pri_context *ctx;
+
+   i = 1;
+   for (l = gprs-contexts; l; l = l-next) {
+   ctx = l-data;
+
+   snprintf(buf, 255, +CGDCONT: %d,\%s\,\%s\,
+   i, gprs_proto_to_string(ctx-context.proto),
+   ctx-context.apn);
+
+   g_at_server_send_info(server, buf, FALSE);
+   i += 1 ;
+   }
+}
+
+/* Process the usual AT+CGDCONT command
+ * TODO Create context
+ * TODO Delete: how to map the cid with the correct context
+ * TODO Req. type support: check the range.
+ */
+static void cgdcont_cb(GAtServerRequestType type, GAtResult *cmd, gpointer 
user)
+{
+   struct ofono_emulator *em = user;
+   GAtServer *server = em-server;
+   void *atom_gprs = __ofono_atom_get_data(em-gprs_atom);
+
+   switch (type) {
+   case G_AT_SERVER_REQUEST_TYPE_SUPPORT:  /* +CGDCONT=? */
+   g_at_server_send_info(server,
+   +CGDCONT: (1-10),\IP\,,,(0-2),(0,1,2,3,4), 
FALSE);
+   g_at_server_send_info(server,
+   +CGDCONT: (1-2),\IPv6\,,,(0-2),(0,1,2,3,4), 
TRUE);
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+
+   case G_AT_SERVER_REQUEST_TYPE_QUERY:  /* +CGDCONT? */
+   ofono_gprs_list_contexts(atom_gprs, server);
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+
+   case G_AT_SERVER_REQUEST_TYPE_SET:
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+   default:
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+   };
+}
+
+void ofono_gprs_add_emulator_handler(void *user)
+{
+   struct ofono_emulator *em = user;
+
+   g_at_server_register(em-server, +CGDCONT, cgdcont_cb, em, NULL);
+}
-- 
1.7.1

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


[PATCH 2/2] emulator: Add +CGMI and +CGDCONT commands

2011-02-15 Thread Olivier Guiter
---
 include/emulator.h |7 ++-
 src/emulator.c |   28 
 2 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/include/emulator.h b/include/emulator.h
index 2334e02..94053f1 100644
--- a/include/emulator.h
+++ b/include/emulator.h
@@ -27,8 +27,13 @@ extern C {
 #endif
 
 #include ofono/types.h
+#include gatserver.h
 
-struct ofono_emulator;
+struct ofono_emulator {
+   struct ofono_atom *atom;
+   GAtServer *server;
+   struct ofono_atom *gprs_atom;
+};
 
 enum ofono_emulator_type {
OFONO_EMULATOR_TYPE_DUN,
diff --git a/src/emulator.c b/src/emulator.c
index c49283d..0ed2ae5 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -28,10 +28,23 @@
 #include ofono.h
 #include gatserver.h
 
-struct ofono_emulator {
-   struct ofono_atom *atom;
-   GAtServer *server;
-};
+static void cgmi_cb(GAtServerRequestType type, GAtResult *cmd, gpointer user)
+{
+   struct ofono_emulator *em = user;
+   GAtServer *server = em-server;
+
+   switch (type) {
+   case G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY:
+   g_at_server_send_info(server, oFono, TRUE);
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+   case G_AT_SERVER_REQUEST_TYPE_SUPPORT:
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+   break;
+   default:
+   g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+   };
+}
 
 static void emulator_debug(const char *str, void *data)
 {
@@ -76,6 +89,12 @@ void ofono_emulator_register(struct ofono_emulator *em, int 
fd)
g_at_server_set_disconnect_function(em-server,
emulator_disconnect, em);
 
+   /* Register local callbacks */
+   g_at_server_register(em-server, +CGMI, cgmi_cb, em, NULL);
+
+   /* Register external (atoms) callbacks */
+   ofono_gprs_add_emulator_handler(em);
+
__ofono_atom_register(em-atom, emulator_unregister);
 }
 
@@ -102,6 +121,7 @@ struct ofono_emulator *ofono_emulator_create(struct 
ofono_modem *modem,
 
em-atom = __ofono_modem_add_atom(modem, OFONO_ATOM_TYPE_EMULATOR_DUN,
emulator_remove, em);
+   em-gprs_atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_GPRS);
 
return em;
 }
-- 
1.7.1

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


[PATCH 1/1] gatserver: Add send raw data function

2011-02-11 Thread Olivier Guiter
---
 gatchat/gatserver.c |   14 ++
 gatchat/gatserver.h |1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index 25b7ba4..f2ee34d 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -252,6 +252,20 @@ void g_at_server_send_info(GAtServer *server, const char 
*line, gboolean last)
send_common(server, buf, len);
 }
 
+void g_at_server_send_data(GAtServer *server, const char *format, ...)
+{
+   char buf[MAX_TEXT_SIZE + 1];
+   unsigned int len;
+
+   va_list ap;
+
+   va_start(ap, format);
+   len = vsnprintf(buf, MAX_TEXT_SIZE, format, ap);
+   va_end(ap);
+
+   send_common(server, buf, len);
+}
+
 static gboolean get_result_value(GAtServer *server, GAtResult *result,
const char *command,
int min, int max, int *value)
diff --git a/gatchat/gatserver.h b/gatchat/gatserver.h
index f0c19da..911f20d 100644
--- a/gatchat/gatserver.h
+++ b/gatchat/gatserver.h
@@ -112,6 +112,7 @@ void g_at_server_send_unsolicited(GAtServer *server, const 
char *result);
  * responses.
  */
 void g_at_server_send_info(GAtServer *server, const char *line, gboolean last);
+void g_at_server_send_data(GAtServer *server, const char *format, ...);
 
 #ifdef __cplusplus
 }
-- 
1.7.1

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


[PATCH 1/1] gatserver: Add ATS5 command feature

2011-02-10 Thread Olivier Guiter
---
 gatchat/gatserver.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index be9f79a..25b7ba4 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -796,6 +796,7 @@ static char *extract_line(GAtServer *p, struct ring_buffer 
*rbuf)
int line_length = 0;
gboolean in_string = FALSE;
char s3 = p-v250.s3;
+   char s5 = p-v250.s5;
char *line;
int i;
 
@@ -837,7 +838,11 @@ static char *extract_line(GAtServer *p, struct ring_buffer 
*rbuf)
if (*buf == '')
in_string = !in_string;
 
-   if ((*buf == ' ' || *buf == '\t')  in_string == FALSE)
+   if (*buf == s5) {
+   if (i != 0)
+   i -= 1;
+   }
+   else if ((*buf == ' ' || *buf == '\t')  in_string == FALSE)
; /* Skip */
else if (*buf != s3)
line[i++] = *buf;
-- 
1.7.1

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


[PATCHv3 1/2] doc:Add Bluetooth Dial-up Networking Profile specs

2011-01-18 Thread Olivier Guiter
---
 doc/standards.txt |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/doc/standards.txt b/doc/standards.txt
index 35f2a3a..b7b68f3 100644
--- a/doc/standards.txt
+++ b/doc/standards.txt
@@ -175,3 +175,7 @@ standards. oFono implements some of the features found in 
the Phase 2
 specification, version 4.2.
 
 The specification itself is not publicly available.
+
+Bluetooth Specifications
+
+- Dial-up Networking Profile - Bluetooth specification version 1.1 - 22 
February 2001
-- 
1.7.1

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


[PATCHv3 2/2] doc: Add AT command set for Dialup Networking

2011-01-18 Thread Olivier Guiter
---
 doc/dialup-command-set.txt |   45 
 1 files changed, 45 insertions(+), 0 deletions(-)
 create mode 100644 doc/dialup-command-set.txt

diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
new file mode 100644
index 000..a7a1df3
--- /dev/null
+++ b/doc/dialup-command-set.txt
@@ -0,0 +1,45 @@
+This document specifies the AT command set used in the bluetooth ofono plugins.
+
+Bluetooth Dial-up Networking Profile Features Description
+=
+(Ref. document: Dial-up Networking Profile - Bluetooth specification version 
1.1 - 22 February 2001)
+
+- AT COMMAND SET USED:
+Commands:
+   C  Circuit 109 (DCD) Control
+   D  Circuit 108 (DTR) Response
+   F  Set to Factory Defined Configuration
+   +GCAP   Request Complete Capabilities List
+   +GMIRequest Manufacturer Identification
+   +GMMRead Model Identification
+   +GMRRead Revision Identification
+   A   Answer Incoming Call
+   D   Dial
+   E   Command Echo
+   H   Hang Up
+   L   Monitor Speaker Loudness
+   M   Monitor Speaker Control
+   O   Return to Online Data Mode
+   P   Select Pulse Dialling
+   Q   Result Code Suppression
+   S0  Automatic Answer Control
+   S10 Automatic Disconnect Delay Control
+   S3  Command Line Termination Character
+   S4  Response Formatting Character
+   S5  Command Line Editing Character (BACKSPACE)
+   S6  Blind Dial Delay Control
+   S7  Connection Completion Timeout
+   S8  Comma Dial Modifier Delay Control
+   T   Select Tone Dialling
+   V   DCE Response Format
+   X   Call Progress Monitoring Control
+   Z   Reset to Default Configuration
+Result codes:
+   OK  Acknowledge execution of a command
+   CONNECT Connection has been established
+   RINGThe DCE has detected an incoming call signal from 
network
+   NO CARRIER  The connection has been terminated, or attempt to 
establish
+   a connection failed
+   ERROR   Error
+   NO DIALTONE No dial-tone detected
+   BUSYBusy signal detected
-- 
1.7.1

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


[PATCH] gatchat: Fix issue after removing deprecated functions

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

diff --git a/gatchat/gatio.c b/gatchat/gatio.c
index 9cfc998..53896df 100644
--- a/gatchat/gatio.c
+++ b/gatchat/gatio.c
@@ -145,6 +145,7 @@ gsize g_at_io_write(GAtIO *io, const gchar *data, gsize 
count)
return 0;
}
 
+   g_io_channel_flush(io-channel, NULL);
g_at_util_debug_chat(FALSE, data, bytes_written,
io-debugf, io-debug_data);
 
-- 
1.7.1

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


[PATCH] gatserver: Add ATS6 command handler.

2011-01-14 Thread Olivier Guiter
---
 gatchat/gatserver.c |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index 11eaac6..906cf26 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -83,6 +83,7 @@ struct v250_settings {
char s3;/* set by S3=val */
char s4;/* set by S4=val */
char s5;/* set by S5=val */
+   int s6; /* set by S6=val */
gboolean echo;  /* set by Eval */
gboolean quiet; /* set by Qval */
gboolean is_v1; /* set by Vval, v0 or v1 */
@@ -426,6 +427,14 @@ static void at_c108_cb(GAtServerRequestType type, 
GAtResult *result,
at_template_cb(type, result, server, server-v250.c108, D, 0, 2, 2);
 }
 
+static void at_s6_cb(GAtServerRequestType type, GAtResult *result,
+   gpointer user_data)
+{
+   GAtServer *server = user_data;
+   at_template_cb(type, result, server, server-v250.s6, S6, 0, 255, 2);
+
+}
+
 static inline gboolean is_extended_command_prefix(const char c)
 {
switch (c) {
@@ -1031,6 +1040,7 @@ static void v250_settings_create(struct v250_settings 
*v250)
v250-s3 = '\r';
v250-s4 = '\n';
v250-s5 = '\b';
+   v250-s6 = 2;
v250-echo = TRUE;
v250-quiet = FALSE;
v250-is_v1 = TRUE;
@@ -1054,6 +1064,7 @@ static void basic_command_register(GAtServer *server)
g_at_server_register(server, S3, at_s3_cb, server, NULL);
g_at_server_register(server, S4, at_s4_cb, server, NULL);
g_at_server_register(server, S5, at_s5_cb, server, NULL);
+   g_at_server_register(server, S6, at_s6_cb, server, NULL);
g_at_server_register(server, E, at_e_cb, server, NULL);
g_at_server_register(server, Q, at_q_cb, server, NULL);
g_at_server_register(server, V, at_v_cb, server, NULL);
-- 
1.7.1

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