[PATCH 1/6] STE-plugin: Add at_util_call_compare_by_id
sjur.brandeland at stericsson.com
sjur.brandeland at stericsson.com
Mon Jan 25 11:25:28 PST 2010
Add function at_util_call_compare_by_phone_number() to atutil.c
---
drivers/atmodem/atutil.c | 14 ++++++++++++++
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 ab52999..28a192a 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 0ab207d..fc5b041 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,
--
1.6.0.4
More information about the ofono
mailing list