mirror of git://git.sysmocom.de/ofono
atmodem: Update parse_clcc utility function
This commit is contained in:
parent
394069cb59
commit
0026ae3fb7
|
@ -115,13 +115,14 @@ gint at_util_call_compare(gconstpointer a, gconstpointer b)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
GSList *at_util_parse_clcc(GAtResult *result)
|
GSList *at_util_parse_clcc(GAtResult *result, unsigned int *ret_mpty_ids)
|
||||||
{
|
{
|
||||||
GAtResultIter iter;
|
GAtResultIter iter;
|
||||||
GSList *l = NULL;
|
GSList *l = NULL;
|
||||||
int id, dir, status, type;
|
int id, dir, status, type;
|
||||||
ofono_bool_t mpty;
|
ofono_bool_t mpty;
|
||||||
struct ofono_call *call;
|
struct ofono_call *call;
|
||||||
|
unsigned int mpty_ids = 0;
|
||||||
|
|
||||||
g_at_result_iter_init(&iter, result);
|
g_at_result_iter_init(&iter, result);
|
||||||
|
|
||||||
|
@ -173,8 +174,14 @@ GSList *at_util_parse_clcc(GAtResult *result)
|
||||||
call->clip_validity = 2;
|
call->clip_validity = 2;
|
||||||
|
|
||||||
l = g_slist_insert_sorted(l, call, at_util_call_compare);
|
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;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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_phone_number(gconstpointer a, gconstpointer b);
|
||||||
gint at_util_call_compare_by_id(gconstpointer a, gconstpointer b);
|
gint at_util_call_compare_by_id(gconstpointer a, gconstpointer b);
|
||||||
gint at_util_call_compare(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,
|
gboolean at_util_parse_reg(GAtResult *result, const char *prefix,
|
||||||
int *mode, int *status,
|
int *mode, int *status,
|
||||||
int *lac, int *ci, int *tech,
|
int *lac, int *ci, int *tech,
|
||||||
|
|
|
@ -167,7 +167,7 @@ static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
calls = at_util_parse_clcc(result);
|
calls = at_util_parse_clcc(result, NULL);
|
||||||
|
|
||||||
n = calls;
|
n = calls;
|
||||||
o = vd->calls;
|
o = vd->calls;
|
||||||
|
@ -477,7 +477,7 @@ static void clcc_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vd->calls = at_util_parse_clcc(result);
|
vd->calls = at_util_parse_clcc(result, NULL);
|
||||||
|
|
||||||
for (l = vd->calls; l; l = l->next)
|
for (l = vd->calls; l; l = l->next)
|
||||||
ofono_voicecall_notify(vc, l->data);
|
ofono_voicecall_notify(vc, l->data);
|
||||||
|
|
Loading…
Reference in New Issue