diff --git a/src/fsfw/datapoollocal/ProvidesDataPoolSubscriptionIF.h b/src/fsfw/datapoollocal/ProvidesDataPoolSubscriptionIF.h index 3001ea10..682cfa5c 100644 --- a/src/fsfw/datapoollocal/ProvidesDataPoolSubscriptionIF.h +++ b/src/fsfw/datapoollocal/ProvidesDataPoolSubscriptionIF.h @@ -70,9 +70,7 @@ class ProvidesDataPoolSubscriptionIF { virtual ReturnValue_t subscribeForDiagPeriodicPacket( subdp::DiagnosticsHkPeriodicParams params) = 0; - [[deprecated( - "Please use the new API which takes all arguments as one wrapper " - "struct")]] virtual ReturnValue_t + virtual ReturnValue_t subscribeForPeriodicPacket(sid_t sid, bool enableReporting, float collectionInterval, bool isDiagnostics) { return subscribeForPeriodicPacket(sid, enableReporting, collectionInterval, isDiagnostics, @@ -106,12 +104,11 @@ class ProvidesDataPoolSubscriptionIF { virtual ReturnValue_t subscribeForRegularUpdatePacket(subdp::RegularHkUpdateParams params) = 0; virtual ReturnValue_t subscribeForDiagUpdatePacket(subdp::DiagnosticsHkUpdateParams params) = 0; - [[deprecated( - "Please use the new API which takes all arguments as one wrapper " - "struct")]] virtual ReturnValue_t + virtual ReturnValue_t subscribeForUpdatePacket(sid_t sid, bool reportingEnabled, bool isDiagnostics) { return subscribeForUpdatePacket(sid, reportingEnabled, isDiagnostics, objects::NO_OBJECT); } + [[deprecated( "Please use the new API which takes all arguments as one wrapper " "struct")]] virtual ReturnValue_t diff --git a/src/fsfw/tmtcpacket/pus/tm/PusTmCreator.cpp b/src/fsfw/tmtcpacket/pus/tm/PusTmCreator.cpp index 6e6eb686..850eb078 100644 --- a/src/fsfw/tmtcpacket/pus/tm/PusTmCreator.cpp +++ b/src/fsfw/tmtcpacket/pus/tm/PusTmCreator.cpp @@ -12,6 +12,14 @@ PusTmCreator::PusTmCreator(SpacePacketParams initSpParams, PusTmParams initPusPa PusTmCreator::PusTmCreator() { setup(); } +void PusTmCreator::disableCrcCalculation() { + calculateCrcOnSerialization = false; +} + +void PusTmCreator::enableCrcCalculation() { + calculateCrcOnSerialization = true; +} + uint16_t PusTmCreator::getPacketIdRaw() const { return spCreator.getPacketIdRaw(); } uint16_t PusTmCreator::getPacketSeqCtrlRaw() const { return spCreator.getPacketSeqCtrlRaw(); } @@ -138,3 +146,4 @@ void PusTmCreator::setService(uint8_t service) { pusParams.secHeader.service = s void PusTmCreator::setSubservice(uint8_t subservice) { pusParams.secHeader.subservice = subservice; } +bool PusTmCreator::crcCalculationEnabled() const { return calculateCrcOnSerialization; } diff --git a/src/fsfw/tmtcpacket/pus/tm/PusTmCreator.h b/src/fsfw/tmtcpacket/pus/tm/PusTmCreator.h index 78414c37..0e7988f1 100644 --- a/src/fsfw/tmtcpacket/pus/tm/PusTmCreator.h +++ b/src/fsfw/tmtcpacket/pus/tm/PusTmCreator.h @@ -46,6 +46,15 @@ class PusTmCreator : public SerializeIF, public PusTmIF, public CustomUserDataIF ~PusTmCreator() override = default; void setTimeStamper(TimeStamperIF& timeStamper); + /** + * This function disables the CRC16 calculation on serialization. This is useful to avoid + * duplicate calculation if some lower level component needs to update fields like the sequence + * count, which would require a checksum update. + */ + void disableCrcCalculation(); + void enableCrcCalculation(); + [[nodiscard]] bool crcCalculationEnabled() const; + SpacePacketParams& getSpParams(); void setApid(uint16_t apid); void setDestId(uint16_t destId);