diff --git a/src/at.c b/src/at.c index 2c79bf8..af26f51 100644 --- a/src/at.c +++ b/src/at.c @@ -129,12 +129,14 @@ gboolean at_send_command(struct EG25Manager *manager) if (manager->modem_state < EG25_STATE_CONFIGURED) { if (manager->modem_iface == MODEM_IFACE_MODEMMANAGER) { #ifdef HAVE_MMGLIB - MMModemState modem_state = mm_modem_get_state(manager->mm_modem); + if (manager->modem_state == EG25_STATE_ACQUIRED) { + MMModemState modem_state = mm_modem_get_state(manager->mm_modem); - if (manager->mm_modem && modem_state >= MM_MODEM_STATE_REGISTERED) - modem_update_state(manager, modem_state); - else - manager->modem_state = EG25_STATE_CONFIGURED; + if (manager->mm_modem && modem_state >= MM_MODEM_STATE_REGISTERED) + modem_update_state(manager, modem_state); + else + manager->modem_state = EG25_STATE_CONFIGURED; + } #endif } else { manager->modem_state = EG25_STATE_CONFIGURED;