aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-03-15 11:37:54 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-16 14:53:25 +0100
commit346de780bea9ac00d2d4b0f01566755649498002 (patch)
tree179dfe366d71af6d387da9d354ebcda9b12ebdb7
parentdda9e2a37fcc064341a23fb712010eb8a851e1e1 (diff)
option: completely ignore +PACSP0 unsolicited messages
-rw-r--r--plugins/option/mm-broadband-modem-option.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/option/mm-broadband-modem-option.c b/plugins/option/mm-broadband-modem-option.c
index 89f7960d..f47ffc86 100644
--- a/plugins/option/mm-broadband-modem-option.c
+++ b/plugins/option/mm-broadband-modem-option.c
@@ -50,6 +50,9 @@ struct _MMBroadbandModemOptionPrivate {
/* Regex for signal quality related notifications */
GRegex *_osigq_regex;
+ /* Regex for other notifications to ignore */
+ GRegex *ignore_regex;
+
guint after_power_up_wait_id;
};
@@ -588,6 +591,13 @@ set_unsolicited_events_handlers (MMBroadbandModemOption *self,
enable ? (MMAtSerialUnsolicitedMsgFn)option_signal_changed : NULL,
enable ? self : NULL,
NULL);
+
+ /* Other unsolicited events to always ignore */
+ if (!enable)
+ mm_at_serial_port_add_unsolicited_msg_handler (
+ ports[i],
+ self->priv->ignore_regex,
+ NULL, NULL, NULL);
}
}
@@ -871,6 +881,7 @@ finalize (GObject *object)
g_regex_unref (self->priv->_octi_regex);
g_regex_unref (self->priv->_ouwcti_regex);
g_regex_unref (self->priv->_osigq_regex);
+ g_regex_unref (self->priv->ignore_regex);
G_OBJECT_CLASS (mm_broadband_modem_option_parent_class)->finalize (object);
}
@@ -893,6 +904,8 @@ mm_broadband_modem_option_init (MMBroadbandModemOption *self)
G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
self->priv->_osigq_regex = g_regex_new ("\\r\\n_OSIGQ:\\s*(\\d+),(\\d)\\r\\n",
G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
+ self->priv->ignore_regex = g_regex_new ("\\r\\n\\+PACSP0\\r\\n",
+ G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
}
static void