From ffd7c1920abb04e319f0146e1990d95d0109c9c4 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 23 Oct 2009 15:17:55 -0500 Subject: [PATCH] Fix: Some modems report PDP_type in a list --- drivers/atmodem/gprs.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/atmodem/gprs.c b/drivers/atmodem/gprs.c index d60fbca..27a3f56 100644 --- a/drivers/atmodem/gprs.c +++ b/drivers/atmodem/gprs.c @@ -232,6 +232,8 @@ static void at_cgdcont_test_cb(gboolean ok, GAtResult *result, g_at_result_iter_init(&iter, result); while (!found && g_at_result_iter_next(&iter, "+CGDCONT:")) { + gboolean in_list = FALSE; + if (!g_at_result_iter_open_list(&iter)) continue; @@ -241,11 +243,17 @@ static void at_cgdcont_test_cb(gboolean ok, GAtResult *result, if (!g_at_result_iter_close_list(&iter)) continue; + if (g_at_result_iter_open_list(&iter)) + in_list = TRUE; + if (!g_at_result_iter_next_string(&iter, &pdp_type)) continue; + if (in_list && !g_at_result_iter_close_list(&iter)) + continue; + /* We look for IP PDPs */ - if (!strcmp(pdp_type, "IP")) + if (g_str_equal(pdp_type, "IP")) found = TRUE; } -- 2.7.4