Add call_compare_by_phone_number utility function

This utility will be used by HFP voicecall driver to compare
two calls. In some hardware, the call index may be shift when
a call transitions from waiting to incoming state (e.g. all other
held and active calls are released)
This commit is contained in:
Zhenhua Zhang 2009-11-07 15:21:25 +08:00 committed by Denis Kenzior
parent 95aafed445
commit 372edf4f21
2 changed files with 10 additions and 0 deletions

View File

@ -67,6 +67,15 @@ gint at_util_call_compare_by_status(gconstpointer a, gconstpointer b)
return 0;
}
gint at_util_call_compare_by_phone_number(gconstpointer a, gconstpointer b)
{
const struct ofono_call *call = a;
const struct ofono_phone_number *pb = b;
return memcmp(&call->phone_number, pb,
sizeof(struct ofono_phone_number));
}
gint at_util_call_compare(gconstpointer a, gconstpointer b)
{
const struct ofono_call *ca = a;

View File

@ -22,6 +22,7 @@
void decode_at_error(struct ofono_error *error, const char *final);
void dump_response(const char *func, gboolean ok, GAtResult *result);
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(gconstpointer a, gconstpointer b);
unsigned int at_util_alloc_next_id(unsigned int *id_list);
void at_util_release_id(unsigned int *id_list, unsigned int id);