From 372edf4f21d151063483c670f0dd20a2963a33fe Mon Sep 17 00:00:00 2001 From: Zhenhua Zhang Date: Sat, 7 Nov 2009 15:21:25 +0800 Subject: 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) --- drivers/atmodem/atutil.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/atmodem/atutil.c') diff --git a/drivers/atmodem/atutil.c b/drivers/atmodem/atutil.c index 26d0c259..687a466f 100644 --- a/drivers/atmodem/atutil.c +++ b/drivers/atmodem/atutil.c @@ -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; -- cgit v1.2.3