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:
Arnaud Ferraris
2020-12-11 11:56:14 +01:00
parent 8d31e39e89
commit ff9b26b831
4 changed files with 13 additions and 5 deletions

View File

@@ -132,6 +132,9 @@ static void object_removed_cb(struct EG25Manager *manager, GDBusObject *object)
path = g_dbus_object_get_object_path(object);
g_message("ModemManager object `%s' removed", path);
if (manager->modem_state == EG25_STATE_SUSPENDING)
modem_suspend_post(manager);
manager->mm_modem = NULL;
if (manager->modem_usb_id) {
g_free(manager->modem_usb_id);