From: Pekka Pessi <pekka.pe...@nokia.com>

Including the ssn code as an argument in notify callbacks allows
handling of multiple notifications in single function.
---
 src/ofono.h |    4 ++--
 src/ssn.c   |    8 ++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/ofono.h b/src/ofono.h
index df20103..e8c24a9 100644
--- a/src/ofono.h
+++ b/src/ofono.h
@@ -313,8 +313,8 @@ int __ofono_sms_sim_download(struct ofono_stk *stk, const 
struct sms *msg,
 
 #include <ofono/ssn.h>
 
-typedef void (*ofono_ssn_mo_notify_cb)(int index, void *user);
-typedef void (*ofono_ssn_mt_notify_cb)(int index,
+typedef void (*ofono_ssn_mo_notify_cb)(int index, int mo_code, void *user);
+typedef void (*ofono_ssn_mt_notify_cb)(int index, int mt_code,
                                        const struct ofono_phone_number *ph,
                                        void *user);
 
diff --git a/src/ssn.c b/src/ssn.c
index 64c94b7..00da3a6 100644
--- a/src/ssn.c
+++ b/src/ssn.c
@@ -118,12 +118,14 @@ void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, int 
code1, int index)
        GSList *l;
        ofono_ssn_mo_notify_cb notify;
 
+       DBG("ssn %p, code %u, index %u", (void *)ssn, code1, index);
+
        for (l = ssn->mo_handler_list->items; l; l = l->next) {
                h = l->data;
                notify = h->item.notify;
 
                if (h->code == code1)
-                       notify(index, h->item.notify_data);
+                       notify(index, code1, h->item.notify_data);
        }
 }
 
@@ -134,12 +136,14 @@ void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, int 
code2, int index,
        GSList *l;
        ofono_ssn_mt_notify_cb notify;
 
+       DBG("ssn %p, code %u, index %u", (void *)ssn, code2, index);
+
        for (l = ssn->mt_handler_list->items; l; l = l->next) {
                h = l->data;
                notify = h->item.notify;
 
                if (h->code == code2)
-                       notify(index, ph, h->item.notify_data);
+                       notify(index, code2, ph, h->item.notify_data);
        }
 }
 
-- 
1.7.1

_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to