diff --git a/mission/com/CcsdsIpCoreHandler.cpp b/mission/com/CcsdsIpCoreHandler.cpp index 766fd67c..78533165 100644 --- a/mission/com/CcsdsIpCoreHandler.cpp +++ b/mission/com/CcsdsIpCoreHandler.cpp @@ -246,7 +246,12 @@ ReturnValue_t CcsdsIpCoreHandler::checkModeCommand(Mode_t mode, Submode_t submod void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) { triggerEvent(CHANGING_MODE, mode, submode); if (mode == HasModesIF::MODE_ON) { - if (this->submode != submode) { + // Check whether the rate actually changes. + if ((this->submode != submode) and + ((submode == static_cast(com::CcsdsSubmode::DATARATE_LOW) and + ptmeConfig.getRate() != RATE_100KBPS)) or + ((submode == static_cast(com::CcsdsSubmode::DATARATE_HIGH) and + ptmeConfig.getRate() != RATE_500KBPS))) { initPtmeUpdateAfterXCycles(); updateContext.enableTransmitAfterPtmeUpdate = true; updateContext.updateClockRate = true; @@ -255,7 +260,6 @@ void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) { updateContext.setModeAfterUpdate = true; return; } - if(ptmeConfig.setRate(bitRate)) // No rate change, so enable transmitter right away. enableTransmit(); } else if (mode == HasModesIF::MODE_OFF) {