From 8ff3f6703a804cce60ae85b6c3ab543d21c5460f Mon Sep 17 00:00:00 2001 From: Ben Chan Date: Tue, 6 Aug 2013 10:04:46 -0700 Subject: [PATCH] huawei: handle whitespace in RSSI responses 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 --- 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 15f3524b..f715682a 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: ^MODE:5