[PATCH] huawei: handle whitespace in RSSI responses
Dan Williams
dcbw at redhat.com
Tue Aug 6 14:08:38 PDT 2013
On Tue, 2013-08-06 at 10:04 -0700, Ben Chan wrote:
> This patch modifies the regular expressions for parsing ^RSSI, ^RSSILVL,
> and ^HRSSILVL responses to handle any whitespace that is inserted
> between the colon and the RSSI value.
>
> The issue is identified by Dan Williams <dcbw at redhat.com>
Pushed, thanks.
Dan
> ---
> plugins/huawei/mm-broadband-modem-huawei.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c
> index 15f3524..f715682 100644
> --- a/plugins/huawei/mm-broadband-modem-huawei.c
> +++ b/plugins/huawei/mm-broadband-modem-huawei.c
> @@ -2881,11 +2881,11 @@ mm_broadband_modem_huawei_init (MMBroadbandModemHuawei *self)
> MM_TYPE_BROADBAND_MODEM_HUAWEI,
> MMBroadbandModemHuaweiPrivate);
> /* Prepare regular expressions to setup */
> - self->priv->rssi_regex = g_regex_new ("\\r\\n\\^RSSI:(\\d+)\\r\\n",
> + self->priv->rssi_regex = g_regex_new ("\\r\\n\\^RSSI:\\s*(\\d+)\\r\\n",
> G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
> - self->priv->rssilvl_regex = g_regex_new ("\\r\\n\\^RSSILVL:(\\d+)\\r\\n",
> + self->priv->rssilvl_regex = g_regex_new ("\\r\\n\\^RSSILVL:\\s*(\\d+)\\r\\n",
> G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
> - self->priv->hrssilvl_regex = g_regex_new ("\\r\\n\\^HRSSILVL:(\\d+)\\r\\n",
> + self->priv->hrssilvl_regex = g_regex_new ("\\r\\n\\^HRSSILVL:\\s*(\\d+)\\r\\n",
> G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
>
> /* 3GPP: <cr><lf>^MODE:5<cr><lf>
More information about the ModemManager-devel
mailing list