Re: [PATCH 01/11] Rename g_at_server_send_result

2010-03-17 Thread Denis Kenzior
Hi Zhenhua,

> Sorry, I forgot the first patch. Please review the first patch as
> attached. Otherwise, these patches could not be applied.

Please get rid of this patch and rebase the rest appropriately.  I mentioned 
in the other reply, there's no sense to remove a bunch of code only to add 
nearly the same back in.

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


Re: [PATCH 01/11] Rename g_at_server_send_result

2010-03-17 Thread Zhenhua Zhang

Hi

On 03/17/2010 10:30 PM, Zhang, Zhenhua wrote:

Rename it to g_at_server_send_final.
---
  gatchat/gatserver.c |6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)



Sorry, I forgot the first patch. Please review the first patch as 
attached. Otherwise, these patches could not be 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 files changed, 0 insertions(+), 49 deletions(-)

diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index 079451f..7577de2 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -173,57 +173,8 @@ static void g_at_server_send_result(GAtServer *server, GAtServerResult result)
 	send_common(server, buf, MIN(len, sizeof(buf)-1));
 }
 
-static inline gboolean is_at_command_prefix(const char c)
-{
-	switch (c) {
-	case '+':
-	case '*':
-	case '!':
-	case '%':
-		return TRUE;
-	default:
-		return FALSE;
-	}
-}
-
-static void parse_at_command(GAtServer *server, char *buf)
-{
-	g_at_server_send_result(server, G_AT_SERVER_RESULT_ERROR);
-}
-
-static void parse_v250_settings(GAtServer *server, char *buf)
-{
-	g_at_server_send_result(server, G_AT_SERVER_RESULT_ERROR);
-}
-
 static void server_parse_line(GAtServer *server, char *line)
 {
-	gsize i = 0;
-	char c;
-
-	if (line == NULL) {
-		g_at_server_send_result(server, G_AT_SERVER_RESULT_ERROR);
-		goto done;
-	}
-
-	if (line[0] == '\0') {
-		g_at_server_send_result(server, G_AT_SERVER_RESULT_OK);
-		goto done;
-	}
-
-	c = line[i];
-	/* skip semicolon */
-	if (c == ';')
-		c = line[++i];
-
-	if (is_at_command_prefix(c) || c == 'A' || c == 'D' || c == 'H')
-		parse_at_command(server, line + i);
-	else if (g_ascii_isalpha(c) || c == '&')
-		parse_v250_settings(server, line + i);
-	else
-		g_at_server_send_result(server, G_AT_SERVER_RESULT_ERROR);
-
-done:
 	g_free(line);
 }
 
-- 
1.6.6.1

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


[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 send_common(GAtServer *server, const char *buf, 
unsigned int len)
g_at_server_wakeup_writer(server);
 }
 
-static void g_at_server_send_result(GAtServer *server, GAtServerResult result)
+static void g_at_server_send_final(GAtServer *server, GAtServerResult result)
 {
struct v250_settings v250 = server->v250;
const char *result_str = server_result_to_string(result);
@@ -353,7 +353,7 @@ static void new_bytes(GAtServer *p)
 * According to section 5.2.4 and 5.6 of V250,
 * Empty commands must be OK by the DCE
 */
-   g_at_server_send_result(p, G_AT_SERVER_RESULT_OK);
+   g_at_server_send_final(p, G_AT_SERVER_RESULT_OK);
ring_buffer_drain(p->read_buf, p->read_so_far);
break;
 
@@ -363,7 +363,7 @@ static void new_bytes(GAtServer *p)
 
case PARSER_RESULT_REPEAT_LAST:
/* TODO */
-   g_at_server_send_result(p, G_AT_SERVER_RESULT_OK);
+   g_at_server_send_final(p, G_AT_SERVER_RESULT_OK);
ring_buffer_drain(p->read_buf, p->read_so_far);
break;
 
-- 
1.6.6.1

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