From e75dba639febded0e2878a02f47829cedb6239f7 Mon Sep 17 00:00:00 2001 From: Ben Chan Date: Thu, 17 Jan 2013 23:11:09 -0800 Subject: 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 contributed the idea of implementation. --- src/mm-base-modem.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/mm-base-modem.c') 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; @@ -410,6 +411,23 @@ mm_base_modem_initialize (MMBaseModem *self, user_data); } +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) -- cgit v1.2.3-70-g09d2