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:
Ben Chan
2013-01-17 23:11:09 -08:00
committed by Aleksander Morgado
parent 2550cb20a9
commit e75dba639f
6 changed files with 52 additions and 12 deletions

View File

@@ -802,6 +802,8 @@ mm_plugin_create_modem (MMPlugin *self,
port_probes,
error);
if (modem) {
mm_base_modem_set_hotplugged (modem, mm_device_get_hotplugged (device));
/* Grab each port */
for (l = port_probes; l; l = g_list_next (l)) {
GError *inner_error = NULL;