diff options
author | Zhenhua Zhang <zhenhua.zhang@intel.com> | 2009-11-13 00:32:19 +0800 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-11-12 11:23:05 -0600 |
commit | 9b084e965662d82c14661ab721e270039217d8e5 (patch) | |
tree | 1f8dac2af3a343338b9b3ab676826c11e63f9a54 /drivers/atmodem/voicecall.c | |
parent | 20e9ff8551f2efe6d7a68ce1b5cb3e6c510c1365 (diff) | |
download | ofono-9b084e965662d82c14661ab721e270039217d8e5.tar.bz2 |
Use at_util_parse_clcc in atmodem
Replace parse_clcc by at_util_parse_clcc in atmodem voicecall.
Diffstat (limited to 'drivers/atmodem/voicecall.c')
-rw-r--r-- | drivers/atmodem/voicecall.c | 59 |
1 files changed, 2 insertions, 57 deletions
diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c index 9ed36960..9dae1c83 100644 --- a/drivers/atmodem/voicecall.c +++ b/drivers/atmodem/voicecall.c @@ -119,61 +119,6 @@ static struct ofono_call *create_call(struct voicecall_data *d, int type, return call; } -static GSList *parse_clcc(GAtResult *result) -{ - GAtResultIter iter; - GSList *l = NULL; - int id, dir, status, type; - struct ofono_call *call; - - g_at_result_iter_init(&iter, result); - - while (g_at_result_iter_next(&iter, "+CLCC:")) { - const char *str = ""; - int number_type = 129; - - if (!g_at_result_iter_next_number(&iter, &id)) - continue; - - if (!g_at_result_iter_next_number(&iter, &dir)) - continue; - - if (!g_at_result_iter_next_number(&iter, &status)) - continue; - - if (!g_at_result_iter_next_number(&iter, &type)) - continue; - - if (!g_at_result_iter_skip_next(&iter)) - continue; - - if (g_at_result_iter_next_string(&iter, &str)) - g_at_result_iter_next_number(&iter, &number_type); - - call = g_try_new0(struct ofono_call, 1); - - if (!call) - break; - - call->id = id; - call->direction = dir; - call->status = status; - call->type = type; - strncpy(call->phone_number.number, str, - OFONO_MAX_PHONE_NUMBER_LENGTH); - call->phone_number.type = number_type; - - if (strlen(call->phone_number.number) > 0) - call->clip_validity = 0; - else - call->clip_validity = 2; - - l = g_slist_insert_sorted(l, call, at_util_call_compare); - } - - return l; -} - static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data) { struct ofono_voicecall *vc = user_data; @@ -191,7 +136,7 @@ static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data) return; } - calls = parse_clcc(result); + calls = at_util_parse_clcc(result); n = calls; o = vd->calls; @@ -482,7 +427,7 @@ static void clcc_cb(gboolean ok, GAtResult *result, gpointer user_data) goto out; } - calls = parse_clcc(result); + calls = at_util_parse_clcc(result); if (calls == NULL) { CALLBACK_WITH_FAILURE(cb, 0, NULL, cbd->data); |