Open Source Telephony
 help / color / mirror / Atom feed
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis <frederic.danis@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH] hfpmodem: fix network status
Date: Tue, 26 Jul 2011 16:56:53 +0200	[thread overview]
Message-ID: <1311692213-18020-1-git-send-email-frederic.danis@linux.intel.com> (raw)

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

When receiving roaming indicator update to 0 (no roaming) network
registration status should be updated with latest value of service
indicator.
---
 drivers/hfpmodem/network-registration.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/hfpmodem/network-registration.c b/drivers/hfpmodem/network-registration.c
index 4cb2b14..7d26424 100644
--- a/drivers/hfpmodem/network-registration.c
+++ b/drivers/hfpmodem/network-registration.c
@@ -130,10 +130,14 @@ static void ciev_notify(GAtResult *result, gpointer user_data)
 	} else if (index == nd->cind_pos[HFP_INDICATOR_ROAM]) {
 		nd->cind_val[HFP_INDICATOR_ROAM] = value;
 
-		if (value) {
+		if (value)
 			status = NETWORK_REGISTRATION_STATUS_ROAMING;
-			ofono_netreg_status_notify(netreg, status, -1, -1, -1);
-		}
+		else if (nd->cind_val[HFP_INDICATOR_SERVICE])
+			status = NETWORK_REGISTRATION_STATUS_REGISTERED;
+		else
+			status = NETWORK_REGISTRATION_STATUS_NOT_REGISTERED;
+
+		ofono_netreg_status_notify(netreg, status, -1, -1, -1);
 	} else if (index == nd->cind_pos[HFP_INDICATOR_SIGNAL]) {
 		nd->cind_val[HFP_INDICATOR_SIGNAL] = value;
 		ofono_netreg_strength_notify(netreg, value * 20);
-- 
1.7.1


             reply	other threads:[~2011-07-26 14:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26 14:56 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis [this message]
2011-07-26  4:09 ` [PATCH] hfpmodem: fix network status Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311692213-18020-1-git-send-email-frederic.danis@linux.intel.com \
    --to=frederic.danis@linux.intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox