diff --git a/src/fsfw/tmtcpacket/pus/tc/TcPacketSerializer.cpp b/src/fsfw/tmtcpacket/pus/tc/TcPacketSerializer.cpp index 28e8271f..cc280d2b 100644 --- a/src/fsfw/tmtcpacket/pus/tc/TcPacketSerializer.cpp +++ b/src/fsfw/tmtcpacket/pus/tc/TcPacketSerializer.cpp @@ -27,7 +27,7 @@ ReturnValue_t TcPacketSerializer::initialize() { return result; } initializeTcPacket(cfg.apid, cfg.sequenceCount, cfg.ack, cfg.service, cfg.subservice, - cfg.pusVersion, cfg.sourceId); + PusConfig::PUS_VERSION, cfg.sourceId); if (cfg.appData != nullptr and cfg.appDataLen > 0) { std::memcpy(&tcData->appData, cfg.appData, cfg.appDataLen); } diff --git a/src/fsfw/tmtcpacket/pus/tc/TcPacketSerializer.h b/src/fsfw/tmtcpacket/pus/tc/TcPacketSerializer.h index dcc5ef1f..9abb37b1 100644 --- a/src/fsfw/tmtcpacket/pus/tc/TcPacketSerializer.h +++ b/src/fsfw/tmtcpacket/pus/tc/TcPacketSerializer.h @@ -14,13 +14,17 @@ struct PusConfig { uint16_t sourceId = 0; uint8_t* appData = nullptr; size_t appDataLen = 0; - pus::PusVersion pusVersion = pus::PusVersion::PUS_C_VERSION; +#if FSFW_USE_PUS_C_TELECOMMANDS == 1 + static constexpr pus::PusVersion PUS_VERSION = pus::PusVersion::PUS_C_VERSION; +#else + static constexpr pus::PusVersion PUS_VERSION = pus::PusVersion::PUS_A_VERSION; +#endif uint8_t ack = TcPacketPus::ACK_ALL; }; class TcPacketSerializer : public TcPacketPus, public SerializeIF, public HasReturnvaluesIF { public: - TcPacketSerializer(uint8_t* data, size_t size, PusConfig& cfg); + TcPacketSerializer(uint8_t* store, size_t maxSize, PusConfig& cfg); ReturnValue_t initialize();