Hi Guillaume,

On 15.12.2011 10:50, Guillaume Zajac wrote:
> ---
>  plugins/ofono.c |  135 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 132 insertions(+), 3 deletions(-)
> 
> diff --git a/plugins/ofono.c b/plugins/ofono.c
> index e39c37a..7d2eaf8 100644
> --- a/plugins/ofono.c
> +++ b/plugins/ofono.c
> @@ -126,6 +126,9 @@ struct modem_data {
>       connman_bool_t set_powered;
>       connman_bool_t set_online;
>  
> +     /* CDMA ConnectionManager Interface */
> +     connman_bool_t cdma_cm_powered;
> +
>       /* ConnectionManager Interface */
>       connman_bool_t attached;
>       connman_bool_t cm_powered;
> @@ -142,6 +145,7 @@ struct modem_data {
>       /* Netreg Interface */
>       char *name;
>       uint8_t strength;
> +     uint8_t data_strength; /* 1xEVDO signal strength */
>       connman_bool_t roaming;
>  
>       /* pending calls */
> @@ -1315,8 +1319,28 @@ static void netreg_update_strength(struct modem_data 
> *modem,
>       if (modem->network == NULL)
>               return;
>  
> -     connman_network_set_strength(modem->network, modem->strength);
> -     connman_network_update(modem->network);
> +     if (modem->data_strength == 0) {
> +             connman_network_set_strength(modem->network, modem->strength);
> +             connman_network_update(modem->network);
> +     }
> +}

Could please add some comment on this change? I know why you are
changing this one but I think the rest of the guys dont :)

And I would prefer this

netreg_update_strength()
{
        uint8_t strength;

        if (modem->data_strength == 0)
                strength = modem->strength;
        else
                strength = modem->data_strength;

        connman_network_set_strength();
        connman_network_update();
}

> +
> +/* Retrieve 1xEVDO signal strength */
> +static void netreg_update_datastrength(struct modem_data *modem,
> +                                     DBusMessageIter *value)
> +{
> +     dbus_message_iter_get_basic(value, &modem->data_strength);
> +
> +     DBG("%s Data Strength %d", modem->path, modem->data_strength);
> +
> +     if (modem->network == NULL)
> +             return;
> +
> +     if (modem->data_strength > 0) {
> +             connman_network_set_strength(modem->network,
> +                                             modem->data_strength);
> +             connman_network_update(modem->network);
> +     }
>  }

        if (modem->data_strength == 0)
                return;

Hmm, in the case data_strength is 0, don't you have to use the
modem->strength then, like in netreg_update_strength()?

thanks,
daniel
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to