diff options
author | Ben Chan <benchan@chromium.org> | 2017-10-06 15:59:22 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-10-07 10:41:20 +0200 |
commit | 2768df24b487b82c78b0623000c51d5a0cb30367 (patch) | |
tree | c206291199d86c0b4f443ba3150aa6f16ec9b2a8 | |
parent | aee8bcc7489836a77bfe1c7521dd3bbc55e8f8df (diff) |
iridium: port setup_flow_control to use GTask
-rw-r--r-- | plugins/iridium/mm-broadband-modem-iridium.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/plugins/iridium/mm-broadband-modem-iridium.c b/plugins/iridium/mm-broadband-modem-iridium.c index a5a8495f..3a37ab62 100644 --- a/plugins/iridium/mm-broadband-modem-iridium.c +++ b/plugins/iridium/mm-broadband-modem-iridium.c @@ -168,25 +168,24 @@ 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 (MMBroadbandModemIridium *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (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_task_return_boolean (task, TRUE); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_object_unref (task); } static void @@ -194,13 +193,6 @@ setup_flow_control (MMIfaceModem *self, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - setup_flow_control); - /* Enable RTS/CTS flow control. * Other available values: * AT&K0: Disable flow control @@ -213,7 +205,7 @@ setup_flow_control (MMIfaceModem *self, 3, FALSE, (GAsyncReadyCallback)setup_flow_control_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ |