[PATCH] novatel-lte: abort connect request if call failed
Thieu Le
thieule at chromium.org
Fri Sep 27 16:47:25 PDT 2013
Change-Id: Iae16ec87e12aaaf314b7e66b2f9c72a13251e352
---
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);
--
1.7.12.4
More information about the ModemManager-devel
mailing list