mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-29 23:32:14 +02:00
manager: split modem_suspend() into _pre() and _post() functions
This way we can make sure the AT commands are executed only once ModemManager has released the modem, preventing any race condition.
This commit is contained in:
@@ -92,13 +92,11 @@ static void signal_cb(GDBusProxy *proxy,
|
||||
|
||||
if (is_about_to_suspend) {
|
||||
g_message("system is about to suspend");
|
||||
manager->modem_state = EG25_STATE_SUSPENDING;
|
||||
modem_suspend(manager);
|
||||
modem_suspend_pre(manager);
|
||||
} else {
|
||||
g_message("system is resuming");
|
||||
take_inhibitor(manager);
|
||||
modem_resume_pre(manager);
|
||||
manager->modem_state = EG25_STATE_RESUMING;
|
||||
manager->suspend_source = g_timeout_add_seconds(8, G_SOURCE_FUNC(check_modem_resume), manager);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user