connect mode tree parent: make health helper optional
This commit is contained in:
parent
049e3b431d
commit
da12495335
@ -109,5 +109,5 @@ const HasModesIF& ControllerBase::getModeIF() const { return *this; }
|
||||
ModeTreeChildIF& ControllerBase::getModeTreeChildIF() { return *this; }
|
||||
|
||||
ReturnValue_t ControllerBase::connectModeTreeParent(HasModeTreeChildrenIF& parent) {
|
||||
return modetree::connectModeTreeParent(parent, *this, healthHelper, modeHelper);
|
||||
return modetree::connectModeTreeParent(parent, *this, &healthHelper, modeHelper);
|
||||
}
|
||||
|
@ -1608,7 +1608,7 @@ void DeviceHandlerBase::disableCommandsAndReplies() {
|
||||
}
|
||||
|
||||
ReturnValue_t DeviceHandlerBase::connectModeTreeParent(HasModeTreeChildrenIF& parent) {
|
||||
return modetree::connectModeTreeParent(parent, *this, healthHelper, modeHelper);
|
||||
return modetree::connectModeTreeParent(parent, *this, &healthHelper, modeHelper);
|
||||
}
|
||||
|
||||
const HasHealthIF* DeviceHandlerBase::getOptHealthIF() const { return this; }
|
||||
|
@ -2,12 +2,12 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "fsfw/globalfunctions/CRC.h"
|
||||
#include "fsfw/objectmanager/ObjectManager.h"
|
||||
#include "fsfw/serialize/SerializeAdapter.h"
|
||||
#include "fsfw/serviceinterface.h"
|
||||
#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
|
||||
#include "fsfw/tmtcpacket/pus/tc/PusTcIF.h"
|
||||
#include "fsfw/globalfunctions/CRC.h"
|
||||
#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
|
||||
|
||||
static constexpr auto DEF_END = SerializeIF::Endianness::BIG;
|
||||
|
||||
@ -180,7 +180,7 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::doInsertActivi
|
||||
if (CRC::crc16ccitt(data, size) != 0) {
|
||||
return CONTAINED_TC_CRC_MISSMATCH;
|
||||
}
|
||||
|
||||
|
||||
// store currentPacket and receive the store address
|
||||
store_address_t addr{};
|
||||
if (tcStore->addData(&addr, data, size) != returnvalue::OK ||
|
||||
|
@ -284,7 +284,7 @@ ReturnValue_t SubsystemBase::setHealth(HealthState health) {
|
||||
HasHealthIF::HealthState SubsystemBase::getHealth() { return healthHelper.getHealth(); }
|
||||
|
||||
ReturnValue_t SubsystemBase::connectModeTreeParent(HasModeTreeChildrenIF& parent) {
|
||||
return modetree::connectModeTreeParent(parent, *this, healthHelper, modeHelper);
|
||||
return modetree::connectModeTreeParent(parent, *this, &healthHelper, modeHelper);
|
||||
}
|
||||
|
||||
object_id_t SubsystemBase::getObjectId() const { return SystemObject::getObjectId(); }
|
||||
|
@ -2,12 +2,14 @@
|
||||
|
||||
ReturnValue_t modetree::connectModeTreeParent(HasModeTreeChildrenIF& parent,
|
||||
const ModeTreeChildIF& child,
|
||||
HealthHelper& healthHelper, ModeHelper& modeHelper) {
|
||||
HealthHelper* healthHelper, ModeHelper& modeHelper) {
|
||||
ReturnValue_t result = parent.registerChild(child);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
healthHelper.setParentQueue(parent.getCommandQueue());
|
||||
if (healthHelper != nullptr) {
|
||||
healthHelper->setParentQueue(parent.getCommandQueue());
|
||||
}
|
||||
modeHelper.setParentQueue(parent.getCommandQueue());
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
namespace modetree {
|
||||
|
||||
ReturnValue_t connectModeTreeParent(HasModeTreeChildrenIF& parent, const ModeTreeChildIF& child,
|
||||
HealthHelper& healthHelper, ModeHelper& modeHelper);
|
||||
HealthHelper* healthHelper, ModeHelper& modeHelper);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user