diff options
author | Dan Williams <dcbw@redhat.com> | 2012-11-26 16:17:07 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2012-11-27 09:56:25 -0600 |
commit | 6106d1d6a2b05a031c54c75861363b199136e417 (patch) | |
tree | 49970dc76b4126cba2df814cddbd88e0ca9f3bf9 | |
parent | 3e39144100315c5be83396d5ef2433be4b7ae203 (diff) | |
download | ModemManager-6106d1d6a2b05a031c54c75861363b199136e417.tar.gz |
port-probe: fix checking of Icera capability on some devices
Sierra devices often have limited AT parsers on their APP ports
which reply with OK to any command they don't understand, and
thus we need to actually check for a valid IPSYS reply instead of
just checking whether the IPSYS request completed without error.
Previously MM would detect Icera capability on devices that
didn't actually have it.
-rw-r--r-- | src/mm-port-probe-at.c | 18 | ||||
-rw-r--r-- | src/mm-port-probe-at.h | 7 | ||||
-rw-r--r-- | src/mm-port-probe.c | 9 |
3 files changed, 4 insertions, 30 deletions
diff --git a/src/mm-port-probe-at.c b/src/mm-port-probe-at.c index fb20a74d3..d7e6fefe5 100644 --- a/src/mm-port-probe-at.c +++ b/src/mm-port-probe-at.c @@ -92,21 +92,3 @@ mm_port_probe_response_processor_string (const gchar *command, return TRUE; } -/* ---- Other ---- */ - -gboolean -mm_port_probe_response_processor_no_error (const gchar *command, - const gchar *response, - gboolean last_command, - const GError *error, - GVariant **result, - GError **result_error) -{ - if (error) { - *result = g_variant_new_boolean (FALSE); - return TRUE; - } - - *result = g_variant_new_boolean (TRUE); - return TRUE; -} diff --git a/src/mm-port-probe-at.h b/src/mm-port-probe-at.h index d180be4f6..359a6f5d9 100644 --- a/src/mm-port-probe-at.h +++ b/src/mm-port-probe-at.h @@ -75,13 +75,6 @@ gboolean mm_port_probe_response_processor_is_at (const gchar *command, const GError *error, GVariant **result, GError **result_error); -/* Generic response parser which returns TRUE if no error */ -gboolean mm_port_probe_response_processor_no_error (const gchar *command, - const gchar *response, - gboolean last_command, - const GError *error, - GVariant **result, - GError **result_error); #endif /* MM_PORT_PROBE_AT_H */ diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c index abc3454b9..37c2baf17 100644 --- a/src/mm-port-probe.c +++ b/src/mm-port-probe.c @@ -572,10 +572,9 @@ serial_probe_at_icera_result_processor (MMPortProbe *self, GVariant *result) { if (result) { - /* If any result given, it must be a boolean */ - g_assert (g_variant_is_of_type (result, G_VARIANT_TYPE_BOOLEAN)); - - if (g_variant_get_boolean (result)) { + /* If any result given, it must be a string */ + g_assert (g_variant_is_of_type (result, G_VARIANT_TYPE_STRING)); + if (strstr (g_variant_get_string (result, NULL), "%IPSYS:")) { mm_port_probe_set_result_at_icera (self, TRUE); return; } @@ -756,7 +755,7 @@ static const MMPortProbeAtCommand product_probing[] = { }; static const MMPortProbeAtCommand icera_probing[] = { - { "%IPSYS?", 3, mm_port_probe_response_processor_no_error }, + { "%IPSYS?", 3, mm_port_probe_response_processor_string }, { NULL } }; |