diff options
author | Dan Williams <dcbw@redhat.com> | 2009-06-29 22:49:19 -0400 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2009-06-29 22:49:19 -0400 |
commit | 78633192d2a02693f17df162eba0a73478ebbcaa (patch) | |
tree | 0c7b5f09c13b6ac6da2a14a28e0d91399d02f1f6 /src | |
parent | d929eb859b99f750e174358e5e39bd561af28265 (diff) |
plugin-base: better Huawei detection; don't drop BUSlink response
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-plugin-base.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c index 4203e9a3..198108cf 100644 --- a/src/mm-plugin-base.c +++ b/src/mm-plugin-base.c @@ -70,6 +70,7 @@ typedef enum { PROBE_STATE_GCAP_TRY3, PROBE_STATE_ATI, PROBE_STATE_CGMM, + PROBE_STATE_LAST } ProbeState; /*****************************************************************************/ @@ -327,10 +328,17 @@ real_handle_probe_response (MMPluginBase *self, { MMPluginBaseSupportsTaskPrivate *task_priv = MM_PLUGIN_BASE_SUPPORTS_TASK_GET_PRIVATE (task); MMSerialPort *port = task_priv->probe_port; + gboolean ignore_error = FALSE; task_priv->probe_state++; - if (error) { + /* Some modems (Huawei E160g) won't respond to +GCAP with no SIM, but + * will respond to ATI. + */ + if (response && strstr (response, "+CME ERROR:")) + ignore_error = TRUE; + + if (error && !ignore_error) { if (error->code == MM_SERIAL_RESPONSE_TIMEOUT) { /* Try GCAP again */ if (task_priv->probe_state <= PROBE_STATE_GCAP_TRY3) { @@ -359,7 +367,7 @@ real_handle_probe_response (MMPluginBase *self, task_priv->probed_caps = parse_gcap (response); /* Some models (BUSlink SCWi275u) stick stupid stuff in the GMM response */ - if ( (task_priv->probe_state == PROBE_STATE_CGMM) + if ( (task_priv->probe_state == PROBE_STATE_LAST) && !(task_priv->probed_caps & CAP_GSM_OR_CDMA)) task_priv->probed_caps = parse_cgmm (response); |