at: don't clear the resetting state on sequence end

If the reset sequence fails, we don't want to transition to the powered
state, instead we should stay in the resetting state so we eventually
timeout and try a gpio reset. If the reset command succeeds the modem
will eventually send RDY and transition the state to STARTED.

Since this might take longer to change the modem state, add 15 seconds
(for a total of 45) to the at reset timeout just in case. It looks like
the modem typically takes about 20 between sending "AT+CFUN=1,1" and
receiving "RDY", so this should be plenty.
This commit is contained in:
Aren Moynihan
2024-10-28 12:11:23 -04:00
parent ec96153b0f
commit ce0fc25892
2 changed files with 1 additions and 3 deletions

View File

@@ -146,8 +146,6 @@ gboolean at_send_command(struct EG25Manager *manager)
}
} else if (manager->modem_state == EG25_STATE_SUSPENDING) {
modem_suspend_post(manager);
} else if (manager->modem_state == EG25_STATE_RESETTING) {
manager->modem_state = EG25_STATE_POWERED;
}
}

View File

@@ -271,7 +271,7 @@ error:
at_sequence_reset(manager);
// Setup timer for making sure we don't queue other reset commands
manager->complete_reset_timer = g_timeout_add_seconds(30, G_SOURCE_FUNC(modem_at_reset_done), manager);
manager->complete_reset_timer = g_timeout_add_seconds(45, G_SOURCE_FUNC(modem_at_reset_done), manager);
return G_SOURCE_REMOVE;
}