summaryrefslogtreecommitdiffstats
path: root/gatchat
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-08-14 23:11:03 -0500
committerDenis Kenzior <denkenz@gmail.com>2011-08-14 23:11:03 -0500
commita897ed5e53d895ab1a1857d82a163e6e6d6e25f9 (patch)
tree5d72ebbd6703cdf79d1aad846ed53e3d153801f5 /gatchat
parent5bd2b86ace44fe8d0e28c12fa31a80468a2f0fcd (diff)
downloadofono-a897ed5e53d895ab1a1857d82a163e6e6d6e25f9.tar.bz2
gatserver: Fix not sending OK final response
Diffstat (limited to 'gatchat')
-rw-r--r--gatchat/gatserver.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index 8da57c7c..83be1020 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -197,9 +197,19 @@ static void send_result_common(GAtServer *server, const char *result)
send_common(server, buf, len);
}
-void g_at_server_send_final(GAtServer *server, GAtServerResult result)
+static inline void send_numeric(GAtServer *server, GAtServerResult result)
{
char buf[1024];
+ if (server->v250.is_v1)
+ sprintf(buf, "%s", server_result_to_string(result));
+ else
+ sprintf(buf, "%u", (unsigned int)result);
+
+ send_result_common(server, buf);
+}
+
+void g_at_server_send_final(GAtServer *server, GAtServerResult result)
+{
server->final_sent = TRUE;
server->last_result = result;
@@ -211,12 +221,7 @@ void g_at_server_send_final(GAtServer *server, GAtServerResult result)
return;
}
- if (server->v250.is_v1)
- sprintf(buf, "%s", server_result_to_string(result));
- else
- sprintf(buf, "%u", (unsigned int)result);
-
- send_result_common(server, buf);
+ send_numeric(server, result);
}
void g_at_server_send_ext_final(GAtServer *server, const char *result)
@@ -836,7 +841,7 @@ static void server_parse_line(GAtServer *server)
return;
}
- g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+ send_numeric(server, G_AT_SERVER_RESULT_OK);
}
static enum ParserResult server_feed(GAtServer *server,