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.
This commit is contained in:
Dan Williams
2012-11-27 09:56:25 -06:00
parent 3e39144100
commit 6106d1d6a2
3 changed files with 4 additions and 30 deletions
-18
View File
@@ -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;
}
-7
View File
@@ -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 */
+4 -5
View File
@@ -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 }
};