diff options
author | Carlo Lobrano <c.lobrano@gmail.com> | 2017-07-25 09:03:05 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-08-01 10:02:01 +0200 |
commit | 9cdc237241ef7129c422ce33eca181ad8c837f8b (patch) | |
tree | 1a318ab243f578d25c74b06e6f32d23fdcb480b7 /src/mm-iface-modem.c | |
parent | b2c7244b6c73dc615e67cf2f90f30ad671b43a84 (diff) |
sim hot swap: improved error management
Currently, when SIM hot swap fails in either mm-iface or plugin, the
ModemManager still opens ports context and prints a message saying that
SIM hot swap is supported and that it's waiting for SIM insertion,
instead of clearly saying that SIM hot swap is not working.
This patch:
1. introduces a new property MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED
which is FALSE by default and set to TRUE only when
setup_sim_hot_swap_finish() succeded.
2. subordinates the completion of SIM hot swap setup (in
mm-broadband-modem) and the related messages to the the value of
MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED
Finally, this patch replaces the MBIM's sim_hot_swap_on private property
with the new property MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, since they have the
same meaning.
Diffstat (limited to 'src/mm-iface-modem.c')
-rw-r--r-- | src/mm-iface-modem.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index d59303a8..ec453a8f 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -4335,6 +4335,9 @@ setup_sim_hot_swap_ready (MMIfaceModem *self, g_error_free (error); } else { mm_dbg ("Iface modem: SIM hot swap setup succeded"); + g_object_set (self, + MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, TRUE, + NULL); } /* Go on to next step */ @@ -4880,8 +4883,9 @@ interface_initialization_step (GTask *task) MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED, &is_sim_hot_swap_supported, NULL); - if (is_sim_hot_swap_supported) + if (is_sim_hot_swap_supported) { mm_iface_modem_update_failed_state (self, MM_MODEM_STATE_FAILED_REASON_SIM_MISSING); + } } } else { /* We are done without errors! @@ -5284,6 +5288,7 @@ iface_modem_init (gpointer g_iface) "List of bearers handled by the modem", MM_TYPE_BEARER_LIST, G_PARAM_READWRITE)); + g_object_interface_install_property (g_iface, g_param_spec_boolean (MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED, @@ -5292,6 +5297,13 @@ iface_modem_init (gpointer g_iface) FALSE, G_PARAM_READWRITE)); + g_object_interface_install_property + (g_iface, + g_param_spec_boolean (MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, + "Sim Hot Swap Configured", + "Whether the sim hot swap support is configured correctly.", + FALSE, + G_PARAM_READWRITE)); initialized = TRUE; } |