diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-04-03 12:26:24 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-04-04 19:26:51 +0200 |
commit | f24fc68e04fbe225de162f57e3cbd254f8f03df4 (patch) | |
tree | 441589ebf3f7003402f62fceb9c7adaa3ac82db3 /src/mm-port-probe-at.c | |
parent | 4e4d139e309c890b2c5c44b747aeaf9a5deac9bc (diff) |
port-probe: add a new serial parser filter to detect non-AT strings
We will check each string with our custom filter before even trying to
parse them. A MM_SERIAL_ERROR_PARSE_FAILED error will be issued whenever the
string doesn't match the filter.
Diffstat (limited to 'src/mm-port-probe-at.c')
-rw-r--r-- | src/mm-port-probe-at.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mm-port-probe-at.c b/src/mm-port-probe-at.c index d7e6fefe..10cce9e5 100644 --- a/src/mm-port-probe-at.c +++ b/src/mm-port-probe-at.c @@ -50,11 +50,15 @@ mm_port_probe_response_processor_is_at (const gchar *command, return FALSE; } - /* If error is NOT known by the parser, request to abort */ - if (!mm_serial_parser_v1_is_known_error (error)) { + /* If error is NOT known by the parser, or if the error is actually + * the generic parsing filter error, request to abort */ + if (!mm_serial_parser_v1_is_known_error (error) || + g_error_matches (error, + MM_SERIAL_ERROR, + MM_SERIAL_ERROR_PARSE_FAILED)) { *result_error = g_error_copy (error); g_prefix_error (result_error, - "Fatal error parsing AT reply. "); + "Fatal error parsing AT reply: "); return FALSE; } @@ -91,4 +95,3 @@ mm_port_probe_response_processor_string (const gchar *command, return TRUE; } - |