modem: support SIM hot swap
BaseModem
added reprobe property.
MMDevice
added logic to recreate the modem if it is set invalid and "to reprobe"
MMBroadbandModem
* added initialization step for SIM hot swap:
1. keep dedicated ports open to listen to modem's unsolicited
2. dedicated error management in case of initialization failure due to SIM missing
* added function to be called in order to act upon SIM insertion/removal:
1. close dedicated ports
2. set the modem to be reprobed
3. disable modem
* added SIM HOT SWAP boolean property
MMIfaceModem
* added initialization step for SIM hot swap, if supported by the plugin
* dedicated error management in case of initialization failure due to SIM missing
This commit is contained in:
committed by
Aleksander Morgado
parent
3047522b2e
commit
60f4f9e57d
@@ -489,8 +489,23 @@ modem_valid (MMBaseModem *modem,
|
||||
MMDevice *self)
|
||||
{
|
||||
if (!mm_base_modem_get_valid (modem)) {
|
||||
GDBusObjectManagerServer *object_manager = self->priv->object_manager;
|
||||
|
||||
/* Modem no longer valid */
|
||||
mm_device_remove_modem (self);
|
||||
|
||||
if (mm_base_modem_get_reprobe (modem)) {
|
||||
GError *error = NULL;
|
||||
|
||||
if (!mm_device_create_modem (self, object_manager, &error)) {
|
||||
mm_warn ("Could not recreate modem for device at '%s': %s",
|
||||
mm_device_get_path (self),
|
||||
error ? error->message : "unknown");
|
||||
g_error_free (error);
|
||||
} else {
|
||||
mm_dbg ("Modem recreated for device '%s'", mm_device_get_path (self));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Modem now valid, export it, but only if we really have it around.
|
||||
* It may happen that the initialization sequence fails because the
|
||||
|
||||
Reference in New Issue
Block a user