[PATCH 5/8] Add emulator dialing call support

2010-04-13 Thread Zhenhua Zhang
--- include/emulator.h |4 +- src/emulator.c | 110 2 files changed, 112 insertions(+), 2 deletions(-) diff --git a/include/emulator.h b/include/emulator.h index 3d07e36..0412f5a 100644 --- a/include/emulator.h +++ b/include/emulator.h

[PATCH 4/8] Add skeleton of src/emulator.c

2010-04-13 Thread Zhenhua Zhang
--- Makefile.am|7 +- include/dbus.h |1 + include/emulator.h | 75 +++ src/emulator.c | 203 src/ofono.h|4 + 5 files changed, 287 insertions(+), 3 deletions(-) create mode 100644 include/

[PATCH 3/8] Refactor sim watchlist with atom watchlist

2010-04-13 Thread Zhenhua Zhang
--- src/sim.c | 30 ++ 1 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/sim.c b/src/sim.c index f64c7d4..b9e6b4a 100644 --- a/src/sim.c +++ b/src/sim.c @@ -89,7 +89,6 @@ struct ofono_sim { unsigned char efli_length; enum ofono_sim_c

[PATCH 2/8] Refactor netreg watchlist with atom watchlist

2010-04-13 Thread Zhenhua Zhang
--- src/network.c | 32 +++- 1 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/network.c b/src/network.c index b2e5821..c975c7d 100644 --- a/src/network.c +++ b/src/network.c @@ -79,7 +79,6 @@ struct ofono_netreg { struct ofono_sim *sim;

[PATCH 1/8] Add signal watches for atom

2010-04-13 Thread Zhenhua Zhang
It replaces watch lists dispersed in each component. So that each component like Voicecall, SMS can be watched in unique way. --- src/modem.c | 55 +++ src/ofono.h | 19 +++ 2 files changed, 74 insertions(+), 0 deletions(-) d

[PATCH 0/8] Prototype to integrate gatserver with oFono

2010-04-13 Thread Zhenhua Zhang
These 8 patches are prototypes to integrate gatserver with oFono core: 1. Move watch_list into struct ofono_atom so that each component can be watched in an unique way. 2. Add src/emulator.c and dbus interface to create emulator. 3. Add at emulator plugin to watch call status and handle dial comm

Re: Is there GPRS API doc

2010-04-13 Thread Zhenhua Zhang
Hi Ye, On 04/13/2010 04:38 PM, Huang, Ye wrote: hi , I can find ofono have supported gprs function in ofono v0.20 by reading overview.txt and source code . but i can not find api doc about gprs. Could update the latest API doc on http://www.ofono.org? The D-Bus API is described in doc/dataconn

[PATCH 7/7] Add test implementation for CPBS

2010-03-31 Thread Zhenhua Zhang
--- gatchat/test-server.c | 24 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/gatchat/test-server.c b/gatchat/test-server.c index 916198b..f170d88 100644 --- a/gatchat/test-server.c +++ b/gatchat/test-server.c @@ -361,6 +361,29 @@ static void cmgl_cb(GA

[PATCH 6/7] Add test implementation to support SMS

2010-03-31 Thread Zhenhua Zhang
--- gatchat/test-server.c | 177 + 1 files changed, 177 insertions(+), 0 deletions(-) diff --git a/gatchat/test-server.c b/gatchat/test-server.c index 425e353..916198b 100644 --- a/gatchat/test-server.c +++ b/gatchat/test-server.c @@ -192,6 +192,17

[PATCH 4/7] Add Repeat last command support

2010-03-31 Thread Zhenhua Zhang
--- gatchat/gatserver.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 5206a12..4796b71 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -996,8 +996,13 @@ static void new_bytes(GAtServer *p)

[PATCH 5/7] Fix echo command back even if don't process it

2010-03-31 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 4796b71..a47d46c 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -1050,19 +1050,19 @@ static gboolean received_data(GIOChann

[PATCH 1/7] Fix Add check for return modem to avoid crash

2010-03-31 Thread Zhenhua Zhang
--- plugins/modemconf.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/plugins/modemconf.c b/plugins/modemconf.c index cf0ee8b..e30fce6 100644 --- a/plugins/modemconf.c +++ b/plugins/modemconf.c @@ -138,6 +138,10 @@ static struct ofono_modem *create_modem(GKeyFile *key

[PATCH 2/7] Add implementation for S3, S4, S5 command

2010-03-31 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 133 +++ 1 files changed, 133 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index f166df2..7d5c3c7 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -252,6 +252,130 @@ voi

[PATCH 3/7] Add implementation for ATE and other basic command

2010-03-31 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 162 +- 1 files changed, 158 insertions(+), 4 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 7d5c3c7..5206a12 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -260,10 +260,10 @@ stat

[PATCH] Fix ignore incoming bytes during parsing

2010-03-30 Thread Zhenhua Zhang
Server processes one command line at one time, so ignore the rest incoming bytes during the command parsing. --- gatchat/gatserver.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index e04e0d2..911bbef 100644 --- a/gatchat/gat

[PATCH 2/2] Add flag to parse one command line at once

2010-03-30 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 5f21766..ce78857 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -119,6 +119,7 @@ struct _GAtServer { GAtServerResult las

[PATCH 1/2] Add server send result code

2010-03-30 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 141 +++ gatchat/gatserver.h | 17 ++ 2 files changed, 137 insertions(+), 21 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index c75fbf5..5f21766 100644 --- a/gatchat/gatserver.c +++ b/gatchat/g

Updated v2 patches to handle the asynchronized callback

2010-03-30 Thread Zhenhua Zhang
Hi, Please review updated patches. Thanks! ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono

[PATCH 3/3] Add flag to parse one command line at once

2010-03-29 Thread Zhenhua Zhang
--- gatchat/gatserver.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index cad9d91..251c3b8 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -116,6 +116,7 @@ struct _GAtServer { gboolean destroyed;

[PATCH 2/3] Add server send result code

2010-03-29 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 98 --- gatchat/gatserver.h | 17 + 2 files changed, 102 insertions(+), 13 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 07999a8..cad9d91 100644 --- a/gatchat/gatserver.c +++ b/gatcha

[PATCH 1/3] Refactor the command parsing

2010-03-29 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 103 +++--- 1 files changed, 56 insertions(+), 47 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index c75fbf5..07999a8 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -112,6 +112,8 @@ struct

[PATCH 0/3] Updated patches to handle the asynchronized callback

2010-03-29 Thread Zhenhua Zhang
Hi, I updated the patches according to the comments and did following changes: 1. removed last_result since it seems no use at all. 2. rename g_at_server_send_flush to g_at_server_send_result. It makes code easier to read. 3. add parse_ready flag to parse one command line at one time. Please re

[PATCH 5/5] Add register ATE and other basic command callbacks

2010-03-25 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 195 +- 1 files changed, 191 insertions(+), 4 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 9d4d221..06b5751 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -302,10 +302,10 @@ stat

[PATCH 4/5] Add register S3-S5 basic command callbacks

2010-03-25 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 162 +++ 1 files changed, 162 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 5d2a036..9d4d221 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -294,6 +294,159 @@ voi

[PATCH 3/5] Add set server to offline mode during parse line

2010-03-25 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index fdc4180..5d2a036 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -118,6 +118,7 @@ struct _GAtServer { unsigned int read

[PATCH 2/5] Add server send final result code

2010-03-25 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 93 ++ gatchat/gatserver.h | 20 +++ 2 files changed, 105 insertions(+), 8 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 74c765d..fdc4180 100644 --- a/gatchat/gatserver.c +++ b/gatcha

[PATCH 1/5] Refactor the command parsing framework

2010-03-25 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 182 +++--- gatchat/gatserver.h |7 ++- 2 files changed, 133 insertions(+), 56 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index c75fbf5..74c765d 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatse

[PATCH 0/5] Prototype to handle asynchronized callback

2010-03-25 Thread Zhenhua Zhang
Hi, These patches are the prototype to handle the asynchronized callback for AtServer. During the callback function execution period, GAtServer waits for its result and then process next command. At the same time, the server is capable to accept new data comes from the client side and cache them

[PATCH] Add basic command parsing

2010-03-23 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 110 ++- 1 files changed, 109 insertions(+), 1 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 6579b38..c207bd8 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -308,9 +308,117 @@ nex

[PATCH] Update patch for parsing basic command

2010-03-23 Thread Zhenhua Zhang
Rebase with latest upstream and resent it. ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono

Re: [PATCH 08/10] Fix do not emit error if extended error has emitted

2010-03-23 Thread Zhenhua Zhang
Hi Denis, On 03/23/2010 02:27 AM, Denis Kenzior wrote: Hi Zhenhua, --- gatchat/gatserver.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 1ffc2c3..9683fa3 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c

[PATCH 08/10] Fix do not emit error if extended error has emitted

2010-03-19 Thread Zhenhua Zhang
--- gatchat/gatserver.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 1ffc2c3..9683fa3 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -165,6 +165,10 @@ static void g_at_server_send_final(GAtServer *server,

[PATCH 05/10] Add notify at command callback

2010-03-19 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 48 1 files changed, 48 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 6173765..3f60f1c 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -227,9 +227,57 @@ static g

[PATCH 10/10] Add utilities to send server response

2010-03-19 Thread Zhenhua Zhang
The server response could be either result code or information text. Result code types: final, intermediate and unsolicited. Information text: one or multiple lines of text. --- gatchat/gatserver.c | 42 ++ gatchat/gatserver.h | 17 + 2

[PATCH 06/10] Add g_at_server_register and unregister callback

2010-03-19 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 48 gatchat/gatserver.h |6 ++ 2 files changed, 54 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 3f60f1c..1ffc2c3 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatser

[PATCH 01/10] Add framework of server parser

2010-03-19 Thread Zhenhua Zhang
a. The parser fetch and parse one command per loop. The prefix is the command prefix without parameter. For example, the prefix of "AT+CLIP=1" is "+CLIP". b. Search registered notification node in command_list. Invoke the callback if found. c. Termiate the execution if the result is an error. Oth

[PATCH 09/10] Refactor g_at_server_send_final

2010-03-19 Thread Zhenhua Zhang
Cache the result code as last_result from at command callback. And flush out the last result code when the whole command line is parsed, except the last result is an extended error code, like +CMS ERROR or +CME ERROR. --- gatchat/gatserver.c | 55 -

Add parse framework for GAtServer

2010-03-19 Thread Zhenhua Zhang
Update patches based on comments and rebase with latest git. ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono

[PATCH 07/10] Add G_AT_SERVER_RESULT_EXT_ERROR

2010-03-19 Thread Zhenhua Zhang
--- gatchat/gatserver.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.h b/gatchat/gatserver.h index 5e9eb62..6fb78bd 100644 --- a/gatchat/gatserver.h +++ b/gatchat/gatserver.h @@ -43,6 +43,7 @@ enum _GAtServerResult { G_AT_SERVER_RESULT_NO_DIALT

[PATCH 03/10] Add extended command parsing

2010-03-19 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 65 +- 1 files changed, 63 insertions(+), 2 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 2c53d84..0658553 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -197,16 +197,77 @@ stati

[PATCH 02/10] Add basic command parsing

2010-03-19 Thread Zhenhua Zhang
According to V.250 5.3.1, the basic command is either a single character or the '&' followed by a single character. --- gatchat/gatserver.c | 99 +- 1 files changed, 97 insertions(+), 2 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatse

[PATCH 04/10] Add server at command data structure

2010-03-19 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 27 +++ gatchat/gatserver.h | 22 ++ 2 files changed, 49 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 0658553..6173765 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c

[PATCH 6/6] Add voice call test case for GAtServer

2010-03-17 Thread Zhenhua Zhang
It simulates a simple voice call with client. Client could use ATD to dial out a call and Server could use a pseudo command 'AT+INCM' to notify an incoming call. --- gatchat/test-server.c | 419 + 1 files changed, 419 insertions(+), 0 deletions(-)

[PATCH 5/6] Add register ATV basic command callback

2010-03-17 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 51 +++ 1 files changed, 51 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index e9b1cf4..5a234d6 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -427,6 +427,56 @@ done:

[PATCH 4/6] Add register ATQ basic command callback

2010-03-17 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 51 +++ 1 files changed, 51 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 6427ed3..e9b1cf4 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -377,6 +377,56 @@ done:

[PATCH 3/6] Add register ATE basic command callback

2010-03-17 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 51 +++ 1 files changed, 51 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 1a8ac58..6427ed3 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -327,6 +327,56 @@ done:

[PATCH 2/6] Add register S5 basic command callback

2010-03-17 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 48 1 files changed, 48 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 80e6d45..1a8ac58 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -280,6 +280,53 @@ done:

[PATCH 0/6] Add test cases for GAtServer

2010-03-17 Thread Zhenhua Zhang
These patches register callback functions for each AT command. Patch #1-#5 register basic commands into gatserver.c. Patch #6 add a simple voice call test case in test-server.c. TODO: 1. ATE,ATV,ATQ could share a template function. 2. Register more basic commands defined in 27.007. _

[PATCH 1/6] Add register S3 basic command callback

2010-03-17 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 54 +++ 1 files changed, 54 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 06ea912..80e6d45 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -233,6 +233,53 @@ void

Re: [PATCH 01/11] Rename g_at_server_send_result

2010-03-17 Thread Zhenhua Zhang
applied. Thanks. Zhenhua >From 588126076e1fc10f57b75afe734d51046ab46d6d Mon Sep 17 00:00:00 2001 From: Zhenhua Zhang Date: Wed, 17 Mar 2010 16:36:22 +0800 Subject: [PATCH] Remove old server_parse_line --- gatchat/gatserver.c | 49 - 1 fi

[PATCH 11/11] Add utilities to send server response

2010-03-17 Thread Zhenhua Zhang
The server response could be either result code or information text. Result code types: final, intermediate and unsolicited. Information text: one or multiple lines of text. --- gatchat/gatserver.c | 37 + gatchat/gatserver.h | 11 +++ 2 files chang

[PATCH 08/11] Add G_AT_SERVER_RESULT_EXT_ERROR

2010-03-17 Thread Zhenhua Zhang
--- gatchat/gatserver.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.h b/gatchat/gatserver.h index 5e9eb62..6fb78bd 100644 --- a/gatchat/gatserver.h +++ b/gatchat/gatserver.h @@ -43,6 +43,7 @@ enum _GAtServerResult { G_AT_SERVER_RESULT_NO_DIALT

[PATCH 10/11] Refactor g_at_server_send_final

2010-03-17 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 43 +++ 1 files changed, 27 insertions(+), 16 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index b0138d6..7ac6d34 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -33,6 +33,8 @@ #include "gats

[PATCH 09/11] Fix do not emit error if extended error has emitted

2010-03-17 Thread Zhenhua Zhang
--- gatchat/gatserver.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index c17a7b5..b0138d6 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -165,6 +165,10 @@ static void g_at_server_send_final(GAtServer *server,

[PATCH 07/11] Add g_at_server_register and unregister callback

2010-03-17 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 48 gatchat/gatserver.h |6 ++ 2 files changed, 54 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 6e3347c..c17a7b5 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatser

[PATCH 06/11] Add notify at command callback

2010-03-17 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 38 ++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index bbaef52..6e3347c 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -227,10 +227,48 @@ static gboolean i

[PATCH 05/11] Add server at command data structure

2010-03-17 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 27 +++ gatchat/gatserver.h | 22 ++ 2 files changed, 49 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index f3807eb..bbaef52 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c

[PATCH 04/11] Add extended command parsing

2010-03-17 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 57 ++- 1 files changed, 56 insertions(+), 1 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index b68894d..f3807eb 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -197,6 +197,28 @@ stati

[PATCH 01/11] Rename g_at_server_send_result

2010-03-17 Thread Zhenhua Zhang
Rename it to g_at_server_send_final. --- gatchat/gatserver.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 7577de2..46fa423 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -148,7 +148,7 @@ static void sen

[PATCH 03/11] Add basic command parsing

2010-03-17 Thread Zhenhua Zhang
According to V.250 5.3.1, the basic command is either a single character or the '&' followed by a single character. --- gatchat/gatserver.c | 68 ++- 1 files changed, 67 insertions(+), 1 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gats

[PATCH 02/11] Add framework of server parser

2010-03-17 Thread Zhenhua Zhang
a. The parser fetch and parse one command per loop. The prefix is the command prefix without parameter. For example, the prefix of "AT+CLIP=1" is "+CLIP". b. Search registered notification node in command_list. Invoke the callback if found. c. Termiate the execution if the result is an error. Oth

[PATCH] Fix Don't check CLIR CUG option in hfp_dial

2010-03-09 Thread Zhenhua Zhang
For HFP call, no need to check CLIR & CUG option. It doesn't affect dial out string. --- drivers/hfpmodem/voicecall.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c index 1fa0eec..f83f26a 100644 --- a/drivers/

Re: [PATCH 7/7] Add g_at_server_register to register callback

2010-03-03 Thread Zhenhua Zhang
Hi Denis, On 03/04/2010 03:28 AM, Denis Kenzior wrote: Hi Zhenhua, --- gatchat/gatserver.c | 47 +++ gatchat/gatserver.h |6 ++ 2 files changed, 53 insertions(+), 0 deletions(-) +guint g_at_server_register(GAtServer *server, const ch

Re: [PATCH 5/7] Add server at command data structure

2010-03-03 Thread Zhenhua Zhang
Hi Denis, On 03/04/2010 03:23 AM, Denis Kenzior wrote: Hi Zhenhua, --- struct _GAtServer; @@ -46,6 +47,26 @@ enum _GAtServerResult { typedef enum _GAtServerResult GAtServerResult; +enum _GAtServerRequestType { + G_AT_SERVER_REQUEST_TYPE_NONE, + G_AT_SERVER_REQUEST_TYPE_ACT

Re: [PATCH 2/4] Fix remove wrong extended prefix

2010-03-03 Thread Zhenhua Zhang
Hi Denis, On 03/04/2010 03:17 AM, Denis Kenzior wrote: Hi Zhenhua, ATA, ATH and ATD are belongs to basic command. So removed them. All of these need to be handled by user callbacks, so effectively they need to be treated like extended commands. Especially with the weird ATD syntax rules tha

Re: [PATCH 4/4] Fix server only return the final parser result

2010-03-03 Thread Zhenhua Zhang
Hi Denis, On 03/04/2010 03:09 AM, Denis Kenzior wrote: Hi Zhenhua, In case we meet compound commands in single line, AtServer should only return the parser result of last command according to spec. So we return the parser result in the parse iteration. So I agree that we need to do this, but

[PATCH 6/7] Add notify at command callback

2010-03-03 Thread Zhenhua Zhang
Search command_list to get notification node. If the command is an action command, the type may be "action" or "support". If the command is a parameter command, the type may be either "support", "query" or "set". --- gatchat/gatserver.c | 53 +++

[PATCH 5/7] Add server at command data structure

2010-03-03 Thread Zhenhua Zhang
Implement hashtable to store server supported command list. AT command could be action command or parameter command. Defined in V.250 5.2.5. --- gatchat/gatserver.c | 29 + gatchat/gatserver.h | 21 + 2 files changed, 50 insertions(+), 0 deletio

[PATCH 3/7] Add basic command parsing

2010-03-03 Thread Zhenhua Zhang
According to V.250 5.3.1, the basic command is either a single character or the '&' followed by a single character except for 'D' and 'S'. The subparameter should be the numbers. --- gatchat/gatserver.c | 67 ++- 1 files changed, 66 insertions(+),

[PATCH 7/7] Add g_at_server_register to register callback

2010-03-03 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 47 +++ gatchat/gatserver.h |6 ++ 2 files changed, 53 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index bea51f5..c49e5f8 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserv

[PATCH 4/7] Add extended command parsing

2010-03-03 Thread Zhenhua Zhang
See V.250 5.4 Extended syntax commands for details. --- gatchat/gatserver.c | 56 ++- 1 files changed, 55 insertions(+), 1 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index b3c3f5f..4a19b6b 100644 --- a/gatchat/gatserver.c

[PATCH 2/7] Add framework of server parser

2010-03-03 Thread Zhenhua Zhang
1. The parser fetches one basic or extended command per iteration. The prefix is the command prefix without parameter. For example, in command "AT+CLIP=1", prefix is "+CLIP". 2. Search registered notification node in command_list. If found, get command type and invoke callback, and then return resu

[PATCH 1/7] Remove old server_parse_line

2010-03-03 Thread Zhenhua Zhang
--- gatchat/gatserver.c | 45 - 1 files changed, 0 insertions(+), 45 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index c9256e2..4175112 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -173,55 +173,10 @@ static voi

[PATCH 2/4] Fix remove wrong extended prefix

2010-03-02 Thread Zhenhua Zhang
ATA, ATH and ATD are belongs to basic command. So removed them. --- gatchat/gatserver.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index c72e798..253a80a 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -216,7 +2

[PATCH 3/4] Update rename result to state

2010-03-02 Thread Zhenhua Zhang
to avoid name conflict with GAtServerResult --- gatchat/gatserver.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 253a80a..df3c8bf 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -376,11 +376,11 @@ stat

[PATCH 4/4] Fix server only return the final parser result

2010-03-02 Thread Zhenhua Zhang
In case we meet compound commands in single line, AtServer should only return the parser result of last command according to spec. So we return the parser result in the parse iteration. --- gatchat/gatserver.c | 28 ++-- 1 files changed, 14 insertions(+), 14 deletions(-)

[PATCH 1/4] Add command echo back if ATE=1

2010-03-02 Thread Zhenhua Zhang
--- gatchat/gatserver.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index f19d267..c72e798 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -382,6 +382,9 @@ static void new_bytes(GAtServer *p) gsi

[PATCH] Fix remove unused variable data

2010-03-01 Thread Zhenhua Zhang
--- src/stkutil.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/src/stkutil.c b/src/stkutil.c index 337868b..6a95cd2 100644 --- a/src/stkutil.c +++ b/src/stkutil.c @@ -188,7 +188,6 @@ static gboolean parse_dataobj_imm_resp(struct comprehension_tlv_iter *iter,

Re: [PATCH 3/4] Add write buffer queue for non-blocking write

2010-02-26 Thread Zhenhua Zhang
Hi Denis, On 02/26/2010 05:56 PM, Zhang, Zhenhua wrote: The head of the queue is the data to be written, the tail is the free buffer to cache data into. If the tail of queue is full, allocate a new free buffer and append it at the tail. --- gatchat/gatserver.c | 105 +

[PATCH 1/4] Do not trigger user disconnect at g_at_shutdown

2010-02-26 Thread Zhenhua Zhang
Similar to gatchat, introduce read_watcher_destroy_notify and do not trigger user disconnect at g_at_shutdown. Delay destroy of gatserver until read_watcher is destroyed. --- gatchat/gatserver.c | 42 -- 1 files changed, 28 insertions(+), 14 deletions(-)

[PATCH 3/4] Add write buffer queue for non-blocking write

2010-02-26 Thread Zhenhua Zhang
The head of the queue is the data to be written, the tail is the free buffer to cache data into. If the tail of queue is full, allocate a new free buffer and append it at the tail. --- gatchat/gatserver.c | 105 ++- 1 files changed, 95 insertions(+

[PATCH 4/4] Add write server response into non-blocking IO

2010-02-26 Thread Zhenhua Zhang
Write server response into non-blocking GIOChannel when we have G_IO_OUT signal. --- gatchat/gatserver.c | 66 +++ 1 files changed, 66 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index a136a6f..5b5e2f7 1006

[PATCH 2/4] Add define for read and write buffer size

2010-02-26 Thread Zhenhua Zhang
--- gatchat/gatserver.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 95a9e8f..15bbbff 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -32,6 +32,8 @@ #include "ringbuffer.h" #include "gatserver.h" +#def

[PATCH] Use g_dbus_emit_signal in call-barring.c

2010-02-21 Thread Zhenhua Zhang
To make it consistent with call_barring_incoming_enabled_notify. --- src/call-barring.c | 13 ++--- 1 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/call-barring.c b/src/call-barring.c index 2a04b25..e72d522 100644 --- a/src/call-barring.c +++ b/src/call-barring.c @@ -

Re: [PATCH 1/3] Do not trigger user disconnect at g_at_shutdown

2010-02-21 Thread Zhenhua Zhang
Hi, I rebased my patches for modem emulator and did some updates: 1. Patch 1/3 is the same as 4/4 sent on Feb 9th. 2. Patch 2/3 is updated according to Denis's comments. So we only have one full list at all. 3. Patch 3/3 is to fetch data from full list and write them into non blocking IO. Pl

[PATCH 3/3] Add write server response into non-blocking IO

2010-02-21 Thread Zhenhua Zhang
Write server response into non-blocking GIOChannel when we have G_IO_OUT signal. --- gatchat/gatserver.c | 68 +++ 1 files changed, 68 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 7e11359..a9e0341 1006

[PATCH 1/3] Do not trigger user disconnect at g_at_shutdown

2010-02-21 Thread Zhenhua Zhang
Similar to gatchat, introduce read_watcher_destroy_notify and do not trigger user disconnect at g_at_shutdown. Delay destroy of gatserver until read_watcher is destroyed. --- gatchat/gatserver.c | 44 ++-- 1 files changed, 30 insertions(+), 14 deletions(-)

[PATCH 2/3] Add write buffer for non-blocking write

2010-02-21 Thread Zhenhua Zhang
Use two layers to cache server side response data to client. 1. A fixed-length ring buffer, that is write_buf. 2. A list of full ring buffer. The head is to write data out to the client and the tail is to cache response data in. At least one buffer is in the list. When the first layer buffer is fu

[PATCH 3/3] Add write server response into non blocking IO

2010-02-10 Thread Zhenhua Zhang
This and previous patch are for writing server response into non-blocking GIOChannel when we have G_IO_OUT signal. --- gatchat/gatserver.c | 67 +++ 1 files changed, 67 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatse

[PATCH 1/3] Add write ring buffer for non-blocking write

2010-02-10 Thread Zhenhua Zhang
Use two layers to cache server side response data to client. 1. A fixed-length ring buffer. 2. A list of free ring buffers and a list of empty full ring buffer. If current ring buffer is full, put it into full buffer list and fetch a free buffer frome free list. --- gatchat/gatserver.c | 106 +++

[PATCH 2/3] Add handle the case when write buffer is full

2010-02-10 Thread Zhenhua Zhang
If current write_buf is fulled, put it into the full list and fetch a new ring buffer from the free list. --- gatchat/gatserver.c | 63 -- 1 files changed, 60 insertions(+), 3 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c ind

Re: [PATCH 1/4] Add write ring buffer for non-blocking write

2010-02-10 Thread Zhenhua Zhang
Hi Padovan, On 02/11/2010 01:23 AM, Gustavo F. Padovan wrote: * Zhenhua Zhang [2010-02-10 16:13:40 +0800]: + + for (i = 0; i< MAX_BUFFER_NUM; i++) { +#ifdef WRITE_SCHEDULER_DEBUG + buf = ring_buffer_new(4); +#else + buf = ring_buffer_new(4096); +#endif

[PATCH 3/4] Add ring_buffer_read_advance for partial write

2010-02-10 Thread Zhenhua Zhang
These two patches are for server side partial write. When server writes data into non-blocking IO, we first get the read pointer of write_buf and write data as much as we can. Then we advance the read_ptr according to the real bytes written. --- gatchat/ringbuffer.c |8 gatchat/ringb

[PATCH 2/4] Add handle the case when write buffer is full

2010-02-10 Thread Zhenhua Zhang
If current write_buf is fulled, put it into the full list and fetch a new ring buffer from the free list. --- gatchat/gatserver.c | 63 -- 1 files changed, 60 insertions(+), 3 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c ind

[PATCH 4/4] Add write server response into non blocking IO

2010-02-10 Thread Zhenhua Zhang
This and previous patch are for writing server response into non-blocking GIOChannel when we have G_IO_OUT signal. --- gatchat/gatserver.c | 67 +++ 1 files changed, 67 insertions(+), 0 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatse

[PATCH 1/4] Add write ring buffer for non-blocking write

2010-02-10 Thread Zhenhua Zhang
Use two layers to cache server side response data to client. 1. A fixed-length ring buffer. 2. A list of free ring buffers and a list of empty full ring buffer. If current ring buffer is full, put it into full buffer list and fetch a free buffer frome free list. --- gatchat/gatserver.c | 111 +++

[PATCH 4/4] Do not trigger user disconnect at g_at_shutdown

2010-02-09 Thread Zhenhua Zhang
Similar to gatchat, introduce read_watcher_destroy_notify and do not trigger user disconnect at g_at_shutdown. Delay destroy of gatserver until read_watcher is destroyed. --- gatchat/gatserver.c | 44 ++-- 1 files changed, 30 insertions(+), 14 deletions(-)

[PATCH 2/4] Replace sprintf with snprintf

2010-02-09 Thread Zhenhua Zhang
--- gatchat/gatserver.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 16c976d..ad6afb9 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -116,9 +116,10 @@ static void g_at_server_send_result(GAtServer *serve

[PATCH 1/4] Rename buf to read_buf in GAtServer

2010-02-09 Thread Zhenhua Zhang
Because we may introduce write_buf for sever response buffer. --- gatchat/gatserver.c | 54 +- 1 files changed, 27 insertions(+), 27 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index a01ded6..16c976d 100644 --- a/gatchat/ga

[PATCH 3/4] Rename server_io to channel

2010-02-09 Thread Zhenhua Zhang
To make it consistent with GAtChat. --- gatchat/gatserver.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index ad6afb9..d131b0c 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -88,7 +88,7 @@ struct v250_

<    1   2   3   4   >