applied formatting
Some checks failed
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
2022-01-17 15:58:27 +01:00
parent 975b3cd294
commit 77c45c0de9
206 changed files with 28883 additions and 30263 deletions

View File

@ -1,29 +1,29 @@
#include <test/testtasks/PusTcInjector.h>
#include <fsfw/globalfunctions/arrayprinter.h>
#include <fsfw/ipc/QueueFactory.h>
#include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/tmtcpacket/pus/TcPacketBase.h>
#include <fsfw/tmtcpacket/pus/TcPacketStored.h>
#include <fsfw/tmtcservices/AcceptsTelecommandsIF.h>
#include <fsfw/tmtcservices/TmTcMessage.h>
#include <fsfw/tmtcpacket/pus/TcPacketBase.h>
#include <fsfw/ipc/QueueFactory.h>
#include <fsfw/globalfunctions/arrayprinter.h>
#include <fsfw/tmtcpacket/pus/TcPacketStored.h>
#include <test/testtasks/PusTcInjector.h>
PusTcInjector::PusTcInjector(object_id_t objectId, object_id_t destination,
object_id_t tcStore, uint16_t defaultApid): SystemObject(objectId),
defaultApid(defaultApid), destination(destination), tcStoreId(tcStore) {
}
PusTcInjector::PusTcInjector(object_id_t objectId, object_id_t destination, object_id_t tcStore,
uint16_t defaultApid)
: SystemObject(objectId),
defaultApid(defaultApid),
destination(destination),
tcStoreId(tcStore) {}
PusTcInjector::~PusTcInjector() {
}
PusTcInjector::~PusTcInjector() {}
//ReturnValue_t PusTcInjector::injectPusTelecommand(uint8_t service,
// ReturnValue_t PusTcInjector::injectPusTelecommand(uint8_t service,
// uint8_t subservice,const uint8_t* appData, size_t appDataLen) {
// return injectPusTelecommand(service, subservice, defaultApid, appData,
// appDataLen);
//}
// }
// TODO: ACK flags
//ReturnValue_t PusTcInjector::injectPusTelecommand(uint8_t service,
// ReturnValue_t PusTcInjector::injectPusTelecommand(uint8_t service,
// uint8_t subservice,uint16_t apid, const uint8_t* appData,
// size_t appDataLen) {
// // Prepare TC packet. Store into TC store immediately.
@ -44,24 +44,22 @@ PusTcInjector::~PusTcInjector() {
//}
ReturnValue_t PusTcInjector::initialize() {
// Prepare message queue which is used to send telecommands.
injectionQueue = QueueFactory::instance()->
createMessageQueue(INJECTION_QUEUE_DEPTH);
AcceptsTelecommandsIF* targetQueue = ObjectManager::instance()->
get<AcceptsTelecommandsIF>(destination);
if(targetQueue == nullptr) {
sif::error << "PusTcInjector: CCSDS distributor not initialized yet!" << std::endl;
return ObjectManagerIF::CHILD_INIT_FAILED;
}
else {
injectionQueue->setDefaultDestination(targetQueue->getRequestQueue());
}
// Prepare message queue which is used to send telecommands.
injectionQueue = QueueFactory::instance()->createMessageQueue(INJECTION_QUEUE_DEPTH);
AcceptsTelecommandsIF* targetQueue =
ObjectManager::instance()->get<AcceptsTelecommandsIF>(destination);
if (targetQueue == nullptr) {
sif::error << "PusTcInjector: CCSDS distributor not initialized yet!" << std::endl;
return ObjectManagerIF::CHILD_INIT_FAILED;
} else {
injectionQueue->setDefaultDestination(targetQueue->getRequestQueue());
}
// Prepare store used to store TC messages
tcStore = ObjectManager::instance()->get<StorageManagerIF>(tcStoreId);
if(tcStore == nullptr) {
sif::error << "PusTcInjector: TC Store not initialized!" << std::endl;
return ObjectManagerIF::CHILD_INIT_FAILED;
}
return HasReturnvaluesIF::RETURN_OK;
// Prepare store used to store TC messages
tcStore = ObjectManager::instance()->get<StorageManagerIF>(tcStoreId);
if (tcStore == nullptr) {
sif::error << "PusTcInjector: TC Store not initialized!" << std::endl;
return ObjectManagerIF::CHILD_INIT_FAILED;
}
return HasReturnvaluesIF::RETURN_OK;
}