diff --git a/src/fsfw/osal/host/Clock.cpp b/src/fsfw/osal/host/Clock.cpp index 19e120b3..2dc9d472 100644 --- a/src/fsfw/osal/host/Clock.cpp +++ b/src/fsfw/osal/host/Clock.cpp @@ -146,7 +146,7 @@ ReturnValue_t Clock::getDateAndTime(TimeOfDay_t* time) { } ReturnValue_t Clock::convertTimeOfDayToTimeval(const TimeOfDay_t* from, timeval* to) { - struct tm time_tm; + struct tm time_tm{}; time_tm.tm_year = from->year - 1900; time_tm.tm_mon = from->month - 1; diff --git a/src/fsfw/osal/linux/Clock.cpp b/src/fsfw/osal/linux/Clock.cpp index 534e7e22..afb4ce3a 100644 --- a/src/fsfw/osal/linux/Clock.cpp +++ b/src/fsfw/osal/linux/Clock.cpp @@ -122,7 +122,7 @@ ReturnValue_t Clock::getDateAndTime(TimeOfDay_t* time) { MutexGuard helper(timeMutex); // gmtime writes its output in a global buffer which is not Thread Safe // Therefore we have to use a Mutex here - struct tm* timeInfo; + struct telemetry* timeInfo; timeInfo = gmtime(&timeUnix.tv_sec); time->year = timeInfo->tm_year + 1900; time->month = timeInfo->tm_mon + 1; @@ -136,7 +136,7 @@ ReturnValue_t Clock::getDateAndTime(TimeOfDay_t* time) { } ReturnValue_t Clock::convertTimeOfDayToTimeval(const TimeOfDay_t* from, timeval* to) { - tm fromTm; + telemetry fromTm; // Note: Fails for years before AD fromTm.tm_year = from->year - 1900; fromTm.tm_mon = from->month - 1; diff --git a/src/fsfw/pus/Service17Test.cpp b/src/fsfw/pus/Service17Test.cpp index 52319de1..ea2c06e1 100644 --- a/src/fsfw/pus/Service17Test.cpp +++ b/src/fsfw/pus/Service17Test.cpp @@ -17,12 +17,12 @@ ReturnValue_t Service17Test::handleRequest(uint8_t subservice) { switch (subservice) { case Subservice::CONNECTION_TEST: { storeHelper.preparePacket(serviceId, Subservice::CONNECTION_TEST_REPORT, packetSubCounter); - return tm::storeAndSendTmPacket(storeHelper, sendHelper); + return telemetry::storeAndSendTmPacket(storeHelper, sendHelper); } case Subservice::EVENT_TRIGGER_TEST: { storeHelper.preparePacket(serviceId, Subservice::CONNECTION_TEST_REPORT, packetSubCounter++); triggerEvent(TEST, 1234, 5678); - return tm::storeAndSendTmPacket(storeHelper, sendHelper); + return telemetry::storeAndSendTmPacket(storeHelper, sendHelper); } default: return AcceptsTelecommandsIF::INVALID_SUBSERVICE; diff --git a/src/fsfw/pus/Service1TelecommandVerification.cpp b/src/fsfw/pus/Service1TelecommandVerification.cpp index 35957ba0..93525958 100644 --- a/src/fsfw/pus/Service1TelecommandVerification.cpp +++ b/src/fsfw/pus/Service1TelecommandVerification.cpp @@ -70,7 +70,7 @@ ReturnValue_t Service1TelecommandVerification::generateFailureReport( message->getParameter1(), message->getParameter2()); storeHelper.preparePacket(serviceId, message->getReportId(), packetSubCounter++); storeHelper.setSourceDataSerializable(&report); - return tm::storeAndSendTmPacket(storeHelper, sendHelper); + return telemetry::storeAndSendTmPacket(storeHelper, sendHelper); } ReturnValue_t Service1TelecommandVerification::generateSuccessReport( @@ -79,7 +79,7 @@ ReturnValue_t Service1TelecommandVerification::generateSuccessReport( message->getTcSequenceControl(), message->getStep()); storeHelper.preparePacket(serviceId, message->getReportId(), packetSubCounter++); storeHelper.setSourceDataSerializable(&report); - return tm::storeAndSendTmPacket(storeHelper, sendHelper); + return telemetry::storeAndSendTmPacket(storeHelper, sendHelper); } ReturnValue_t Service1TelecommandVerification::initialize() { diff --git a/src/fsfw/pus/Service5EventReporting.cpp b/src/fsfw/pus/Service5EventReporting.cpp index 31cc72f5..847f5f80 100644 --- a/src/fsfw/pus/Service5EventReporting.cpp +++ b/src/fsfw/pus/Service5EventReporting.cpp @@ -49,7 +49,7 @@ ReturnValue_t Service5EventReporting::generateEventReport(EventMessage message) message.getParameter2()); storeHelper.preparePacket(serviceId, message.getSeverity(), packetSubCounter); storeHelper.setSourceDataSerializable(&report); - ReturnValue_t result = tm::storeAndSendTmPacket(storeHelper, sendHelper); + ReturnValue_t result = telemetry::storeAndSendTmPacket(storeHelper, sendHelper); if (result != HasReturnvaluesIF::RETURN_OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "Service5EventReporting::generateEventReport: " diff --git a/src/fsfw/tmtcservices/CommandingServiceBase.cpp b/src/fsfw/tmtcservices/CommandingServiceBase.cpp index 897dd962..6abe625b 100644 --- a/src/fsfw/tmtcservices/CommandingServiceBase.cpp +++ b/src/fsfw/tmtcservices/CommandingServiceBase.cpp @@ -5,7 +5,6 @@ #include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/tcdistribution/PUSDistributorIF.h" #include "fsfw/tmtcpacket/pus/tc.h" -#include "fsfw/tmtcpacket/pus/tm.h" #include "fsfw/tmtcservices/AcceptsTelemetryIF.h" #include "fsfw/tmtcservices/TmTcMessage.h" #include "fsfw/tmtcservices/tcHelpers.h" @@ -290,7 +289,7 @@ ReturnValue_t CommandingServiceBase::sendTmPacket(uint8_t subservice, const uint size_t sourceDataLen) { tmStoreHelper.preparePacket(service, subservice, tmPacketCounter); tmStoreHelper.setSourceDataRaw(sourceData, sourceDataLen); - ReturnValue_t result = tm::storeAndSendTmPacket(tmStoreHelper, tmSendHelper); + ReturnValue_t result = telemetry::storeAndSendTmPacket(tmStoreHelper, tmSendHelper); if (result == HasReturnvaluesIF::RETURN_OK) { this->tmPacketCounter++; } @@ -299,10 +298,10 @@ ReturnValue_t CommandingServiceBase::sendTmPacket(uint8_t subservice, const uint ReturnValue_t CommandingServiceBase::sendTmPacket(uint8_t subservice, object_id_t objectId, const uint8_t* data, size_t dataLen) { - tm::SourceDataWithObjectIdPrefix dataWithObjId(objectId, data, dataLen); + telemetry::SourceDataWithObjectIdPrefix dataWithObjId(objectId, data, dataLen); tmStoreHelper.preparePacket(service, subservice, tmPacketCounter); tmStoreHelper.setSourceDataSerializable(&dataWithObjId); - ReturnValue_t result = tm::storeAndSendTmPacket(tmStoreHelper, tmSendHelper); + ReturnValue_t result = telemetry::storeAndSendTmPacket(tmStoreHelper, tmSendHelper); if (result == HasReturnvaluesIF::RETURN_OK) { this->tmPacketCounter++; } @@ -312,7 +311,7 @@ ReturnValue_t CommandingServiceBase::sendTmPacket(uint8_t subservice, object_id_ ReturnValue_t CommandingServiceBase::sendTmPacket(uint8_t subservice, SerializeIF* sourceData) { tmStoreHelper.preparePacket(service, subservice, tmPacketCounter); tmStoreHelper.setSourceDataSerializable(sourceData); - ReturnValue_t result = tm::storeAndSendTmPacket(tmStoreHelper, tmSendHelper); + ReturnValue_t result = telemetry::storeAndSendTmPacket(tmStoreHelper, tmSendHelper); if (result == HasReturnvaluesIF::RETURN_OK) { this->tmPacketCounter++; } diff --git a/src/fsfw/tmtcservices/CommandingServiceBase.h b/src/fsfw/tmtcservices/CommandingServiceBase.h index a58a1a93..9b8aa61e 100644 --- a/src/fsfw/tmtcservices/CommandingServiceBase.h +++ b/src/fsfw/tmtcservices/CommandingServiceBase.h @@ -15,9 +15,6 @@ #include "fsfw/storagemanager/StorageManagerIF.h" #include "fsfw/tasks/ExecutableObjectIF.h" -class TcPacketStoredBase; -class TcPacketStoredPus; - namespace Factory { void setStaticFrameworkObjectIds(); } diff --git a/src/fsfw/tmtcservices/tmHelpers.cpp b/src/fsfw/tmtcservices/tmHelpers.cpp index 91026d6c..d7bc66cf 100644 --- a/src/fsfw/tmtcservices/tmHelpers.cpp +++ b/src/fsfw/tmtcservices/tmHelpers.cpp @@ -1,6 +1,7 @@ #include "tmHelpers.h" -ReturnValue_t tm::storeAndSendTmPacket(TmStoreHelper &storeHelper, TmSendHelper &sendHelper) { +ReturnValue_t telemetry::storeAndSendTmPacket(TmStoreHelper &storeHelper, + TmSendHelper &sendHelper) { storeHelper.addPacketToStore(); ReturnValue_t result = sendHelper.sendPacket(storeHelper.getCurrentAddr()); if (result != HasReturnvaluesIF::RETURN_OK) { diff --git a/src/fsfw/tmtcservices/tmHelpers.h b/src/fsfw/tmtcservices/tmHelpers.h index 871a7f1a..2e783039 100644 --- a/src/fsfw/tmtcservices/tmHelpers.h +++ b/src/fsfw/tmtcservices/tmHelpers.h @@ -4,7 +4,8 @@ #include "TmSendHelper.h" #include "TmStoreHelper.h" -namespace tm { +// I'd prefer to use tm, but there have been nameclashes with the tm struct +namespace telemetry { ReturnValue_t storeAndSendTmPacket(TmStoreHelper& storeHelper, TmSendHelper& sendHelper); @@ -42,6 +43,6 @@ class SourceDataWithObjectIdPrefix : public SerializeIF { size_t srcDataLen; }; -} // namespace tm +} // namespace telemetry #endif // FSFW_TMTCSERVICES_TMHELPERS_H_