TM working
This commit is contained in:
parent
a30146a799
commit
979a7b7d75
@ -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;
|
||||
|
@ -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);
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user