CFDP FSFW Integration #111
@ -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) {
|
||||||
|
@ -78,6 +78,7 @@ class CcsdsDistributor : public TcDistributorBase,
|
|||||||
*/
|
*/
|
||||||
StorageManagerIF* tcStore = nullptr;
|
StorageManagerIF* tcStore = nullptr;
|
||||||
|
|
||||||
|
bool ownedPacketChecker = false;
|
||||||
CcsdsPacketCheckIF* packetChecker = nullptr;
|
CcsdsPacketCheckIF* packetChecker = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user