[PATCH 2/2] ublox: use send-delay=0 by default

Aleksander Morgado aleksander at aleksander.es
Tue May 23 17:33:07 UTC 2017


On 23/05/17 18:39, Aleksander Morgado wrote:
> Looks like the u-blox SARA-U260 requires this, see:
> https://lists.freedesktop.org/archives/modemmanager-devel/2017-May/004670.html
> ---

Forgot to say that I also tested this in my u-blox Toby L2 and was
recognized successfully.

>  plugins/ublox/mm-broadband-modem-ublox.c | 31 ++++++++++++++++++++++++++++++-
>  plugins/ublox/mm-plugin-ublox.c          |  1 +
>  2 files changed, 31 insertions(+), 1 deletion(-)
> 
> diff --git a/plugins/ublox/mm-broadband-modem-ublox.c b/plugins/ublox/mm-broadband-modem-ublox.c
> index 64dd9dec..1ccb4be8 100644
> --- a/plugins/ublox/mm-broadband-modem-ublox.c
> +++ b/plugins/ublox/mm-broadband-modem-ublox.c
> @@ -899,6 +899,32 @@ modem_create_bearer (MMIfaceModem        *self,
>  }
>  
>  /*****************************************************************************/
> +/* Setup ports (Broadband modem class) */
> +
> +static void
> +setup_ports (MMBroadbandModem *self)
> +{
> +    MMPortSerialAt *ports[2];
> +    guint           i;
> +
> +    /* Call parent's setup ports first always */
> +    MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_ublox_parent_class)->setup_ports (self);
> +
> +    ports[0] = mm_base_modem_peek_port_primary   (MM_BASE_MODEM (self));
> +    ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self));
> +
> +    /* Configure AT ports */
> +    for (i = 0; i < G_N_ELEMENTS (ports); i++) {
> +        if (!ports[i])
> +            continue;
> +
> +        g_object_set (ports[i],
> +                      MM_PORT_SERIAL_SEND_DELAY, (guint64) 0,
> +                      NULL);
> +    }
> +}
> +
> +/*****************************************************************************/
>  
>  MMBroadbandModemUblox *
>  mm_broadband_modem_ublox_new (const gchar  *device,
> @@ -962,7 +988,10 @@ iface_modem_init (MMIfaceModem *iface)
>  static void
>  mm_broadband_modem_ublox_class_init (MMBroadbandModemUbloxClass *klass)
>  {
> -    GObjectClass *object_class = G_OBJECT_CLASS (klass);
> +    GObjectClass          *object_class = G_OBJECT_CLASS (klass);
> +    MMBroadbandModemClass *broadband_modem_class = MM_BROADBAND_MODEM_CLASS (klass);
>  
>      g_type_class_add_private (object_class, sizeof (MMBroadbandModemUbloxPrivate));
> +
> +    broadband_modem_class->setup_ports = setup_ports;
>  }
> diff --git a/plugins/ublox/mm-plugin-ublox.c b/plugins/ublox/mm-plugin-ublox.c
> index a1592d51..d4a29236 100644
> --- a/plugins/ublox/mm-plugin-ublox.c
> +++ b/plugins/ublox/mm-plugin-ublox.c
> @@ -75,6 +75,7 @@ mm_plugin_create (void)
>                                      MM_PLUGIN_ALLOWED_VENDOR_STRINGS, vendor_strings,
>                                      MM_PLUGIN_ALLOWED_AT,             TRUE,
>                                      MM_PLUGIN_CUSTOM_AT_PROBE,        custom_at_probe,
> +                                    MM_PLUGIN_SEND_DELAY,             0,
>                                      NULL));
>  }
>  
> 


-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list