TM working
This commit is contained in:
parent
a30146a799
commit
979a7b7d75
@ -196,6 +196,10 @@ ReturnValue_t DeviceHandlerBase::initialize() {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
result = datapoolHelper.initialize();
|
||||||
|
if (result != returnvalue::OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
result = fdirInstance->initialize();
|
result = fdirInstance->initialize();
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
#include "HousekeepingHelper.h"
|
#include "HousekeepingHelper.h"
|
||||||
#include "GeneratesHousekeepingIF.h"
|
|
||||||
|
|
||||||
#include <fsfw/objectmanager/ObjectManager.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() {
|
ReturnValue_t HousekeepingHelper::initialize() {
|
||||||
tmManager = ObjectManager::instance()->get<TmManager>(objects::TM_MANAGER);
|
tmManager = ObjectManager::instance()->get<TmManager>(objects::TM_MANAGER);
|
||||||
@ -26,14 +27,20 @@ void HousekeepingHelper::registerSet(HousekeepingSet* set) {
|
|||||||
housekeepingSets.emplace(id, set);
|
housekeepingSets.emplace(id, set);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ReturnValue_t HousekeepingHelper::reportHousekeeping(HousekeepingSet* set, const Action* action) {
|
ReturnValue_t HousekeepingHelper::reportHousekeeping(HousekeepingSet* set, const Action* action) {
|
||||||
SystemObjectIF* ownerAsObject = dynamic_cast<SystemObjectIF*>(owner);
|
SystemObjectIF* ownerAsObject = dynamic_cast<SystemObjectIF*>(owner);
|
||||||
if (ownerAsObject == nullptr) {
|
if (ownerAsObject == nullptr) {
|
||||||
sif::error << "Duuuuuuuude, what the hell?" << std::endl;
|
sif::error << "Duuuuuuuude, what the hell?" << std::endl;
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
return tmManager->sendTmPacket(ownerAsObject->getObjectId(), GeneratesHousekeepingIF::INTERFACE_ID,
|
store_address_t tc;
|
||||||
GeneratesHousekeepingIF::Functions::REPORT, set,
|
size_t tcOffset = 0;
|
||||||
action->tc, action->tcOffset);
|
if (action != nullptr) {
|
||||||
|
tc = action->tc;
|
||||||
|
tcOffset = action->tcOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmManager->sendTmPacket(ownerAsObject->getObjectId(),
|
||||||
|
GeneratesHousekeepingIF::INTERFACE_ID,
|
||||||
|
GeneratesHousekeepingIF::Functions::REPORT, set, tc, tcOffset);
|
||||||
}
|
}
|
@ -14,6 +14,8 @@ void HousekeepingSet::setEnum(EnumIF* theEnum) {
|
|||||||
id = theEnum->getValue();
|
id = theEnum->getValue();
|
||||||
description = theEnum->getDescription();
|
description = theEnum->getDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* HousekeepingSet::getDescription() const { return description; }
|
||||||
#else
|
#else
|
||||||
HousekeepingSet::HousekeepingSet(GeneratesHousekeepingIF* owner, HousekeepingSetId_t id) : id(id) {
|
HousekeepingSet::HousekeepingSet(GeneratesHousekeepingIF* owner, HousekeepingSetId_t id) : id(id) {
|
||||||
if (owner != nullptr) {
|
if (owner != nullptr) {
|
||||||
@ -26,7 +28,7 @@ HousekeepingSet::HousekeepingSet(GeneratesHousekeepingIF* owner, HousekeepingSet
|
|||||||
HousekeepingSet::~HousekeepingSet() {}
|
HousekeepingSet::~HousekeepingSet() {}
|
||||||
|
|
||||||
void HousekeepingSet::report(const Action* action) {
|
void HousekeepingSet::report(const Action* action) {
|
||||||
if (helper == nullptr) {
|
if (helper != nullptr) {
|
||||||
helper->reportHousekeeping(this, action);
|
helper->reportHousekeeping(this, action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user