diff options
author | Loic Poulain <loic.poulain@linaro.org> | 2020-11-27 11:47:06 +0100 |
---|---|---|
committer | Loic Poulain <loic.poulain@linaro.org> | 2020-11-27 11:47:06 +0100 |
commit | 018a24fe3ec288d6095a4454e984e2b7266bc8f9 (patch) | |
tree | ac33b8886dd86075a8fa8fbe9de661e7f294a7c1 | |
parent | 000e272a637d06ca7b76e70dc65a70499507cb09 (diff) |
Change wwan-get-iface place
Only request interface when modem is available.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
-rw-r--r-- | mhi-qmi-connect.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/mhi-qmi-connect.c b/mhi-qmi-connect.c index 6a33537..1e3480f 100644 --- a/mhi-qmi-connect.c +++ b/mhi-qmi-connect.c @@ -857,6 +857,11 @@ static void allocate_dms_client_ready(QmiDevice *dev, GAsyncResult *res) return; } + /* Retrieve wwan interface (not working for qrtr)*/ + wwan_iface = WWAN_DEFAULT_IFACE; + if (qmi_dev) + wwan_iface = qmi_device_get_wwan_iface(device); + qmi_client_dms_get_operating_mode(client_dms, NULL, 10, cancellable, (GAsyncReadyCallback)get_operating_mode_ready, NULL); } @@ -873,11 +878,6 @@ static void device_open_ready(QmiDevice *dev, GAsyncResult *res) return; } - /* Retrieve wwan interface (not working for qrtr)*/ - wwan_iface = WWAN_DEFAULT_IFACE; - if (qmi_dev) - wwan_iface = qmi_device_get_wwan_iface(device); - /* Wait 30s to give time for modem to completely boot */ qmi_device_allocate_client(dev, service_dms, QMI_CID_NONE, 35, cancellable, (GAsyncReadyCallback)allocate_dms_client_ready, NULL); @@ -896,7 +896,9 @@ static void device_new_ready(GObject *unused, GAsyncResult *res) op_shutdown(SHUTDOWN_ERROR); return; } - + + g_print("[%s] Waiting for DMS...\n", qmi_device_get_path_display(device)); + qmi_device_open(device, open_flags, 15, cancellable, (GAsyncReadyCallback)device_open_ready, NULL); } |