Re: [PATCH] modem-manager: wait up to 120s for the connection result



On Tue, 2013-04-09 at 19:09 +0200, Aleksander Morgado wrote:
We will very likely get the result of the connection attempt before the 2 mins,
either successful or error, but still we need to explicitly ask to keep the
DBus call open enough time.

This time should be enough to handle both the connection time (usually around
60s max), plus the time needed to register in the network and all the other
Simple.Connect() steps.

Pushed, thanks.

Dan

---
 src/modem-manager/nm-modem-broadband.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/modem-manager/nm-modem-broadband.c b/src/modem-manager/nm-modem-broadband.c
index 05cd356..f294435 100644
--- a/src/modem-manager/nm-modem-broadband.c
+++ b/src/modem-manager/nm-modem-broadband.c
@@ -57,6 +57,9 @@ enum {
 
 #define MODEM_CAPS_3GPP2(caps) (caps & (MM_MODEM_CAPABILITY_CDMA_EVDO))
 
+/* Maximum time to keep the DBus call waiting for a connection result */
+#define MODEM_CONNECT_TIMEOUT_SECS 120
+
 /*****************************************************************************/
 
 #define NM_MODEM_BROADBAND_ERROR (nm_modem_broadband_error_quark ())
@@ -360,6 +363,7 @@ act_stage1_prepare (NMModem *_self,
              if (!self->priv->simple_iface)
                      self->priv->simple_iface = mm_object_get_modem_simple (self->priv->modem_object);
 
+             g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (self->priv->simple_iface), 
MODEM_CONNECT_TIMEOUT_SECS * 1000);
              mm_modem_simple_connect (self->priv->simple_iface,
                                       self->priv->connect_properties,
                                       NULL,




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]