Open Source Telephony
 help / color / mirror / Atom feed
From: Marit Henriksen <maritsofie.henriksen8@gmail.com>
To: ofono@ofono.org
Subject: [PATCHv2] network: query signal strength
Date: Fri, 17 Dec 2010 10:46:04 +0100	[thread overview]
Message-ID: <1292579164-24372-1-git-send-email-maritsofie.henriksen8@gmail.com> (raw)

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

From: Marit Henriksen <marit.henriksen@stericsson.com>

Signal strength is set to -1 whenever registration status changes
and differs from registered or roaming. When registration status
changes again to registered or roaming, the signal strength needs to
be updated, added query towards driver to get it.
---
 src/network.c |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/src/network.c b/src/network.c
index d203bee..50539a2 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1296,6 +1296,19 @@ emit:
 	notify_status_watches(netreg);
 }
 
+static void signal_strength_callback(const struct ofono_error *error,
+					int strength, void *data)
+{
+	struct ofono_netreg *netreg = data;
+
+	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
+		DBG("Error during signal strength query");
+		return;
+	}
+
+	ofono_netreg_strength_notify(netreg, strength);
+}
+
 void ofono_netreg_status_notify(struct ofono_netreg *netreg, int status,
 			int lac, int ci, int tech)
 {
@@ -1319,6 +1332,9 @@ void ofono_netreg_status_notify(struct ofono_netreg *netreg, int status,
 		if (netreg->driver->current_operator)
 			netreg->driver->current_operator(netreg,
 					current_operator_callback, netreg);
+		if (netreg->driver->strength)
+			netreg->driver->strength(netreg,
+					signal_strength_callback, netreg);
 	} else {
 		struct ofono_error error;
 
@@ -1345,18 +1361,6 @@ void ofono_netreg_time_notify(struct ofono_netreg *netreg,
 	__ofono_nettime_info_received(modem, info);
 }
 
-static void signal_strength_callback(const struct ofono_error *error,
-					int strength, void *data)
-{
-	struct ofono_netreg *netreg = data;
-
-	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during signal strength query");
-		return;
-	}
-
-	ofono_netreg_strength_notify(netreg, strength);
-}
 
 static void init_registration_status(const struct ofono_error *error,
 					int status, int lac, int ci, int tech,
-- 
1.7.1


             reply	other threads:[~2010-12-17  9:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-17  9:46 Marit Henriksen [this message]
2011-01-03 13:04 ` [PATCHv2] network: query signal strength Marit Sofie Henriksen
2011-01-05  9:08 ` Aki Niemi
2011-01-05 15:10   ` Marit Sofie Henriksen

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=1292579164-24372-1-git-send-email-maritsofie.henriksen8@gmail.com \
    --to=maritsofie.henriksen8@gmail.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