[PATCH] huawei: ignore ^CONNECT unsolicited messages
Aleksander Morgado
aleksander at lanedo.com
Mon Sep 16 23:59:28 PDT 2013
On 17/09/13 00:54, Ben Chan wrote:
> ---
> plugins/huawei/mm-broadband-modem-huawei.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
Pushed, thanks.
> diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c
> index 45bc806..e522e02 100644
> --- a/plugins/huawei/mm-broadband-modem-huawei.c
> +++ b/plugins/huawei/mm-broadband-modem-huawei.c
> @@ -88,6 +88,7 @@ struct _MMBroadbandModemHuaweiPrivate {
>
> /* Regex to ignore */
> GRegex *boot_regex;
> + GRegex *connect_regex;
> GRegex *csnr_regex;
> GRegex *cusatp_regex;
> GRegex *cusatend_regex;
> @@ -2955,6 +2956,10 @@ set_ignored_unsolicited_events_handlers (MMBroadbandModemHuawei *self)
> NULL, NULL, NULL);
> mm_at_serial_port_add_unsolicited_msg_handler (
> ports[i],
> + self->priv->connect_regex,
> + NULL, NULL, NULL);
> + mm_at_serial_port_add_unsolicited_msg_handler (
> + ports[i],
> self->priv->csnr_regex,
> NULL, NULL, NULL);
> mm_at_serial_port_add_unsolicited_msg_handler (
> @@ -3060,6 +3065,8 @@ mm_broadband_modem_huawei_init (MMBroadbandModemHuawei *self)
> G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
> self->priv->boot_regex = g_regex_new ("\\r\\n\\^BOOT:.+\\r\\n",
> G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
> + self->priv->connect_regex = g_regex_new ("\\r\\n\\^CONNECT .+\\r\\n",
> + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
> self->priv->csnr_regex = g_regex_new ("\\r\\n\\^CSNR:.+\\r\\n",
> G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
> self->priv->cusatp_regex = g_regex_new ("\\r\\n\\+CUSATP:.+\\r\\n",
> @@ -3103,6 +3110,7 @@ finalize (GObject *object)
> g_regex_unref (self->priv->mode_regex);
> g_regex_unref (self->priv->dsflowrpt_regex);
> g_regex_unref (self->priv->boot_regex);
> + g_regex_unref (self->priv->connect_regex);
> g_regex_unref (self->priv->csnr_regex);
> g_regex_unref (self->priv->cusatp_regex);
> g_regex_unref (self->priv->cusatend_regex);
>
--
Aleksander
More information about the ModemManager-devel
mailing list