[PATCH 2/4] iface-modem: if bands, capabilities or modes change, refresh signal

Dan Williams dcbw at redhat.com
Mon May 22 15:46:25 UTC 2017


On Sun, 2017-05-21 at 21:49 +0200, Aleksander Morgado wrote:
> We also remove the explicit refresh request from the Cinterion
> plugin,
> as this is a generic action applicable to all modems that require
> polling for signal quality and/or access technology.

Should the poll interval get reset to fast-polling after these
operations?

This will now attempt an immediate refresh of the signal/act but if the
device won't acquire the new network for a couple seconds, when will
the next poll happen?  Ideally fairly soon, but that wouldn't be the
case if the modem was previously using the long polling interval.

Dan

> ---
>  plugins/cinterion/mm-broadband-modem-cinterion.c | 10 ++--------
>  src/mm-iface-modem.c                             | 16 +++++++++++++-
> --
>  2 files changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/plugins/cinterion/mm-broadband-modem-cinterion.c
> b/plugins/cinterion/mm-broadband-modem-cinterion.c
> index 3037ee9a..735f15bc 100644
> --- a/plugins/cinterion/mm-broadband-modem-cinterion.c
> +++ b/plugins/cinterion/mm-broadband-modem-cinterion.c
> @@ -849,11 +849,8 @@ allowed_access_technology_update_ready
> (MMBroadbandModemCinterion *self,
>      if (error)
>          /* Let the error be critical. */
>          g_simple_async_result_take_error (operation_result, error);
> -    else {
> -        /* Request immediate signal update */
> -        mm_iface_modem_refresh_signal (MM_IFACE_MODEM (self));
> +    else
>          g_simple_async_result_set_op_res_gboolean (operation_result,
> TRUE);
> -    }
>      g_simple_async_result_complete (operation_result);
>      g_object_unref (operation_result);
>  }
> @@ -1147,11 +1144,8 @@ scfg_set_ready (MMBaseModem *self,
>      if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res,
> &error))
>          /* Let the error be critical */
>          g_simple_async_result_take_error (operation_result, error);
> -    else {
> -        /* Request immediate signal update */
> -        mm_iface_modem_refresh_signal (MM_IFACE_MODEM (self));
> +    else
>          g_simple_async_result_set_op_res_gboolean (operation_result,
> TRUE);
> -    }
>  
>      g_simple_async_result_complete (operation_result);
>      g_object_unref (operation_result);
> diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
> index bbf0fdc4..09675fd1 100644
> --- a/src/mm-iface-modem.c
> +++ b/src/mm-iface-modem.c
> @@ -2056,8 +2056,12 @@ set_current_capabilities_ready (MMIfaceModem
> *self,
>  
>      if (!MM_IFACE_MODEM_GET_INTERFACE (self)-
> >set_current_capabilities_finish (self, res, &error))
>          g_dbus_method_invocation_take_error (ctx->invocation,
> error);
> -    else
> +    else {
> +        /* Capabilities updated: explicitly refresh signal and
> access technology */
> +        mm_iface_modem_refresh_signal (self);
>          mm_gdbus_modem_complete_set_current_capabilities (ctx-
> >skeleton, ctx->invocation);
> +    }
> +
>      handle_set_current_capabilities_context_free (ctx);
>  }
>  
> @@ -2434,8 +2438,11 @@ handle_set_current_bands_ready (MMIfaceModem
> *self,
>  
>      if (!mm_iface_modem_set_current_bands_finish (self, res,
> &error))
>          g_dbus_method_invocation_take_error (ctx->invocation,
> error);
> -    else
> +    else {
> +        /* Bands updated: explicitly refresh signal and access
> technology */
> +        mm_iface_modem_refresh_signal (self);
>          mm_gdbus_modem_complete_set_current_bands (ctx->skeleton,
> ctx->invocation);
> +    }
>  
>      handle_set_current_bands_context_free (ctx);
>  }
> @@ -2750,8 +2757,11 @@ handle_set_current_modes_ready (MMIfaceModem
> *self,
>  
>      if (!mm_iface_modem_set_current_modes_finish (self, res,
> &error))
>          g_dbus_method_invocation_take_error (ctx->invocation,
> error);
> -    else
> +    else {
> +        /* Modes updated: explicitly refresh signal and access
> technology */
> +        mm_iface_modem_refresh_signal (self);
>          mm_gdbus_modem_complete_set_current_modes (ctx->skeleton,
> ctx->invocation);
> +    }
>  
>      handle_set_current_modes_context_free (ctx);
>  }


More information about the ModemManager-devel mailing list