CFDP FSFW Integration #111

Merged
muellerr merged 170 commits from cfdp-integration into develop 2022-09-16 11:11:22 +02:00
2 changed files with 10 additions and 4 deletions
Showing only changes of commit df690b9628 - Show all commits

View File

@ -16,7 +16,11 @@ CcsdsDistributor::CcsdsDistributor(uint16_t setDefaultApid, object_id_t setObjec
tcStore(tcStore), tcStore(tcStore),
packetChecker(packetChecker) {} packetChecker(packetChecker) {}
CcsdsDistributor::~CcsdsDistributor() = default; CcsdsDistributor::~CcsdsDistributor() {
if (ownedPacketChecker) {
delete packetChecker;
}
}
ReturnValue_t CcsdsDistributor::selectDestination(MessageQueueId_t& destId) { ReturnValue_t CcsdsDistributor::selectDestination(MessageQueueId_t& destId) {
#if CCSDS_DISTRIBUTOR_DEBUGGING == 1 #if CCSDS_DISTRIBUTOR_DEBUGGING == 1
@ -123,13 +127,14 @@ ReturnValue_t CcsdsDistributor::registerApplication(DestInfo info) {
uint32_t CcsdsDistributor::getIdentifier() const { return 0; } uint32_t CcsdsDistributor::getIdentifier() const { return 0; }
ReturnValue_t CcsdsDistributor::initialize() { ReturnValue_t CcsdsDistributor::initialize() {
if (packetChecker == nullptr) {
packetChecker = new CcsdsPacketChecker(ccsds::PacketType::TC);
}
ReturnValue_t result = TcDistributorBase::initialize(); ReturnValue_t result = TcDistributorBase::initialize();
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
return result; return result;
} }
if (packetChecker == nullptr) {
ownedPacketChecker = true;
packetChecker = new CcsdsPacketChecker(ccsds::PacketType::TC);
}
if (tcStore == nullptr) { if (tcStore == nullptr) {
tcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::TC_STORE); tcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::TC_STORE);
if (tcStore == nullptr) { if (tcStore == nullptr) {

View File

@ -78,6 +78,7 @@ class CcsdsDistributor : public TcDistributorBase,
*/ */
StorageManagerIF* tcStore = nullptr; StorageManagerIF* tcStore = nullptr;
bool ownedPacketChecker = false;
CcsdsPacketCheckIF* packetChecker = nullptr; CcsdsPacketCheckIF* packetChecker = nullptr;
}; };