diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-05-06 16:29:47 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-05-06 17:12:36 +0200 |
commit | 97baa44b04ac90b25c792a6883fe6b7c49aa1f17 (patch) | |
tree | d6417ad2cbae1bf3a5875554abe014e66e1381fe | |
parent | b2d376696c0e0d7eddf2cb67b0869cc6f20cf953 (diff) |
novatel: report error if not properly disconnected
When we request to disconnect, and the disconnection status check fails, return
a proper error.
-rw-r--r-- | plugins/novatel/mm-broadband-bearer-novatel.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/novatel/mm-broadband-bearer-novatel.c b/plugins/novatel/mm-broadband-bearer-novatel.c index dff39fe3..a3482aec 100644 --- a/plugins/novatel/mm-broadband-bearer-novatel.c +++ b/plugins/novatel/mm-broadband-bearer-novatel.c @@ -359,16 +359,20 @@ disconnect_3gpp_status_complete (MMBaseModem *modem, result = mm_base_modem_at_command_finish (MM_BASE_MODEM (modem), res, &error); - - g_simple_async_result_set_op_res_gboolean (ctx->result, FALSE); if (error) { mm_dbg("QMI connection status failed: %s", error->message); g_error_free (error); } result = mm_strip_tag (result, "$NWQMISTATUS:"); - if (g_strrstr (result, "QMI State: DISCONNECTED")) + if (result && g_strrstr (result, "QMI State: DISCONNECTED")) g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + else + g_simple_async_result_set_error (ctx->result, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Error checking if disconnected (%s)", + result ? result : "no result"); detailed_disconnect_context_complete_and_free (ctx); } |