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:
|
|
|
|
ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
|
|
|
|
virtual ~ACUHandler();
|
2021-01-28 14:55:21 +01:00
|
|
|
|
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;
|
2021-12-17 15:08:33 +01:00
|
|
|
|
2022-01-18 11:41:19 +01:00
|
|
|
virtual void fillCommandAndReplyMap() override;
|
2021-12-17 10:45:55 +01:00
|
|
|
|
2022-01-18 11:41:19 +01:00
|
|
|
virtual ReturnValue_t deviceSpecificCommand(DeviceCommandId_t cmd) override;
|
2021-01-28 14:55:21 +01:00
|
|
|
|
2022-01-18 11:41:19 +01:00
|
|
|
private:
|
|
|
|
static const DeviceCommandId_t PRINT_CHANNEL_STATS = 51;
|
2021-12-17 10:45:55 +01:00
|
|
|
|
2022-01-18 11:41:19 +01:00
|
|
|
ACU::HkTableDataset acuHkTableDataset;
|
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.
|
|
|
|
*/
|
|
|
|
void 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_ */
|