aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-12-17 11:09:14 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-12-26 11:02:45 +0100
commit1ffd693f54ce71ec357b1f574d8340d66fd7bcd9 (patch)
tree705e558f6e82d7a90550c167c9d3af42481ff318
parent1199fa934d663ececb58339d7029d16edecc8c08 (diff)
iface-modem-simple: fix connection attempt start place
The 'ENABLE + 1' step is 'WAIT_FOR_ENABLED' really, and that should be only used when the current state is not a final one. If we're already enabled, or registered, or connected, then jump to 'REGISTER' right away.
-rw-r--r--src/mm-iface-modem-simple.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mm-iface-modem-simple.c b/src/mm-iface-modem-simple.c
index 8a30a316..57ee18ed 100644
--- a/src/mm-iface-modem-simple.c
+++ b/src/mm-iface-modem-simple.c
@@ -765,17 +765,18 @@ connect_auth_ready (MMBaseModem *self,
case MM_MODEM_STATE_ENABLING:
case MM_MODEM_STATE_DISCONNECTING:
- /* If we are transitioning to the ENABLED/REGISTERED state,
- * wait to get there before going on */
+ case MM_MODEM_STATE_SEARCHING:
+ case MM_MODEM_STATE_CONNECTING:
+ /* Wait to get to a final state before going on */
ctx->step = CONNECTION_STEP_WAIT_FOR_ENABLED;
break;
case MM_MODEM_STATE_ENABLED:
- case MM_MODEM_STATE_SEARCHING:
case MM_MODEM_STATE_REGISTERED:
- case MM_MODEM_STATE_CONNECTING:
case MM_MODEM_STATE_CONNECTED:
- ctx->step = CONNECTION_STEP_ENABLE + 1;
+ /* If we are at least already enabled, start at the registration check
+ * right away */
+ ctx->step = CONNECTION_STEP_REGISTER;
break;
default: