From 032bd4651cb9dc06630ece548d9bbf22143533df Mon Sep 17 00:00:00 2001 From: Bhushan Shah Date: Thu, 11 Mar 2021 12:13:04 +0530 Subject: [PATCH] at: if we are using ofono, don't query modem manager for state --- src/at.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/at.c b/src/at.c index 4b5cd62..32138d0 100644 --- a/src/at.c +++ b/src/at.c @@ -76,12 +76,16 @@ static gboolean send_at_command(struct EG25Manager *manager) g_message("Sending command: %s", g_strstrip(command)); } else if (manager->modem_state < EG25_STATE_CONFIGURED) { - MMModemState modem_state = mm_modem_get_state(manager->mm_modem); + if (manager->modem_iface == MODEM_IFACE_MODEMMANAGER) { + 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 + if (manager->mm_modem && modem_state >= MM_MODEM_STATE_REGISTERED) + modem_update_state(manager, modem_state); + else + manager->modem_state = EG25_STATE_CONFIGURED; + } else { manager->modem_state = EG25_STATE_CONFIGURED; + } } else if (manager->modem_state == EG25_STATE_SUSPENDING) { modem_suspend_post(manager); } else if (manager->modem_state == EG25_STATE_RESETTING) {