sierra: too many timeout errors during custom init means non-AT port

Reduces probing time of the modem in ~10s.
This commit is contained in:
Aleksander Morgado
2013-04-04 19:26:51 +02:00
parent 2c3e2bd457
commit 4ea827a3a1
+7
View File
@@ -80,6 +80,13 @@ gcap_ready (MMAtSerialPort *port,
SierraCustomInitContext *ctx)
{
if (error) {
/* If consumed all tries and the last error was a timeout, assume the
* port is not AT */
if (ctx->retries == 0 &&
g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) {
mm_port_probe_set_result_at (ctx->probe, FALSE);
}
/* Just retry... */
sierra_custom_init_step (ctx);
return;