summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarit Henriksen <marit.henriksen@stericsson.com>2011-01-05 16:11:56 +0100
committerMarcel Holtmann <marcel@holtmann.org>2011-01-05 16:20:31 -0800
commitb7713da07743265edc2cc60d3cf7fccd9b42f55d (patch)
treeea0fac2ede8c6a4f3139c7ef204bc3e694ef087d /src
parent435e20153c246fa21af12117449a97687053c6f4 (diff)
downloadofono-b7713da07743265edc2cc60d3cf7fccd9b42f55d.tar.bz2
network: query signal strength
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.
Diffstat (limited to 'src')
-rw-r--r--src/network.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/network.c b/src/network.c
index 95af5d40..ac4942ba 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1297,6 +1297,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)
{
@@ -1320,6 +1333,10 @@ 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;
@@ -1346,18 +1363,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,