summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2013-09-10 10:57:42 -0500
committerDenis Kenzior <denkenz@gmail.com>2013-09-12 13:17:39 -0500
commit0026ae3fb71925fdd90739b8447ad3ae18d111fe (patch)
tree38cfaeefa67c2be28d78e3dda9b1beb81a6a7113
parent394069cb595cb1d9da0afe9ce481356bf6985fda (diff)
atmodem: Update parse_clcc utility function
-rw-r--r--drivers/atmodem/atutil.c9
-rw-r--r--drivers/atmodem/atutil.h2
-rw-r--r--drivers/atmodem/voicecall.c4
3 files changed, 11 insertions, 4 deletions
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);