From 92404672fcd782588e32e06367f223d40d5d0224 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 25 Feb 2011 20:36:15 -0600 Subject: [PATCH] gatserver: Update the internal command parsers commit 61b30c025d3d461bfd577de29f27f4f9a5546213 changed the way the command callbacks are being called (namely the contents of the GAtResult object). Most command callbacks were updated, but the internal ones were forgotten. This patch fixes this issue. --- gatchat/gatserver.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 2009498..f0fcb53 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -257,21 +257,14 @@ void g_at_server_send_info(GAtServer *server, const char *line, gboolean last) } static gboolean get_result_value(GAtServer *server, GAtResult *result, - const char *command, int min, int max, int *value) { GAtResultIter iter; int val; - char prefix[10]; - - if (command[0] == 'S') - sprintf(prefix, "%s=", command); - else - strcpy(prefix, command); g_at_result_iter_init(&iter, result); - if (!g_at_result_iter_next(&iter, prefix)) + if (!g_at_result_iter_next(&iter, "")) return FALSE; if (!g_at_result_iter_next_number(&iter, &val)) @@ -294,7 +287,7 @@ static void s_template_cb(GAtServerRequestType type, GAtResult *result, switch (type) { case G_AT_SERVER_REQUEST_TYPE_SET: - if (!get_result_value(server, result, prefix, min, max, &tmp)) { + if (!get_result_value(server, result, min, max, &tmp)) { g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR); return; @@ -357,7 +350,7 @@ static void at_template_cb(GAtServerRequestType type, GAtResult *result, switch (type) { case G_AT_SERVER_REQUEST_TYPE_SET: - if (!get_result_value(server, result, prefix, min, max, &tmp)) { + if (!get_result_value(server, result, min, max, &tmp)) { g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR); return; -- 2.7.4