aboutsummaryrefslogtreecommitdiff
path: root/src/mm-base-modem.c
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2013-01-17 23:11:09 -0800
committerAleksander Morgado <aleksander@lanedo.com>2013-01-18 11:27:51 +0100
commite75dba639febded0e2878a02f47829cedb6239f7 (patch)
tree6b2a027e217599819eac3e8938fadfcc5c75d43d /src/mm-base-modem.c
parent2550cb20a9741378c747233ddea8e7a7daa5c198 (diff)
core: add 'hotplugged' flag to indicate if modem is newly plugged in
This patch adds a 'hotplugged' flag to MMBaseModem to indicate if a modem is newly plugged in. A plugin can use this information to determine if, for example, the modem needs to be soft reset using the ATZ command. Dan Williams <dcbw@redhat.com> contributed the idea of implementation.
Diffstat (limited to 'src/mm-base-modem.c')
-rw-r--r--src/mm-base-modem.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mm-base-modem.c b/src/mm-base-modem.c
index c66ec53c..86ff8123 100644
--- a/src/mm-base-modem.c
+++ b/src/mm-base-modem.c
@@ -67,6 +67,7 @@ struct _MMBaseModemPrivate {
guint vendor_id;
guint product_id;
+ gboolean hotplugged;
gboolean valid;
guint max_timeouts;
@@ -411,6 +412,23 @@ mm_base_modem_initialize (MMBaseModem *self,
}
void
+mm_base_modem_set_hotplugged (MMBaseModem *self,
+ gboolean hotplugged)
+{
+ g_return_if_fail (MM_IS_BASE_MODEM (self));
+
+ self->priv->hotplugged = hotplugged;
+}
+
+gboolean
+mm_base_modem_get_hotplugged (MMBaseModem *self)
+{
+ g_return_val_if_fail (MM_IS_BASE_MODEM (self), FALSE);
+
+ return self->priv->hotplugged;
+}
+
+void
mm_base_modem_set_valid (MMBaseModem *self,
gboolean new_valid)
{