eive-obsw/mission/power/AcuHandler.h
Robin Mueller 58c343b8de
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Merge remote-tracking branch 'origin/develop' into feature_set_up_periodic_hk
2023-03-26 16:45:28 +02:00

57 lines
1.8 KiB
C++

#ifndef MISSION_POWER_ACUHANDLER_H_
#define MISSION_POWER_ACUHANDLER_H_
#include <mission/power/GomspaceDeviceHandler.h>
#include <mission/power/gsDefs.h>
#include "fsfw/datapool/PoolReadGuard.h"
/**
* @brief Handler for the ACU from Gomspace. Monitors and controls the battery charging via
* the solar panels.
*/
class ACUHandler : public GomspaceDeviceHandler {
public:
ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
FailureIsolationBase* customFdir, bool enableHkSets);
virtual ~ACUHandler();
void setDebugMode(bool enable);
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
protected:
void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t* packet) override;
void letChildHandleConfigReply(DeviceCommandId_t id, const uint8_t* packet) override;
/**
* @brief As soon as the device is in MODE_NORMAL, this function is executed periodically.
*/
virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override;
ReturnValue_t printStatus(DeviceCommandId_t cmd) override;
virtual void fillCommandAndReplyMap() override;
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
private:
ACU::CoreHk coreHk;
ACU::AuxHk auxHk;
TableConfig cfg;
bool debugMode = false;
/**
* @brief Function extracts the hk table information from the received csp packet and stores
* the values in the acuHkTableDataset.
*/
ReturnValue_t parseHkTableReply(const uint8_t* packet);
/**
* @brief Prints channel statistics (current and voltage) to console
*/
void printChannelStats();
};
#endif /* MISSION_POWER_ACUHANDLER_H_ */