novatel: try to flip secondary ports to AT as soon as possible

So do it during port probing. If we send this command early enough in the
first AT port being probed, it should flip the secondary ports to AT mode
before their port probing is finished.

https://bugzilla.gnome.org/show_bug.cgi?id=696696
This commit is contained in:
Aleksander Morgado
2013-03-27 17:29:49 +01:00
parent ca97f0e79f
commit b76dc134bf
2 changed files with 16 additions and 23 deletions

View File

@@ -962,26 +962,6 @@ modem_cdma_get_detailed_registration_state (MMIfaceModemCdma *self,
mm_qcdm_serial_port_queue_command (port, nweri, 3, NULL, reg_eri_6800_cb, ctx);
}
/*****************************************************************************/
/* Setup ports (Broadband modem class) */
static const MMBaseModemAtCommand nwdmat_sequence[] = {
{ "$NWDMAT=1", 3, FALSE, mm_base_modem_response_processor_continue_on_error },
{ "$NWDMAT=1", 3, FALSE, mm_base_modem_response_processor_continue_on_error },
{ "$NWDMAT=1", 3, FALSE, NULL },
{ NULL }
};
static void
setup_ports (MMBroadbandModem *self)
{
/* Call parent's setup ports first always */
MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_novatel_parent_class)->setup_ports (self);
/* Flip secondary ports to AT mode */
mm_base_modem_at_sequence (MM_BASE_MODEM (self), nwdmat_sequence, NULL, NULL, NULL, NULL);
}
/*****************************************************************************/
MMBroadbandModemNovatel *
@@ -1037,7 +1017,4 @@ iface_modem_cdma_init (MMIfaceModemCdma *iface)
static void
mm_broadband_modem_novatel_class_init (MMBroadbandModemNovatelClass *klass)
{
MMBroadbandModemClass *broadband_modem_class = MM_BROADBAND_MODEM_CLASS (klass);
broadband_modem_class->setup_ports = setup_ports;
}

View File

@@ -34,6 +34,21 @@ G_DEFINE_TYPE (MMPluginNovatel, mm_plugin_novatel, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
/*****************************************************************************/
/* Custom commands for AT probing */
/* We need to explicitly flip secondary ports to AT mode.
* We also use this command also for checking AT support in the current port.
*/
static const MMPortProbeAtCommand custom_at_probe[] = {
{ "$NWDMAT=1", 3, mm_port_probe_response_processor_is_at },
{ "$NWDMAT=1", 3, mm_port_probe_response_processor_is_at },
{ "$NWDMAT=1", 3, mm_port_probe_response_processor_is_at },
{ NULL }
};
/*****************************************************************************/
static MMBaseModem *
create_modem (MMPlugin *self,
const gchar *sysfs_path,
@@ -71,6 +86,7 @@ mm_plugin_create (void)
MM_PLUGIN_ALLOWED_VENDOR_IDS, vendors,
MM_PLUGIN_FORBIDDEN_PRODUCT_IDS, forbidden_products,
MM_PLUGIN_ALLOWED_AT, TRUE,
MM_PLUGIN_CUSTOM_AT_PROBE, custom_at_probe,
MM_PLUGIN_ALLOWED_QCDM, TRUE,
NULL));
}