aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2012-08-28 21:58:43 -0500
committerDan Williams <dcbw@redhat.com>2012-08-29 10:02:18 -0500
commitc5fc28378b8e6b8559ae44218cac15a70f8364f9 (patch)
treecdd6bcc3d679209bdfb6ea0a10452ae289568cf5
parent7a4bc7b4a878df0232008a976532be59425b00aa (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.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/mm-modem-sierra-gsm.c b/plugins/mm-modem-sierra-gsm.c
index de32b322..665b7c52 100644
--- a/plugins/mm-modem-sierra-gsm.c
+++ b/plugins/mm-modem-sierra-gsm.c
@@ -574,6 +574,13 @@ port_grabbed (MMGenericGsm *gsm,
if (MM_IS_AT_SERIAL_PORT (port)) {
g_object_set (G_OBJECT (port), MM_PORT_CARRIER_DETECT, FALSE, NULL);
+ if (pflags == MM_AT_PORT_FLAG_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);