From d620a8a4a0babe85435eed633b503678d262c791 Mon Sep 17 00:00:00 2001 From: Kuba Date: Tue, 12 Oct 2021 14:19:42 +0200 Subject: [PATCH] [EGD-7615] Fix Modem soft reset Cellular is configuring modem after reset. --- module-services/service-cellular/ServiceCellular.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/module-services/service-cellular/ServiceCellular.cpp b/module-services/service-cellular/ServiceCellular.cpp index 988a811b946fb0f38341f96344b17847d7b3c448..81fb4581a03b77acdeb1c9eb977716cb9c0457ff 100644 --- a/module-services/service-cellular/ServiceCellular.cpp +++ b/module-services/service-cellular/ServiceCellular.cpp @@ -586,6 +586,7 @@ bool ServiceCellular::resetCellularModule(ResetType type) switch (type) { case ResetType::SoftReset: if (auto response = channel->cmd(at::AT::CFUN_RESET); response.code == at::Result::Code::OK) { + isAfterForceReboot = true; return true; } LOG_ERROR("Cellular modem reset failed."); @@ -820,11 +821,13 @@ bool ServiceCellular::handle_power_down_waiting() bool ServiceCellular::handle_power_down() { LOG_DEBUG("Powered Down"); - isAfterForceReboot = true; cmux.reset(); cmux = std::make_unique(PortSpeed_e::PS460800, this); + if (isAfterForceReboot) { + priv->state->set(State::ST::PowerUpInProgress); + } return true; } @@ -884,7 +887,11 @@ bool ServiceCellular::handle_audio_conf_procedure() return false; } - priv->tetheringHandler->configure(); + if (!priv->tetheringHandler->configure()) { + resetCellularModule(ResetType::SoftReset); + priv->state->set(State::ST::Idle); + return true; + } priv->state->set(State::ST::APNConfProcedure); return true;