Ublox TOBY-L210 needs two retries to connect
Penalva, Salvador
Salvador.Penalva at digi.com
Mon May 8 11:52:00 UTC 2017
Hi,
I did these changes but it didn't work. I added a debug message to determine when the wait_function was being called. The first attempt of connection that fails, never calls that function, so I think that the timeout is not being applied. However the second attempt, the one that connects is calling the function.
Here you go the changes I applied, in case I did something wrong.
Thanks,
Salvador
---
Author: Salvador Penalva <salvador.penalva at digi.com> 2017-05-08 13:45:20
Committer: Salvador Penalva <salvador.penalva at digi.com> 2017-05-08 13:45:20
Parent: 2373a4b65843847e3dacca958f0bab833032b796 (port-qmi: fix QMI client allocation procedure)
Child: 0000000000000000000000000000000000000000 (Local uncommitted changes, not checked in to index)
Branch: master
Follows: 1.6.0
Precedes:
Changes in ublox plugin to wait for unlock.
------------------- plugins/ublox/mm-broadband-modem-ublox.c -------------------
index 64dd9de..a0f22e2 100644
@@ -899,6 +899,42 @@ modem_create_bearer (MMIfaceModem *self,
}
/*****************************************************************************/
+/* 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)
+{
+ mm_dbg("I'm inside wait function");
+ g_simple_async_result_complete (result);
+ g_object_unref (result);
+ return G_SOURCE_REMOVE;
+}
+
+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);
+}
+
+/*****************************************************************************/
MMBroadbandModemUblox *
mm_broadband_modem_ublox_new (const gchar *device,
@@ -957,6 +993,8 @@ iface_modem_init (MMIfaceModem *iface)
iface->load_current_bands_finish = load_current_bands_finish;
iface->set_current_bands = set_current_bands;
iface->set_current_bands_finish = common_set_current_modes_bands_finish;
+ iface->modem_after_sim_unlock = modem_after_sim_unlock;
+ iface->modem_after_sim_unlock_finish = modem_after_sim_unlock_finish;
}
static void
-----Original Message-----
From: Aleksander Morgado [mailto:aleksander at aleksander.es]
Sent: viernes, 05 de mayo de 2017 17:56
To: Penalva, Salvador
Cc: ModemManager (development)
Subject: Re: Ublox TOBY-L210 needs two retries to connect
On Fri, May 5, 2017 at 5:53 PM, Penalva, Salvador <Salvador.Penalva at digi.com> wrote:
> I don't mind testing these changes, but I may need a little further guidance to do the changes. The files mm-broadband-modem-pantech.c and mm-broadband-modem-ublox.c are quite different...
>
> I have copied in the ublox file the whole block of after_sim_unlock (the three fucntions). However the pantech file call these functions inside the function " iface_modem_init " that is really different to the same function in the ublox program.
>
> Is it enough just coping the lines
>
> iface->modem_after_sim_unlock = modem_after_sim_unlock;
> iface->modem_after_sim_unlock_finish =
> modem_after_sim_unlock_finish;
>
> at the end of the modem_init function in the ublox plugin?
>
Yes, that should do it.
--
Aleksander
https://aleksander.es
More information about the ModemManager-devel
mailing list