[PATCH] novatel-lte: abort connect request if call failed
Dan Williams
dcbw at redhat.com
Tue Oct 1 10:17:18 PDT 2013
On Fri, 2013-09-27 at 16:47 -0700, Thieu Le wrote:
> Change-Id: Iae16ec87e12aaaf314b7e66b2f9c72a13251e352
> ---
Pushed, thanks.
Dan
> plugins/novatel/mm-broadband-bearer-novatel-lte.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/plugins/novatel/mm-broadband-bearer-novatel-lte.c b/plugins/novatel/mm-broadband-bearer-novatel-lte.c
> index 2225656..ed6b027 100644
> --- a/plugins/novatel/mm-broadband-bearer-novatel-lte.c
> +++ b/plugins/novatel/mm-broadband-bearer-novatel-lte.c
> @@ -114,6 +114,14 @@ is_qmistatus_disconnected (const gchar *str)
> return g_strrstr (str, "QMI State: DISCONNECTED") || g_strrstr (str, "QMI State: QMI_WDS_PKT_DATA_DISCONNECTED");
> }
>
> +static gboolean
> +is_qmistatus_call_failed (const gchar *str)
> +{
> + str = mm_strip_tag (str, QMISTATUS_TAG);
> +
> + return (g_strrstr (str, "QMI_RESULT_FAILURE:QMI_ERR_CALL_FAILED") != NULL);
> +}
> +
> static void
> poll_connection_ready (MMBaseModem *modem,
> GAsyncResult *res,
> @@ -193,6 +201,9 @@ connect_3gpp_qmistatus_ready (MMBaseModem *modem,
> g_object_unref (config);
> detailed_connect_context_complete_and_free (ctx);
> return;
> + } else if (is_qmistatus_call_failed (result)) {
> + /* Don't retry if the call failed */
> + ctx->retries = 0;
> }
>
> mm_dbg ("Error: '%s'", result);
More information about the ModemManager-devel
mailing list