diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-04-03 11:05:36 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-04-04 19:26:51 +0200 |
commit | 4ea827a3a11767081d1c055d694ce644e6723cef (patch) | |
tree | 46aba2178f643bd46a18932c352f873c3896d960 | |
parent | 2c3e2bd457b908800155e3cfecbccfa9a1f530c7 (diff) |
sierra: too many timeout errors during custom init means non-AT port
Reduces probing time of the modem in ~10s.
-rw-r--r-- | plugins/sierra/mm-plugin-sierra.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/sierra/mm-plugin-sierra.c b/plugins/sierra/mm-plugin-sierra.c index 0e4eceb0..8712c088 100644 --- a/plugins/sierra/mm-plugin-sierra.c +++ b/plugins/sierra/mm-plugin-sierra.c @@ -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; |