eive-obsw/mission/devices/ACUHandler.h
Jakob Meier 2dd8fb4f45
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
acu command to print current and voltage of ACU channels
2021-12-17 15:08:33 +01:00

52 lines
1.6 KiB
C++

#ifndef MISSION_DEVICES_ACUHANDLER_H_
#define MISSION_DEVICES_ACUHANDLER_H_
#include "GomspaceDeviceHandler.h"
#include <mission/devices/devicedefinitions/GomspaceDefinitions.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);
virtual ~ACUHandler();
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
protected:
virtual void letChildHandleHkReply(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;
virtual void fillCommandAndReplyMap() override;
virtual ReturnValue_t deviceSpecificCommand(DeviceCommandId_t cmd) override;
private:
static const DeviceCommandId_t PRINT_CHANNEL_STATS = 51;
ACU::HkTableDataset acuHkTableDataset;
/**
* @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);
/**
* @brief Prints channel statistics (current and voltage) to console
*/
void printChannelStats();
};
#endif /* MISSION_DEVICES_ACUHANDLER_H_ */