[PATCH] huawei: ignore ^DSDORMANT unsolicited messages

Ben Chan benchan at chromium.org
Tue Aug 27 00:44:04 PDT 2013


---
 plugins/huawei/mm-broadband-modem-huawei.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c
index 7f760f3..fffbc9b 100644
--- a/plugins/huawei/mm-broadband-modem-huawei.c
+++ b/plugins/huawei/mm-broadband-modem-huawei.c
@@ -90,6 +90,7 @@ struct _MMBroadbandModemHuaweiPrivate {
     GRegex *csnr_regex;
     GRegex *cusatp_regex;
     GRegex *cusatend_regex;
+    GRegex *dsdormant_regex;
     GRegex *simst_regex;
     GRegex *srvst_regex;
     GRegex *stin_regex;
@@ -2939,6 +2940,10 @@ set_ignored_unsolicited_events_handlers (MMBroadbandModemHuawei *self)
             NULL, NULL, NULL);
         mm_at_serial_port_add_unsolicited_msg_handler (
             ports[i],
+            self->priv->dsdormant_regex,
+            NULL, NULL, NULL);
+        mm_at_serial_port_add_unsolicited_msg_handler (
+            ports[i],
             self->priv->simst_regex,
             NULL, NULL, NULL);
         mm_at_serial_port_add_unsolicited_msg_handler (
@@ -3034,6 +3039,8 @@ mm_broadband_modem_huawei_init (MMBroadbandModemHuawei *self)
                                             G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
     self->priv->cusatend_regex = g_regex_new ("\\r\\n\\+CUSATEND\\r\\n",
                                               G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
+    self->priv->dsdormant_regex = g_regex_new ("\\r\\n\\^DSDORMANT:.+\\r\\n",
+                                               G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
     self->priv->simst_regex = g_regex_new ("\\r\\n\\^SIMST:.+\\r\\n",
                                            G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
     self->priv->srvst_regex = g_regex_new ("\\r\\n\\^SRVST:.+\\r\\n",
@@ -3072,6 +3079,7 @@ finalize (GObject *object)
     g_regex_unref (self->priv->csnr_regex);
     g_regex_unref (self->priv->cusatp_regex);
     g_regex_unref (self->priv->cusatend_regex);
+    g_regex_unref (self->priv->dsdormant_regex);
     g_regex_unref (self->priv->simst_regex);
     g_regex_unref (self->priv->srvst_regex);
     g_regex_unref (self->priv->stin_regex);
-- 
1.8.3.1



More information about the ModemManager-devel mailing list