TM working
fsfw/fsfw/pipeline/head There was a failure building this commit Details

This commit is contained in:
Ulrich Mohr 2023-07-14 16:10:21 +02:00
parent a30146a799
commit 979a7b7d75
3 changed files with 20 additions and 7 deletions

View File

@ -196,6 +196,10 @@ ReturnValue_t DeviceHandlerBase::initialize() {
if (result != returnvalue::OK) {
return result;
}
result = datapoolHelper.initialize();
if (result != returnvalue::OK) {
return result;
}
result = fdirInstance->initialize();
if (result != returnvalue::OK) {
return result;

View File

@ -1,9 +1,10 @@
#include "HousekeepingHelper.h"
#include "GeneratesHousekeepingIF.h"
#include <fsfw/objectmanager/ObjectManager.h>
HousekeepingHelper::HousekeepingHelper(GeneratesHousekeepingIF* owner): owner(owner) {}
#include "GeneratesHousekeepingIF.h"
HousekeepingHelper::HousekeepingHelper(GeneratesHousekeepingIF* owner) : owner(owner) {}
ReturnValue_t HousekeepingHelper::initialize() {
tmManager = ObjectManager::instance()->get<TmManager>(objects::TM_MANAGER);
@ -26,14 +27,20 @@ void HousekeepingHelper::registerSet(HousekeepingSet* set) {
housekeepingSets.emplace(id, set);
}
ReturnValue_t HousekeepingHelper::reportHousekeeping(HousekeepingSet* set, const Action* action) {
SystemObjectIF* ownerAsObject = dynamic_cast<SystemObjectIF*>(owner);
if (ownerAsObject == nullptr) {
sif::error << "Duuuuuuuude, what the hell?" << std::endl;
return returnvalue::FAILED;
}
return tmManager->sendTmPacket(ownerAsObject->getObjectId(), GeneratesHousekeepingIF::INTERFACE_ID,
GeneratesHousekeepingIF::Functions::REPORT, set,
action->tc, action->tcOffset);
store_address_t tc;
size_t tcOffset = 0;
if (action != nullptr) {
tc = action->tc;
tcOffset = action->tcOffset;
}
return tmManager->sendTmPacket(ownerAsObject->getObjectId(),
GeneratesHousekeepingIF::INTERFACE_ID,
GeneratesHousekeepingIF::Functions::REPORT, set, tc, tcOffset);
}

View File

@ -14,6 +14,8 @@ void HousekeepingSet::setEnum(EnumIF* theEnum) {
id = theEnum->getValue();
description = theEnum->getDescription();
}
const char* HousekeepingSet::getDescription() const { return description; }
#else
HousekeepingSet::HousekeepingSet(GeneratesHousekeepingIF* owner, HousekeepingSetId_t id) : id(id) {
if (owner != nullptr) {
@ -26,7 +28,7 @@ HousekeepingSet::HousekeepingSet(GeneratesHousekeepingIF* owner, HousekeepingSet
HousekeepingSet::~HousekeepingSet() {}
void HousekeepingSet::report(const Action* action) {
if (helper == nullptr) {
if (helper != nullptr) {
helper->reportHousekeeping(this, action);
}
}