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.
This commit is contained in:

committed by
Aleksander Morgado

parent
2550cb20a9
commit
e75dba639f
@@ -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)
|
||||
|
Reference in New Issue
Block a user