diff options
author | Ben Chan <benchan@chromium.org> | 2013-08-06 10:04:46 -0700 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2013-08-06 16:05:37 -0500 |
commit | 8ff3f6703a804cce60ae85b6c3ab543d21c5460f (patch) | |
tree | 3976e8d530b0f48552d4fa7bc846ef3e939b4474 | |
parent | f2fd4d8de0feb3d089d5ae950bea753f65a0e384 (diff) |
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 <dcbw@redhat.com>
-rw-r--r-- | plugins/huawei/mm-broadband-modem-huawei.c | 6 |
1 files 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: <cr><lf>^MODE:5<cr><lf> |