mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-29 07:12:08 +02:00
manager: only toggle GPIOs for suspend after executing all AT commands
This commit is contained in:
3
src/at.c
3
src/at.c
@@ -80,8 +80,7 @@ static gboolean send_at_command(struct EG25Manager *manager)
|
||||
else
|
||||
manager->modem_state = EG25_STATE_CONFIGURED;
|
||||
} else if (manager->modem_state == EG25_STATE_SUSPENDING) {
|
||||
g_message("suspend sequence is over, drop inhibitor");
|
||||
suspend_inhibit(manager, FALSE);
|
||||
modem_suspend_post(manager);
|
||||
} else if (manager->modem_state == EG25_STATE_RESETTING) {
|
||||
manager->modem_state = EG25_STATE_POWERED;
|
||||
}
|
||||
|
@@ -162,10 +162,16 @@ error:
|
||||
at_sequence_reset(manager);
|
||||
}
|
||||
|
||||
void modem_suspend(struct EG25Manager *manager)
|
||||
void modem_suspend_pre(struct EG25Manager *manager)
|
||||
{
|
||||
at_sequence_suspend(manager);
|
||||
}
|
||||
|
||||
void modem_suspend_post(struct EG25Manager *manager)
|
||||
{
|
||||
gpio_sequence_suspend(manager);
|
||||
at_sequence_suspend(manager);
|
||||
g_message("suspend sequence is over, drop inhibitor");
|
||||
suspend_inhibit(manager, FALSE);
|
||||
}
|
||||
|
||||
void modem_resume_pre(struct EG25Manager *manager)
|
||||
|
@@ -54,7 +54,8 @@ struct EG25Manager {
|
||||
|
||||
void modem_configure(struct EG25Manager *data);
|
||||
void modem_reset(struct EG25Manager *data);
|
||||
void modem_suspend(struct EG25Manager *data);
|
||||
void modem_suspend_pre(struct EG25Manager *data);
|
||||
void modem_suspend_post(struct EG25Manager *data);
|
||||
void modem_resume_pre(struct EG25Manager *data);
|
||||
void modem_resume_post(struct EG25Manager *data);
|
||||
void modem_update_state(struct EG25Manager *data, MMModemState state);
|
||||
|
@@ -94,7 +94,7 @@ 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);
|
||||
|
Reference in New Issue
Block a user