aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-04-10 23:19:33 +0200
committerAleksander Morgado <aleksander@lanedo.com>2013-04-17 15:19:39 +0200
commit8232d023c178f8c804dd550ca567c5cf64710f93 (patch)
treebf3ef126115897a5cc32f3614c73002841be9e59
parent968c2e360a269c994d4e4a571dcf8054b64f4b96 (diff)
port-probe: delay 3s MBIM probing
-rw-r--r--src/mm-port-probe.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c
index 9f55a0a5..5e39373e 100644
--- a/src/mm-port-probe.c
+++ b/src/mm-port-probe.c
@@ -495,6 +495,22 @@ mbim_port_open_ready (MMMbimPort *mbim_port,
task->source_id = g_idle_add ((GSourceFunc)wdm_probe, self);
}
+static gboolean
+mbim_sleep_ready (MMPortProbe *self)
+{
+ PortProbeRunTask *task = self->priv->task;
+
+ task->source_id = 0;
+
+ /* Create a port and try to open it */
+ task->mbim_port = mm_mbim_port_new (g_udev_device_get_name (self->priv->port));
+ mm_mbim_port_open (task->mbim_port,
+ NULL,
+ (GAsyncReadyCallback)mbim_port_open_ready,
+ self);
+ return FALSE;
+}
+
#endif /* WITH_MBIM */
static void
@@ -507,12 +523,7 @@ wdm_probe_mbim (MMPortProbe *self)
g_udev_device_get_subsystem (self->priv->port),
g_udev_device_get_name (self->priv->port));
- /* Create a port and try to open it */
- task->mbim_port = mm_mbim_port_new (g_udev_device_get_name (self->priv->port));
- mm_mbim_port_open (task->mbim_port,
- NULL,
- (GAsyncReadyCallback)mbim_port_open_ready,
- self);
+ task->source_id = g_timeout_add_seconds (3, (GSourceFunc)mbim_sleep_ready, self);
#else
/* If not compiled with MBIM support, just assume we won't have any MBIM port */
mm_port_probe_set_result_mbim (self, FALSE);