diff options
author | Dan Williams <dcbw@redhat.com> | 2010-05-05 15:47:14 -0700 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2010-05-05 15:47:14 -0700 |
commit | 9a6aa0c10d8354a646daf49db4ec2b99383839aa (patch) | |
tree | 5f625e1ece6f0454ea47fa065711175597a7e468 | |
parent | f63188eb261e631f929a6c47feb85b8ed9985856 (diff) |
option/hso: eat +PACSP0 unsolicited response
Interfered with initial PIN checking in some cases.
-rw-r--r-- | plugins/mm-modem-hso.c | 4 | ||||
-rw-r--r-- | plugins/mm-modem-option.c | 10 |
2 files changed, 13 insertions, 1 deletions
diff --git a/plugins/mm-modem-hso.c b/plugins/mm-modem-hso.c index 426ee0ab..1fd46333 100644 --- a/plugins/mm-modem-hso.c +++ b/plugins/mm-modem-hso.c @@ -753,6 +753,10 @@ grab_port (MMModem *modem, regex = g_regex_new ("_OWANCALL: (\\d),\\s*(\\d)\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); mm_at_serial_port_add_unsolicited_msg_handler (MM_AT_SERIAL_PORT (port), regex, connection_enabled, modem, NULL); g_regex_unref (regex); + + 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); } option_register_unsolicted_handlers (gsm, MM_AT_SERIAL_PORT (port)); } diff --git a/plugins/mm-modem-option.c b/plugins/mm-modem-option.c index 676aa287..ac04b0bd 100644 --- a/plugins/mm-modem-option.c +++ b/plugins/mm-modem-option.c @@ -187,8 +187,16 @@ grab_port (MMModem *modem, MMPort *port = NULL; port = mm_generic_gsm_grab_port (gsm, subsys, name, suggested_type, error); - if (port && MM_IS_AT_SERIAL_PORT (port)) + if (port && MM_IS_AT_SERIAL_PORT (port)) { + if (mm_port_get_port_type (port) == MM_PORT_TYPE_PRIMARY) { + GRegex *regex; + + 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); + } option_register_unsolicted_handlers (gsm, MM_AT_SERIAL_PORT (port)); + } return !!port; } |