aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/cinterion/mm-broadband-modem-cinterion.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/plugins/cinterion/mm-broadband-modem-cinterion.c b/plugins/cinterion/mm-broadband-modem-cinterion.c
index 808d04c4..3fe1f5c7 100644
--- a/plugins/cinterion/mm-broadband-modem-cinterion.c
+++ b/plugins/cinterion/mm-broadband-modem-cinterion.c
@@ -1384,45 +1384,40 @@ set_current_bands (MMIfaceModem *self,
}
/*****************************************************************************/
-/* FLOW CONTROL */
+/* Flow control */
static gboolean
-setup_flow_control_finish (MMIfaceModem *self,
- GAsyncResult *res,
- GError **error)
+setup_flow_control_finish (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error)
{
- return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
+ return g_task_propagate_boolean (G_TASK (res), error);
}
static void
-setup_flow_control_ready (MMBroadbandModemCinterion *self,
+setup_flow_control_ready (MMBaseModem *self,
GAsyncResult *res,
- GSimpleAsyncResult *operation_result)
+ GTask *task)
{
GError *error = NULL;
- if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error))
+ if (!mm_base_modem_at_command_finish (self, res, &error))
/* Let the error be critical. We DO need RTS/CTS in order to have
* proper modem disabling. */
- g_simple_async_result_take_error (operation_result, error);
+ g_task_return_error (task, error);
else
- g_simple_async_result_set_op_res_gboolean (operation_result, TRUE);
-
- g_simple_async_result_complete (operation_result);
- g_object_unref (operation_result);
+ g_task_return_boolean (task, TRUE);
+ g_object_unref (task);
}
static void
-setup_flow_control (MMIfaceModem *self,
- GAsyncReadyCallback callback,
- gpointer user_data)
+setup_flow_control (MMIfaceModem *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
- GSimpleAsyncResult *result;
+ GTask *task;
- result = g_simple_async_result_new (G_OBJECT (self),
- callback,
- user_data,
- setup_flow_control);
+ task = g_task_new (self, NULL, callback, user_data);
/* We need to enable RTS/CTS so that CYCLIC SLEEP mode works */
mm_base_modem_at_command (MM_BASE_MODEM (self),
@@ -1430,7 +1425,7 @@ setup_flow_control (MMIfaceModem *self,
3,
FALSE,
(GAsyncReadyCallback)setup_flow_control_ready,
- result);
+ task);
}
/*****************************************************************************/