plugin: defer task if supports check tells us to retry

Huawei modems will probe interface 0 always first; if we try to probe another
interface meanwhile the supports check will give us a MM_CORE_ERROR_RETRY error,
indicating that we need to defer the probing of the port.
This commit is contained in:
Aleksander Morgado
2012-09-03 17:20:29 +02:00
parent 9c2a6320a8
commit 72db2a53ed

View File

@@ -477,8 +477,18 @@ port_probe_run_ready (MMPortProbe *probe,
g_simple_async_result_set_op_res_gpointer (ctx->result, g_simple_async_result_set_op_res_gpointer (ctx->result,
GUINT_TO_POINTER (MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED), GUINT_TO_POINTER (MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED),
NULL); NULL);
} else { }
/* For remaining errors, just propagate them */ /* Probing failed but the plugin tells us to retry; so we'll defer the
* probing a bit */
else if (g_error_matches (error,
MM_CORE_ERROR,
MM_CORE_ERROR_RETRY)) {
g_simple_async_result_set_op_res_gpointer (ctx->result,
GUINT_TO_POINTER (MM_PLUGIN_SUPPORTS_PORT_DEFER),
NULL);
}
/* For remaining errors, just propagate them */
else {
g_simple_async_result_take_error (ctx->result, error); g_simple_async_result_take_error (ctx->result, error);
} }
} else { } else {