From 0026ae3fb71925fdd90739b8447ad3ae18d111fe Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 10 Sep 2013 10:57:42 -0500 Subject: atmodem: Update parse_clcc utility function --- drivers/atmodem/atutil.c | 9 ++++++++- drivers/atmodem/atutil.h | 2 +- drivers/atmodem/voicecall.c | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/atmodem/atutil.c b/drivers/atmodem/atutil.c index 1227b4d7..14873483 100644 --- a/drivers/atmodem/atutil.c +++ b/drivers/atmodem/atutil.c @@ -115,13 +115,14 @@ gint at_util_call_compare(gconstpointer a, gconstpointer b) return 0; } -GSList *at_util_parse_clcc(GAtResult *result) +GSList *at_util_parse_clcc(GAtResult *result, unsigned int *ret_mpty_ids) { GAtResultIter iter; GSList *l = NULL; int id, dir, status, type; ofono_bool_t mpty; struct ofono_call *call; + unsigned int mpty_ids = 0; g_at_result_iter_init(&iter, result); @@ -173,8 +174,14 @@ GSList *at_util_parse_clcc(GAtResult *result) call->clip_validity = 2; l = g_slist_insert_sorted(l, call, at_util_call_compare); + + if (mpty) + mpty_ids |= 1 << id; } + if (ret_mpty_ids) + *ret_mpty_ids = mpty_ids; + return l; } diff --git a/drivers/atmodem/atutil.h b/drivers/atmodem/atutil.h index 48b9b0d3..5cb88b78 100644 --- a/drivers/atmodem/atutil.h +++ b/drivers/atmodem/atutil.h @@ -55,7 +55,7 @@ gint at_util_call_compare_by_status(gconstpointer a, gconstpointer b); gint at_util_call_compare_by_phone_number(gconstpointer a, gconstpointer b); gint at_util_call_compare_by_id(gconstpointer a, gconstpointer b); gint at_util_call_compare(gconstpointer a, gconstpointer b); -GSList *at_util_parse_clcc(GAtResult *result); +GSList *at_util_parse_clcc(GAtResult *result, unsigned int *mpty_ids); gboolean at_util_parse_reg(GAtResult *result, const char *prefix, int *mode, int *status, int *lac, int *ci, int *tech, diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c index e27eb475..7d823a26 100644 --- a/drivers/atmodem/voicecall.c +++ b/drivers/atmodem/voicecall.c @@ -167,7 +167,7 @@ static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data) return; } - calls = at_util_parse_clcc(result); + calls = at_util_parse_clcc(result, NULL); n = calls; o = vd->calls; @@ -477,7 +477,7 @@ static void clcc_cb(gboolean ok, GAtResult *result, gpointer user_data) if (!ok) return; - vd->calls = at_util_parse_clcc(result); + vd->calls = at_util_parse_clcc(result, NULL); for (l = vd->calls; l; l = l->next) ofono_voicecall_notify(vc, l->data); -- cgit v1.2.3