Hi, attached are two more changes to make the message waiting interface functional with notifications from the network (I only properly tested the SIM access part before).
Regards
From 5d98f8360bb46d5c10a2a613f10934b5153eb5d0 Mon Sep 17 00:00:00 2001 From: Andrzej Zaborowski <[email protected]> Date: Thu, 10 Sep 2009 18:37:40 +0200 Subject: [PATCH] Fix parsing of Enhanced Voicemail notifications. --- src/message-waiting.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/message-waiting.c b/src/message-waiting.c index 3666875..057660c 100644 --- a/src/message-waiting.c +++ b/src/message-waiting.c @@ -554,7 +554,7 @@ static void handle_enhanced_voicemail_iei(struct ofono_message_waiting *mw, /* 9.2.3.24.13.1 Enhanced Voice Mail Notification */ /* MULTIPLE_SUBSCRIBER_PROFILE */ - profile = (iei[0] >> 2) & 3; + profile = ((iei[0] >> 2) & 3) + 1; /* SM_STORAGE */ if (discard) @@ -570,14 +570,17 @@ static void handle_enhanced_voicemail_iei(struct ofono_message_waiting *mw, /* Other parameters currently not supported */ - set = iei[n + 2] > 0 ? TRUE : FALSE; + if (length < n + 3) + return; + + set = iei[n + 1] > 0 ? TRUE : FALSE; mw_set_indicator(mw, profile, SMS_MWI_TYPE_VOICE, - set, iei[n + 2]); + set, iei[n + 1]); } else { /* 9.2.3.24.13.2 Enhanced Voice Delete Confirmation */ /* MULTIPLE_SUBSCRIBER_PROFILE */ - profile = (iei[0] >> 2) & 3; + profile = ((iei[0] >> 2) & 3) + 1; /* SM_STORAGE */ if (discard) @@ -591,9 +594,12 @@ static void handle_enhanced_voicemail_iei(struct ofono_message_waiting *mw, /* Other parameters currently not supported */ - set = iei[n + 2] > 0 ? TRUE : FALSE; + if (length < n + 3) + return; + + set = iei[n + 1] > 0 ? TRUE : FALSE; mw_set_indicator(mw, profile, SMS_MWI_TYPE_VOICE, - set, iei[n + 2]); + set, iei[n + 1]); } if (mailbox_address.address[0] != '\0') -- 1.6.1
From 513355904fe712be47844726037aa9ebb8843c6a Mon Sep 17 00:00:00 2001 From: Andrzej Zaborowski <[email protected]> Date: Thu, 10 Sep 2009 18:39:07 +0200 Subject: [PATCH] Fix generation of Message Waiting PropertyChanged signals. --- src/message-waiting.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/message-waiting.c b/src/message-waiting.c index 057660c..94a5b6c 100644 --- a/src/message-waiting.c +++ b/src/message-waiting.c @@ -211,7 +211,7 @@ static DBusMessage *set_mbdn(struct ofono_message_waiting *mw, int mailbox, req->mw = mw; req->mailbox = mailbox; string_to_phone_number(number, &req->number); - req->msg = dbus_message_ref(msg); + req->msg = msg ? dbus_message_ref(msg) : NULL; sim_adn_build(efmbdn, req->mw->efmbdn_length, &req->number, NULL); @@ -468,7 +468,7 @@ static void mw_set_indicator(struct ofono_message_waiting *mw, int profile, indication = present; mw->messages[type].indication = present; - if (!mw_message_waiting_property_name[type]) + if (mw_message_waiting_property_name[type]) ofono_dbus_signal_property_changed(conn, path, MESSAGE_WAITING_INTERFACE, mw_message_waiting_property_name[type], @@ -480,7 +480,7 @@ static void mw_set_indicator(struct ofono_message_waiting *mw, int profile, mw->messages[type].message_count = messages; - if (!mw_message_waiting_property_name[type]) + if (mw_message_waiting_property_name[type]) ofono_dbus_signal_property_changed(conn, path, MESSAGE_WAITING_INTERFACE, mw_message_count_property_name[type], -- 1.6.1
_______________________________________________ ofono mailing list [email protected] http://lists.ofono.org/listinfo/ofono
