From d29bfb5a22339d883e5f7448371c3bbb71610945 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 8 Feb 2017 23:44:58 +0100 Subject: libqmi-glib,device: new qmi_device_close_async() operation The sync close operation that was implemented was partially useless because the source responsible for I/O was scheduled in the main context, so we were really relying on that main context to be still running to properly finish the operation. i.e. a qmi_device_close() after the default main loop was stopped would always end up with a timeout error, as the response was never read. So, we now modify the sync operation so that it doesn't do any explicit wait for the response, we just issue the MBIM close command. And we provide a new async operation that may be used to wait for the MBIM close response. --- src/libqmi-glib/qmi-device.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/libqmi-glib/qmi-device.h') diff --git a/src/libqmi-glib/qmi-device.h b/src/libqmi-glib/qmi-device.h index 22f32c6..6ed832a 100644 --- a/src/libqmi-glib/qmi-device.h +++ b/src/libqmi-glib/qmi-device.h @@ -126,9 +126,19 @@ gboolean qmi_device_open_finish (QmiDevice *self, GAsyncResult *res, GError **error); +G_DEPRECATED gboolean qmi_device_close (QmiDevice *self, GError **error); +void qmi_device_close_async (QmiDevice *self, + guint timeout, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean qmi_device_close_finish (QmiDevice *self, + GAsyncResult *res, + GError **error); + void qmi_device_allocate_client (QmiDevice *self, QmiService service, guint8 cid, -- cgit v1.1