eive-obsw/dummies/CoreControllerDummy.cpp
Jakob Meier 89757c447c
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
run auto-formatter
2022-06-17 08:31:36 +02:00

56 lines
1.7 KiB
C++

#include "CoreControllerDummy.h"
#include <bsp_q7s/core/CoreDefinitions.h>
#include <objects/systemObjectList.h>
#include <cmath>
#include <cstdlib>
CoreControllerDummy::CoreControllerDummy(object_id_t objectId)
: ExtendedControllerBase(objectId, objects::NO_OBJECT) {}
ReturnValue_t CoreControllerDummy::initialize() {
static bool done = false;
if (not done) {
done = true;
ReturnValue_t result = ExtendedControllerBase::initialize();
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
}
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t CoreControllerDummy::handleCommandMessage(CommandMessage* message) {
return RETURN_FAILED;
}
void CoreControllerDummy::performControlOperation() { return; }
ReturnValue_t CoreControllerDummy::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) {
localDataPoolMap.emplace(core::TEMPERATURE, new PoolEntry<float>({0}));
localDataPoolMap.emplace(core::PS_VOLTAGE, new PoolEntry<float>({0}));
localDataPoolMap.emplace(core::PL_VOLTAGE, new PoolEntry<float>({0}));
return HasReturnvaluesIF::RETURN_OK;
}
LocalPoolDataSetBase* CoreControllerDummy::getDataSetHandle(sid_t sid) {
switch (sid.ownerSetId) {
default:
return nullptr;
}
}
ReturnValue_t CoreControllerDummy::checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t* msToReachTheMode) {
if (submode != SUBMODE_NONE) {
return INVALID_SUBMODE;
}
if ((mode != MODE_OFF) && (mode != MODE_ON) && (mode != MODE_NORMAL)) {
return INVALID_MODE;
}
return RETURN_OK;
}