aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis-Alexis Eyraud <louis-alexis.eyraud@sigfox.com>2021-01-15 15:14:58 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-01-16 10:27:58 +0000
commit9c353cf6f0a7650cfe1b914d6881890de9dff0b0 (patch)
tree0d94e9bbe540d997bad31e5e5292a1600a5501e5
parent89cd1696c3a105f314b1a7e275c68377ed6df5e4 (diff)
zte: add 1 second delay after sim unlock to avoid IMSI reading issue
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/306 Signed-off-by: Louis-Alexis Eyraud <louis-alexis.eyraud@sigfox.com>
-rw-r--r--plugins/zte/mm-broadband-modem-zte.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/plugins/zte/mm-broadband-modem-zte.c b/plugins/zte/mm-broadband-modem-zte.c
index 64549cd8..08bbed83 100644
--- a/plugins/zte/mm-broadband-modem-zte.c
+++ b/plugins/zte/mm-broadband-modem-zte.c
@@ -187,6 +187,19 @@ modem_after_sim_unlock_context_step (GTask *task)
task);
}
+static gboolean
+after_sim_unlock_wait_cb (GTask *task)
+{
+ /* Attempt to disable floods of "+ZUSIMR:2" unsolicited responses that
+ * eventually fill up the device's buffers and make it crash. Normally
+ * done during probing, but if the device has a PIN enabled it won't
+ * accept the +CPMS? during the probe and we have to do it here.
+ */
+ modem_after_sim_unlock_context_step (task);
+
+ return G_SOURCE_REMOVE;
+}
+
static void
modem_after_sim_unlock (MMIfaceModem *self,
GAsyncReadyCallback callback,
@@ -201,12 +214,7 @@ modem_after_sim_unlock (MMIfaceModem *self,
task = g_task_new (self, NULL, callback, user_data);
g_task_set_task_data (task, ctx, g_free);
- /* Attempt to disable floods of "+ZUSIMR:2" unsolicited responses that
- * eventually fill up the device's buffers and make it crash. Normally
- * done during probing, but if the device has a PIN enabled it won't
- * accept the +CPMS? during the probe and we have to do it here.
- */
- modem_after_sim_unlock_context_step (task);
+ g_timeout_add_seconds (1, (GSourceFunc)after_sim_unlock_wait_cb, task);
}
/*****************************************************************************/