diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-03-27 17:29:49 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-03-28 17:05:48 +0100 |
commit | b76dc134bf6bed78c0a83fdc12d2e1f66821148c (patch) | |
tree | 54dd81adfae052eb8178d4427eeec557d85f3703 | |
parent | ca97f0e79fde28f934eddebb32b51dfa31be5d74 (diff) |
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
-rw-r--r-- | plugins/novatel/mm-broadband-modem-novatel.c | 23 | ||||
-rw-r--r-- | plugins/novatel/mm-plugin-novatel.c | 16 |
2 files changed, 16 insertions, 23 deletions
diff --git a/plugins/novatel/mm-broadband-modem-novatel.c b/plugins/novatel/mm-broadband-modem-novatel.c index c5ccf09a..63c28104 100644 --- a/plugins/novatel/mm-broadband-modem-novatel.c +++ b/plugins/novatel/mm-broadband-modem-novatel.c @@ -963,26 +963,6 @@ modem_cdma_get_detailed_registration_state (MMIfaceModemCdma *self, } /*****************************************************************************/ -/* 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 * mm_broadband_modem_novatel_new (const gchar *device, @@ -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; } diff --git a/plugins/novatel/mm-plugin-novatel.c b/plugins/novatel/mm-plugin-novatel.c index a1ee0819..6f798585 100644 --- a/plugins/novatel/mm-plugin-novatel.c +++ b/plugins/novatel/mm-plugin-novatel.c @@ -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)); } |