diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-09-20 21:54:04 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-10-07 13:40:30 +0200 |
commit | e1b2b88e682d68c1554f5c8014c19fe27aebc9af (patch) | |
tree | 94b3a4c2d84ab3cba6731c969ce5ce78c1a32bee | |
parent | 926e0176fbcbc47a44b83f826492e69af3e62226 (diff) |
cinterion: port setup_flow_control to GTask
-rw-r--r-- | plugins/cinterion/mm-broadband-modem-cinterion.c | 39 |
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); } /*****************************************************************************/ |