eive-obsw/mission/devices/ACUHandler.h

56 lines
1.7 KiB
C
Raw Normal View History

2021-01-28 14:55:21 +01:00
#ifndef MISSION_DEVICES_ACUHANDLER_H_
#define MISSION_DEVICES_ACUHANDLER_H_
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
2022-01-18 11:41:19 +01:00
#include "GomspaceDeviceHandler.h"
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,
FailureIsolationBase* customFdir);
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:
virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t* packet) override;
2021-02-12 14:31:43 +01:00
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-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
};
#endif /* MISSION_DEVICES_ACUHANDLER_H_ */