eive-obsw/mission/tcs/Max31865EiveHandler.h
Robin Mueller 63b50e6101
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-develop Build started...
clean up op done
2023-03-26 16:42:00 +02:00

47 lines
2.1 KiB
C++

#ifndef MISSION_TCS_MAX31865EIVEHANDLER_H_
#define MISSION_TCS_MAX31865EIVEHANDLER_H_
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include <fsfw/globalfunctions/PeriodicOperationDivider.h>
#include <mission/tcs/Max31865Definitions.h>
class Max31865EiveHandler : public DeviceHandlerBase {
public:
Max31865EiveHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
void setInstantNormal(bool instantNormal);
void setDebugMode(bool enable, uint32_t divider);
void setDeviceInfo(uint8_t idx, std::string location);
private:
void doStartUp() override;
void doShutDown() override;
void doTransition(Mode_t modeFrom, Submode_t subModeFrom) override;
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override;
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t* id) override;
void fillCommandAndReplyMap() override;
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData,
size_t commandDataLen) override;
ReturnValue_t scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId,
size_t* foundLen) override;
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) override;
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
ReturnValue_t initialize() override;
void simpleCommand(EiveMax31855::RtdCommands cmd);
std::array<uint8_t, 12> cmdBuf = {};
uint8_t idx = 0;
std::string locString = "Unknown";
EiveMax31855::ReadOutStruct exchangeStruct;
bool debugMode = false;
size_t structLen = 0;
bool instantNormal = false;
MAX31865::PrimarySet sensorDataset;
PeriodicOperationDivider debugDivider;
enum class InternalState { NONE, ON, ACTIVE, INACTIVE } state = InternalState::NONE;
bool transitionOk = false;
};
#endif /* MISSION_TCS_MAX31865EIVEHANDLER_H_ */