add required fields
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2023-11-09 11:57:49 +01:00
parent bdf6baa9fc
commit 42cc9c0fa8
Signed by: muellerr
GPG Key ID: A649FB78196E3849
2 changed files with 30 additions and 3 deletions

View File

@ -7,7 +7,16 @@ using namespace returnvalue;
std::atomic_bool supv::SUPV_ON = false; std::atomic_bool supv::SUPV_ON = false;
FreshSupvHandler::FreshSupvHandler(DhbConfig cfg) : FreshDeviceHandlerBase(cfg), hkSet(this) {} FreshSupvHandler::FreshSupvHandler(DhbConfig cfg, CookieIF *comCookie, Gpio uartIsolatorSwitch,
PowerSwitchIF &switchIF, power::Switch_t powerSwitch,
PlocSupvUartManager &supvHelper)
: FreshDeviceHandlerBase(cfg),
hkSet(this),
bootStatusReport(this),
latchupStatusReport(this),
countersReport(this),
adcReport(this),
uartManager(supvHelper) {}
void FreshSupvHandler::performDeviceOperation(uint8_t opCode) { void FreshSupvHandler::performDeviceOperation(uint8_t opCode) {
if (!transitionActive and mode == MODE_OFF) { if (!transitionActive and mode == MODE_OFF) {
@ -17,7 +26,9 @@ void FreshSupvHandler::performDeviceOperation(uint8_t opCode) {
if (opCode == OpCode::DEFAULT_OPERATION) { if (opCode == OpCode::DEFAULT_OPERATION) {
if (transitionActive) { if (transitionActive) {
// TODO: Perform transition handling: OFF to ON and ON to OFF. // TODO: Perform transition handling: OFF to ON and ON to OFF.
// For OFF to ON, command power switch first, then to isolato switch handling, and lastly
// ensure succesfull communication
// For ON to OFF ????
} else { } else {
if (mode == MODE_NORMAL) { if (mode == MODE_NORMAL) {
// Normal mode handling. Request normal datasets and add them to command map. // Normal mode handling. Request normal datasets and add them to command map.
@ -117,6 +128,11 @@ ReturnValue_t FreshSupvHandler::initializeLocalDataPool(localpool::DataPool &loc
return returnvalue::OK; return returnvalue::OK;
} }
ReturnValue_t FreshSupvHandler::setHealth(HealthState health) {
// TODO: Go to off is the device is commanded faulty.
return returnvalue::OK;
}
ReturnValue_t FreshSupvHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, ReturnValue_t FreshSupvHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t *data, size_t size) { const uint8_t *data, size_t size) {
// TODO: Handle all commands here. Need to add them to some command map. Send command immediately // TODO: Handle all commands here. Need to add them to some command map. Send command immediately

View File

@ -1,14 +1,21 @@
#ifndef LINUX_PAYLOAD_FRESHSUPVHANDLER_H_ #ifndef LINUX_PAYLOAD_FRESHSUPVHANDLER_H_
#define LINUX_PAYLOAD_FRESHSUPVHANDLER_H_ #define LINUX_PAYLOAD_FRESHSUPVHANDLER_H_
#include <fsfw/power/PowerSwitchIF.h>
#include "PlocSupvUartMan.h"
#include "fsfw/devicehandlers/FreshDeviceHandlerBase.h" #include "fsfw/devicehandlers/FreshDeviceHandlerBase.h"
#include "fsfw/power/definitions.h"
#include "fsfw_hal/linux/gpio/Gpio.h"
#include "plocSupvDefs.h" #include "plocSupvDefs.h"
class FreshSupvHandler : public FreshDeviceHandlerBase { class FreshSupvHandler : public FreshDeviceHandlerBase {
public: public:
enum OpCode { DEFAULT_OPERATION = 0, HANDLE_ACTIVE_CMDS = 1 }; enum OpCode { DEFAULT_OPERATION = 0, HANDLE_ACTIVE_CMDS = 1 };
FreshSupvHandler(DhbConfig cfg); FreshSupvHandler(DhbConfig cfg, CookieIF* comCookie, Gpio uartIsolatorSwitch,
PowerSwitchIF& switchIF, power::Switch_t powerSwitch,
PlocSupvUartManager& supvHelper);
/** /**
* Periodic helper executed function, implemented by child class. * Periodic helper executed function, implemented by child class.
*/ */
@ -23,6 +30,8 @@ class FreshSupvHandler : public FreshDeviceHandlerBase {
ReturnValue_t handleCommandMessage(CommandMessage* message) override; ReturnValue_t handleCommandMessage(CommandMessage* message) override;
private: private:
ReturnValue_t setHealth(HealthState health) override;
// HK manager abstract functions. // HK manager abstract functions.
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
@ -36,6 +45,8 @@ class FreshSupvHandler : public FreshDeviceHandlerBase {
const uint8_t* data, size_t size) override; const uint8_t* data, size_t size) override;
private: private:
PlocSupvUartManager uartManager;
supv::HkSet hkSet; supv::HkSet hkSet;
supv::BootStatusReport bootStatusReport; supv::BootStatusReport bootStatusReport;
supv::LatchupStatusReport latchupStatusReport; supv::LatchupStatusReport latchupStatusReport;