pantech: wait up to 5s after SIM unlock before sending new commands
Or the modem will get stuck completely.
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "ModemManager.h"
|
#include "ModemManager.h"
|
||||||
|
#include "mm-iface-modem.h"
|
||||||
#include "mm-log.h"
|
#include "mm-log.h"
|
||||||
#include "mm-errors-types.h"
|
#include "mm-errors-types.h"
|
||||||
#include "mm-broadband-modem-pantech.h"
|
#include "mm-broadband-modem-pantech.h"
|
||||||
@@ -55,6 +56,41 @@ create_sim (MMIfaceModem *self,
|
|||||||
user_data);
|
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;
|
||||||
|
|
||||||
|
result = g_simple_async_result_new (G_OBJECT (self),
|
||||||
|
callback,
|
||||||
|
user_data,
|
||||||
|
modem_after_sim_unlock);
|
||||||
|
|
||||||
|
/* wait so sim pin is done */
|
||||||
|
g_timeout_add_seconds (5, (GSourceFunc)after_sim_unlock_wait_cb, result);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
MMBroadbandModemPantech *
|
MMBroadbandModemPantech *
|
||||||
@@ -84,6 +120,9 @@ iface_modem_init (MMIfaceModem *iface)
|
|||||||
/* Create Pantech-specific SIM */
|
/* Create Pantech-specific SIM */
|
||||||
iface->create_sim = create_sim;
|
iface->create_sim = create_sim;
|
||||||
iface->create_sim_finish = create_sim_finish;
|
iface->create_sim_finish = create_sim_finish;
|
||||||
|
|
||||||
|
iface->modem_after_sim_unlock = modem_after_sim_unlock;
|
||||||
|
iface->modem_after_sim_unlock_finish = modem_after_sim_unlock_finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user