diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2014-02-26 11:52:33 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2014-02-26 11:52:50 +0100 |
commit | accb611e1f7ec648c6a7a6080c89b41fa5f9fd5c (patch) | |
tree | 943cdaab6d237b4fe09fee2c1c468e38dc00a5a2 /src | |
parent | e3c4dec3d7db6cb61fd68f5b82452c236ed91843 (diff) |
base-modem: if no AT primary given, try to use data port
The Cinterion PHS8 reports a single AT port to be used as data port, and no
other port as primary. In this case, recover the tty as primary AT port, instead
of failing with an error.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-base-modem.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mm-base-modem.c b/src/mm-base-modem.c index f779d178..9c709fcb 100644 --- a/src/mm-base-modem.c +++ b/src/mm-base-modem.c @@ -1249,9 +1249,18 @@ mm_base_modem_organize_ports (MMBaseModem *self, } } - /* Fall back to a secondary port if we didn't find a primary port */ if (!primary) { - if (!secondary) { + /* Fall back to a secondary port if we didn't find a primary port */ + if (secondary) { + primary = secondary; + secondary = NULL; + } + /* Fallback to a data port if no primary or secondary */ + else if (data_primary && MM_IS_PORT_SERIAL_AT (data_primary)) { + primary = MM_PORT_SERIAL_AT (data_primary); + data_primary = NULL; + } + else { gboolean allow_modem_without_at_port = FALSE; #if defined WITH_QMI @@ -1271,9 +1280,6 @@ mm_base_modem_organize_ports (MMBaseModem *self, "Failed to find primary AT port"); return FALSE; } - } else { - primary = secondary; - secondary = NULL; } } |