* [PATCHv2] network: query signal strength
@ 2010-12-17 9:46 Marit Henriksen
2011-01-03 13:04 ` Marit Sofie Henriksen
2011-01-05 9:08 ` Aki Niemi
0 siblings, 2 replies; 4+ messages in thread
From: Marit Henriksen @ 2010-12-17 9:46 UTC (permalink / raw)
To: ofono
[-- 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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCHv2] network: query signal strength
2010-12-17 9:46 [PATCHv2] network: query signal strength Marit Henriksen
@ 2011-01-03 13:04 ` Marit Sofie Henriksen
2011-01-05 9:08 ` Aki Niemi
1 sibling, 0 replies; 4+ messages in thread
From: Marit Sofie Henriksen @ 2011-01-03 13:04 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2725 bytes --]
2010/12/17 Marit Henriksen <maritsofie.henriksen8@gmail.com>
> From: Marit Henriksen <marit.henriksen@stericsson.com>
>
> Hi. I was wondering if you have had the chance to look at the second
version of the patch?
regards, Marit
> 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
>
>
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 3385 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv2] network: query signal strength
2010-12-17 9:46 [PATCHv2] network: query signal strength Marit Henriksen
2011-01-03 13:04 ` Marit Sofie Henriksen
@ 2011-01-05 9:08 ` Aki Niemi
2011-01-05 15:10 ` Marit Sofie Henriksen
1 sibling, 1 reply; 4+ messages in thread
From: Aki Niemi @ 2011-01-05 9:08 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1357 bytes --]
Hi Marit,
2010/12/17 Marit Henriksen <maritsofie.henriksen8@gmail.com>:
> 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.
Typically the modem updates signal strength along with registration
status. What are you trying to achieve here? Is this to avoid
problems caused by reordering, i.e., ofono_netreg_strength_notify()
getting called before ofono_netreg_status_notify()?
<snip>
> @@ -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);
Add extra line feed here.
> + if (netreg->driver->strength)
> + netreg->driver->strength(netreg,
> + signal_strength_callback, netreg);
> } else {
> struct ofono_error error;
>
Cheers,
Aki
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv2] network: query signal strength
2011-01-05 9:08 ` Aki Niemi
@ 2011-01-05 15:10 ` Marit Sofie Henriksen
0 siblings, 0 replies; 4+ messages in thread
From: Marit Sofie Henriksen @ 2011-01-05 15:10 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2132 bytes --]
2011/1/5 Aki Niemi <aki@protocolpolice.com>
> Hi Marit,
>
> 2010/12/17 Marit Henriksen <maritsofie.henriksen8@gmail.com>:
> > 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.
>
> Typically the modem updates signal strength along with registration
> status. What are you trying to achieve here? Is this to avoid
> problems caused by reordering, i.e., ofono_netreg_strength_notify()
> getting called before ofono_netreg_status_notify()?
>
>
The STE modem does not seem to behave like you describe, updating
signal strength along with registration status. We use CIEV for
signal strength updates, and when testing I observed that registration
status was often changed without signal strength being updated (got CREG
but not CIEV from modem). So ofono_netreg_status_notify() was called
several times (and with states different from registered or roaming) without
ofono_netreg_strength_notify() being called. Thus signal_strength was set
to -1, and the Strength property was not reported.
<snip>
>
> > @@ -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);
>
> Add extra line feed here.
>
I'll send a new patch.
regards, Marit
>
> > + if (netreg->driver->strength)
> > + netreg->driver->strength(netreg,
> > + signal_strength_callback,
> netreg);
> > } else {
> > struct ofono_error error;
> >
>
> Cheers,
> Aki
> _______________________________________________
> ofono mailing list
> ofono(a)ofono.org
> http://lists.ofono.org/listinfo/ofono
>
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 3143 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-01-05 15:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-17 9:46 [PATCHv2] network: query signal strength Marit Henriksen
2011-01-03 13:04 ` Marit Sofie Henriksen
2011-01-05 9:08 ` Aki Niemi
2011-01-05 15:10 ` Marit Sofie Henriksen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox