novatel: report error if not properly disconnected
When we request to disconnect, and the disconnection status check fails, return a proper error.
This commit is contained in:
@@ -359,16 +359,20 @@ disconnect_3gpp_status_complete (MMBaseModem *modem,
|
|||||||
result = mm_base_modem_at_command_finish (MM_BASE_MODEM (modem),
|
result = mm_base_modem_at_command_finish (MM_BASE_MODEM (modem),
|
||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
|
|
||||||
g_simple_async_result_set_op_res_gboolean (ctx->result, FALSE);
|
|
||||||
if (error) {
|
if (error) {
|
||||||
mm_dbg("QMI connection status failed: %s", error->message);
|
mm_dbg("QMI connection status failed: %s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
result = mm_strip_tag (result, "$NWQMISTATUS:");
|
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);
|
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);
|
detailed_disconnect_context_complete_and_free (ctx);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user