diff options
author | Dan Williams <dcbw@redhat.com> | 2012-08-28 21:58:43 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2012-08-29 08:53:36 -0500 |
commit | d1be19d231a395339b1f452d1a30b73ea77ad528 (patch) | |
tree | 9cbfa2492d75aa3eccc4166d6bd97bbab6480de6 | |
parent | 01201860de5565a78823913423c6b2a762e3731f (diff) |
sierra: fix CSQ handling on APP1 port
The APP1 port doesn't always prefix its replies with <CR><LF> which
runs afoul of the built-in echo removal. Since Sierra modems are on
the whole well-behaved WRT echo removal, just disable it on the
secondary ports. Only changes behavior for PPP-based devices since
they are the only ones that use the APP1 ports.
-rw-r--r-- | plugins/mm-modem-sierra-gsm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/mm-modem-sierra-gsm.c b/plugins/mm-modem-sierra-gsm.c index 58e5010e..8c65b814 100644 --- a/plugins/mm-modem-sierra-gsm.c +++ b/plugins/mm-modem-sierra-gsm.c @@ -524,6 +524,13 @@ grab_port (MMModem *modem, g_object_set (G_OBJECT (port), MM_PORT_CARRIER_DETECT, FALSE, NULL); + if (ptype == MM_PORT_TYPE_SECONDARY) { + /* Built-in echo removal conflicts with the APP1 port's limited AT + * parser, which doesn't always prefix responses with <CR><LF>. + */ + g_object_set (G_OBJECT (port), MM_AT_SERIAL_PORT_REMOVE_ECHO, FALSE, NULL); + } + regex = g_regex_new ("\\r\\n\\+PACSP0\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); mm_at_serial_port_add_unsolicited_msg_handler (MM_AT_SERIAL_PORT (port), regex, NULL, NULL, NULL); g_regex_unref (regex); |