summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-02-25 20:36:15 -0600
committerDenis Kenzior <denkenz@gmail.com>2011-02-28 16:13:51 -0600
commit92404672fcd782588e32e06367f223d40d5d0224 (patch)
treefd4a0d12477de2945b6bf2d553bcdd9a90754449
parent8db0fa145a2a22662a41faa2ee5a6c34376f4073 (diff)
downloadofono-92404672fcd782588e32e06367f223d40d5d0224.tar.bz2
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.
-rw-r--r--gatchat/gatserver.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index 2009498e..f0fcb535 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;