diff options
-rw-r--r-- | drivers/atmodem/atutil.c | 14 | ||||
-rw-r--r-- | drivers/atmodem/atutil.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/atmodem/atutil.c b/drivers/atmodem/atutil.c index ab529991..28a192a4 100644 --- a/drivers/atmodem/atutil.c +++ b/drivers/atmodem/atutil.c @@ -77,6 +77,20 @@ gint at_util_call_compare_by_phone_number(gconstpointer a, gconstpointer b) sizeof(struct ofono_phone_number)); } +gint at_util_call_compare_by_id(gconstpointer a, gconstpointer b) +{ + const struct ofono_call *call = a; + unsigned int id = GPOINTER_TO_UINT(b); + + if (id < call->id) + return -1; + + if (id > call->id) + return 1; + + return 0; +} + gint at_util_call_compare(gconstpointer a, gconstpointer b) { const struct ofono_call *ca = a; diff --git a/drivers/atmodem/atutil.h b/drivers/atmodem/atutil.h index 0ab207df..fc5b041d 100644 --- a/drivers/atmodem/atutil.h +++ b/drivers/atmodem/atutil.h @@ -23,6 +23,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_by_id(gconstpointer a, gconstpointer b); gint at_util_call_compare(gconstpointer a, gconstpointer b); GSList *at_util_parse_clcc(GAtResult *result); gboolean at_util_parse_reg(GAtResult *result, const char *prefix, |