wavecom: implement after-sim-unlock step

Just give some time to the SIM to get properly initialized, so that we avoid
errors when reloading e.g. facility lock status.
This commit is contained in:
Aleksander Morgado
2014-02-12 17:18:24 +01:00
parent 5d2f15041b
commit e60485a4aa

View File

@@ -1045,6 +1045,43 @@ load_access_technologies (MMIfaceModem *self,
user_data);
}
/*****************************************************************************/
/* After SIM unlock (Modem interface) */
static gboolean
modem_after_sim_unlock_finish (MMIfaceModem *self,
GAsyncResult *res,
GError **error)
{
return TRUE;
}
static gboolean
after_sim_unlock_wait_cb (GSimpleAsyncResult *result)
{
g_simple_async_result_complete (result);
g_object_unref (result);
return FALSE;
}
static void
modem_after_sim_unlock (MMIfaceModem *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
GSimpleAsyncResult *result;
/* A short wait is necessary for SIM to become ready, otherwise reloading
* facility lock states may fail with a +CME ERROR: 515 error.
*/
result = g_simple_async_result_new (G_OBJECT (self),
callback,
user_data,
modem_after_sim_unlock);
g_timeout_add_seconds (5, (GSourceFunc)after_sim_unlock_wait_cb, result);
}
/*****************************************************************************/
/* Flow control (Modem interface) */
@@ -1198,6 +1235,8 @@ iface_modem_init (MMIfaceModem *iface)
iface->set_current_bands_finish = set_current_bands_finish;
iface->load_access_technologies = load_access_technologies;
iface->load_access_technologies_finish = load_access_technologies_finish;
iface->modem_after_sim_unlock = modem_after_sim_unlock;
iface->modem_after_sim_unlock_finish = modem_after_sim_unlock_finish;
iface->setup_flow_control = setup_flow_control;
iface->setup_flow_control_finish = setup_flow_control_finish;
iface->modem_power_up = modem_power_up;