diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-07-25 14:44:14 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-08-04 19:47:45 +0200 |
commit | e51ee31d503ee8c79255f438f10a541448146a3a (patch) | |
tree | f07a131b2534c0e237b9cb987ef1f2bc5baef631 /src/mm-broadband-bearer.c | |
parent | f455ce33b4fc41b055ec706aac7f33c09e76b131 (diff) |
broadband-bearer: run init sequence after flashing in disconnection
The init-sequence configured for the TTY that is being used as data
port must not be launched during the port reopen() sequence; instead
we must run it manually after the port flashing has finished.
Diffstat (limited to 'src/mm-broadband-bearer.c')
-rw-r--r-- | src/mm-broadband-bearer.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c index 0758f013..5dd34f62 100644 --- a/src/mm-broadband-bearer.c +++ b/src/mm-broadband-bearer.c @@ -1460,6 +1460,9 @@ data_flash_cdma_ready (MMPortSerial *data, g_error_free (error); } + /* Run init port sequence in the data port */ + mm_port_serial_at_run_init_sequence (MM_PORT_SERIAL_AT (data)); + g_task_return_boolean (task, TRUE); g_object_unref (task); } @@ -1472,6 +1475,8 @@ data_reopen_cdma_ready (MMPortSerial *data, DetailedDisconnectContext *ctx; GError *error = NULL; + g_object_set (data, MM_PORT_SERIAL_AT_INIT_SEQUENCE_ENABLED, TRUE, NULL); + if (!mm_port_serial_reopen_finish (data, res, &error)) { /* Fatal */ g_task_return_error (task, error); @@ -1512,6 +1517,10 @@ disconnect_cdma (MMBroadbandBearer *self, task = g_task_new (self, NULL, callback, user_data); g_task_set_task_data (task, ctx, (GDestroyNotify)detailed_disconnect_context_free); + /* We don't want to run init sequence right away during the reopen, as we're + * going to flash afterwards. */ + g_object_set (data, MM_PORT_SERIAL_AT_INIT_SEQUENCE_ENABLED, FALSE, NULL); + /* Fully reopen the port before flashing */ mm_dbg ("Reopening data port (%s)...", mm_port_get_device (MM_PORT (ctx->data))); mm_port_serial_reopen (MM_PORT_SERIAL (ctx->data), @@ -1593,6 +1602,9 @@ data_flash_3gpp_ready (MMPortSerial *data, g_error_free (error); } + /* Run init port sequence in the data port */ + mm_port_serial_at_run_init_sequence (MM_PORT_SERIAL_AT (data)); + /* Don't bother doing the CGACT again if it was already done on the * primary or secondary port */ if (ctx->cgact_sent) { @@ -1631,6 +1643,8 @@ data_reopen_3gpp_ready (MMPortSerial *data, DetailedDisconnectContext *ctx; GError *error = NULL; + g_object_set (data, MM_PORT_SERIAL_AT_INIT_SEQUENCE_ENABLED, TRUE, NULL); + if (!mm_port_serial_reopen_finish (data, res, &error)) { /* Fatal */ g_task_return_error (task, error); @@ -1656,6 +1670,10 @@ data_reopen_3gpp (GTask *task) ctx = g_task_get_task_data (task); + /* We don't want to run init sequence right away during the reopen, as we're + * going to flash afterwards. */ + g_object_set (ctx->data, MM_PORT_SERIAL_AT_INIT_SEQUENCE_ENABLED, FALSE, NULL); + /* Fully reopen the port before flashing */ mm_dbg ("Reopening data port (%s)...", mm_port_get_device (MM_PORT (ctx->data))); mm_port_serial_reopen (MM_PORT_SERIAL (ctx->data), |