All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Message Waiting fixes
@ 2009-09-10 15:03 Andrzej Zaborowski
  2009-09-10 21:31 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Andrzej Zaborowski @ 2009-09-10 15:03 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 187 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-Fix-parsing-of-Enhanced-Voicemail-notifications.patch --]
[-- Type: text/x-patch, Size: 1794 bytes --]

From 5d98f8360bb46d5c10a2a613f10934b5153eb5d0 Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <andrew.zaborowski@intel.com>
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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0003-Fix-generation-of-Message-Waiting-PropertyChanged-si.patch --]
[-- Type: text/x-patch, Size: 1596 bytes --]

From 513355904fe712be47844726037aa9ebb8843c6a Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <andrew.zaborowski@intel.com>
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-10 21:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-10 15:03 [PATCH] Message Waiting fixes Andrzej Zaborowski
2009-09-10 21:31 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.