summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2012-11-26 16:17:07 -0600
committerDan Williams <dcbw@redhat.com>2012-11-27 09:56:25 -0600
commit6106d1d6a2b05a031c54c75861363b199136e417 (patch)
tree49970dc76b4126cba2df814cddbd88e0ca9f3bf9
parent3e39144100315c5be83396d5ef2433be4b7ae203 (diff)
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.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 fb20a74d..d7e6fefe 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,
92 return TRUE; 92 return TRUE;
93} 93}
94 94
95/* ---- Other ---- */
96
97gboolean
98mm_port_probe_response_processor_no_error (const gchar *command,
99 const gchar *response,
100 gboolean last_command,
101 const GError *error,
102 GVariant **result,
103 GError **result_error)
104{
105 if (error) {
106 *result = g_variant_new_boolean (FALSE);
107 return TRUE;
108 }
109
110 *result = g_variant_new_boolean (TRUE);
111 return TRUE;
112}
diff --git a/src/mm-port-probe-at.h b/src/mm-port-probe-at.h
index d180be4f..359a6f5d 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,
75 const GError *error, 75 const GError *error,
76 GVariant **result, 76 GVariant **result,
77 GError **result_error); 77 GError **result_error);
78/* Generic response parser which returns TRUE if no error */
79gboolean mm_port_probe_response_processor_no_error (const gchar *command,
80 const gchar *response,
81 gboolean last_command,
82 const GError *error,
83 GVariant **result,
84 GError **result_error);
85 78
86 79
87#endif /* MM_PORT_PROBE_AT_H */ 80#endif /* MM_PORT_PROBE_AT_H */
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c
index abc3454b..37c2baf1 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,
572 GVariant *result) 572 GVariant *result)
573{ 573{
574 if (result) { 574 if (result) {
575 /* If any result given, it must be a boolean */ 575 /* If any result given, it must be a string */
576 g_assert (g_variant_is_of_type (result, G_VARIANT_TYPE_BOOLEAN)); 576 g_assert (g_variant_is_of_type (result, G_VARIANT_TYPE_STRING));
577 577 if (strstr (g_variant_get_string (result, NULL), "%IPSYS:")) {
578 if (g_variant_get_boolean (result)) {
579 mm_port_probe_set_result_at_icera (self, TRUE); 578 mm_port_probe_set_result_at_icera (self, TRUE);
580 return; 579 return;
581 } 580 }
@@ -756,7 +755,7 @@ static const MMPortProbeAtCommand product_probing[] = {
756}; 755};
757 756
758static const MMPortProbeAtCommand icera_probing[] = { 757static const MMPortProbeAtCommand icera_probing[] = {
759 { "%IPSYS?", 3, mm_port_probe_response_processor_no_error }, 758 { "%IPSYS?", 3, mm_port_probe_response_processor_string },
760 { NULL } 759 { NULL }
761}; 760};
762 761