manager: make sure we don't reset the modem twice in a row

This patch adds a 3s delay when resetting the modem during which we 
avoid triggering a new reset. This makes sure we don't trigger a reset 
twice in a row.

It also disables any related running timer to avoid being re-triggered 
unnecessarily.
This commit is contained in:
Arnaud Ferraris
2020-12-18 00:45:58 +01:00
parent c39000bf93
commit 74b91c7d58
4 changed files with 34 additions and 8 deletions

View File

@@ -35,7 +35,10 @@ static void add_modem(struct EG25Manager *manager, GDBusObject *object)
g_assert(manager->mm_modem != NULL);
if (manager->modem_state == EG25_STATE_RESUMING) {
g_source_remove(manager->suspend_source);
if (manager->suspend_source) {
g_source_remove(manager->suspend_source);
manager->suspend_source = 0;
}
modem_resume_post(manager);
manager->modem_state = EG25_STATE_CONFIGURED;
}