2022-02-25 11:58:02 +01:00
|
|
|
#include "TcsSubsystem.h"
|
2022-03-22 11:57:48 +01:00
|
|
|
|
2022-03-22 15:49:22 +01:00
|
|
|
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
2022-03-22 11:57:48 +01:00
|
|
|
|
2022-03-22 15:49:22 +01:00
|
|
|
TcsSubsystem::TcsSubsystem(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
|
|
|
|
power::Switch_t theSwitch, TcsBoardHelper helper)
|
|
|
|
: SubsystemBase(objectId, parentId, MODE_OFF, 24),
|
|
|
|
switcher(pwrSwitcher, theSwitch),
|
|
|
|
helper(helper) {}
|
2022-03-22 11:57:48 +01:00
|
|
|
|
2022-03-22 15:49:22 +01:00
|
|
|
ReturnValue_t TcsSubsystem::handleCommandMessage(CommandMessage* message) { return RETURN_OK; }
|
|
|
|
|
|
|
|
void TcsSubsystem::performChildOperation() {}
|
2022-03-22 11:57:48 +01:00
|
|
|
|
|
|
|
ReturnValue_t TcsSubsystem::checkModeCommand(Mode_t mode, Submode_t submode,
|
2022-03-22 15:49:22 +01:00
|
|
|
uint32_t* msToReachTheMode) {
|
|
|
|
if (mode == MODE_ON or mode == MODE_OFF or mode == DeviceHandlerIF::MODE_NORMAL) {
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
return HasModesIF::INVALID_MODE;
|
2022-03-22 11:57:48 +01:00
|
|
|
}
|
|
|
|
|
2022-03-22 14:30:42 +01:00
|
|
|
ReturnValue_t TcsSubsystem::initialize() {
|
2022-03-22 15:49:22 +01:00
|
|
|
ReturnValue_t result = RETURN_OK;
|
|
|
|
for (const auto& obj : helper.rtdIds) {
|
|
|
|
result = registerChild(obj);
|
|
|
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return SubsystemBase::initialize();
|
2022-03-22 14:30:42 +01:00
|
|
|
}
|
|
|
|
|
2022-03-22 15:49:22 +01:00
|
|
|
void TcsSubsystem::startTransition(Mode_t mode, Submode_t submode) {}
|