summaryrefslogtreecommitdiff
authorDan Williams <dcbw@redhat.com>2012-11-26 22:17:07 (GMT)
committer Dan Williams <dcbw@redhat.com>2012-11-27 15:56:25 (GMT)
commit6106d1d6a2b05a031c54c75861363b199136e417 (patch) (side-by-side diff)
tree49970dc76b4126cba2df814cddbd88e0ca9f3bf9
parent3e39144100315c5be83396d5ef2433be4b7ae203 (diff)
downloadModemManager-6106d1d6a2b05a031c54c75861363b199136e417.zip
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.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/mm-port-probe-at.c18
-rw-r--r--src/mm-port-probe-at.h7
-rw-r--r--src/mm-port-probe.c9
3 files changed, 4 insertions, 30 deletions
diff --git a/src/mm-port-probe-at.c b/src/mm-port-probe-at.c
index fb20a74..d7e6fef 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 d180be4..359a6f5 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 abc3454..37c2baf 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 }
};