eive-obsw/mission/power/AcuHandler.h

57 lines
1.8 KiB
C
Raw Normal View History

2023-03-26 16:13:54 +02:00
#ifndef MISSION_POWER_ACUHANDLER_H_
#define MISSION_POWER_ACUHANDLER_H_
2021-01-28 14:55:21 +01:00
2023-03-26 16:13:54 +02:00
#include <mission/power/GomspaceDeviceHandler.h>
#include <mission/power/gsDefs.h>
2022-01-18 11:41:19 +01:00
2021-12-17 10:45:55 +01:00
#include "fsfw/datapool/PoolReadGuard.h"
2021-01-28 14:55:21 +01:00
/**
2021-02-03 08:09:54 +01:00
* @brief Handler for the ACU from Gomspace. Monitors and controls the battery charging via
* the solar panels.
2021-01-28 14:55:21 +01:00
*/
2022-01-18 11:41:19 +01:00
class ACUHandler : public GomspaceDeviceHandler {
public:
2022-04-28 15:58:31 +02:00
ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
2023-03-26 15:28:00 +02:00
FailureIsolationBase* customFdir, bool enableHkSets);
2022-01-18 11:41:19 +01:00
virtual ~ACUHandler();
2021-01-28 14:55:21 +01:00
2022-04-26 10:37:25 +02:00
void setDebugMode(bool enable);
2022-01-18 11:41:19 +01:00
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
2021-01-28 14:55:21 +01:00
2022-01-18 11:41:19 +01:00
protected:
2022-08-27 01:02:08 +02:00
void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t* packet) override;
void letChildHandleConfigReply(DeviceCommandId_t id, const uint8_t* packet) override;
2022-01-18 11:41:19 +01:00
/**
* @brief As soon as the device is in MODE_NORMAL, this function is executed periodically.
*/
virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override;
2022-05-23 11:25:58 +02:00
ReturnValue_t printStatus(DeviceCommandId_t cmd) override;
2021-12-17 10:45:55 +01:00
2022-05-23 11:25:58 +02:00
virtual void fillCommandAndReplyMap() override;
2021-01-28 14:55:21 +01:00
2022-04-07 12:22:08 +02:00
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
2022-01-18 11:41:19 +01:00
private:
2022-05-23 10:42:57 +02:00
ACU::CoreHk coreHk;
ACU::AuxHk auxHk;
2022-08-26 14:28:06 +02:00
TableConfig cfg;
2022-04-26 10:37:25 +02:00
bool debugMode = false;
2021-02-12 14:31:43 +01:00
2022-01-18 11:41:19 +01:00
/**
* @brief Function extracts the hk table information from the received csp packet and stores
* the values in the acuHkTableDataset.
*/
2022-05-23 10:42:57 +02:00
ReturnValue_t parseHkTableReply(const uint8_t* packet);
2021-12-17 10:45:55 +01:00
2022-01-18 11:41:19 +01:00
/**
* @brief Prints channel statistics (current and voltage) to console
*/
void printChannelStats();
2021-01-28 14:55:21 +01:00
};
2023-03-26 16:13:54 +02:00
#endif /* MISSION_POWER_ACUHANDLER_H_ */