diff --git a/mission/tmtc/CcsdsIpCoreHandler.cpp b/mission/tmtc/CcsdsIpCoreHandler.cpp index f31aeaa4..85d1143b 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.cpp +++ b/mission/tmtc/CcsdsIpCoreHandler.cpp @@ -135,10 +135,12 @@ ReturnValue_t CcsdsIpCoreHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } + transmitterCountdown.setTimeout(transmitterTimeout); + transmitterCountdown.timeOut(); + #if OBSW_SYRLINKS_SIMULATED == 1 // Update data on rising edge ptmeConfig->invertTxClock(false); - transmitterCountdown.setTimeout(transmitterTimeout); linkState = UP; forwardLinkstate(); #endif /* OBSW_SYRLINKS_SIMULATED == 1*/ @@ -348,6 +350,9 @@ void CcsdsIpCoreHandler::enableTransmit() { gpioIF->pullHigh(enTxClock); gpioIF->pullHigh(enTxData); #endif + linkState = UP; + forwardLinkstate(); + transmitterCountdown.resetTimer(); } void CcsdsIpCoreHandler::checkTxTimer() { @@ -356,6 +361,7 @@ void CcsdsIpCoreHandler::checkTxTimer() { } if (transmitterCountdown.hasTimedOut()) { disableTransmit(); + //TODO: set mode to off (move timer to subsystem) } } @@ -425,7 +431,7 @@ void CcsdsIpCoreHandler::disableTransmit() { #endif linkState = DOWN; forwardLinkstate(); - transmitterCountdown.setTimeout(0); + transmitterCountdown.timeOut(); } const char* CcsdsIpCoreHandler::getName() const { return "CCSDS Handler"; }