eive-obsw/bsp_q7s/acs/StrConfigPathGetter.h
Robin Mueller 3be9cae8a5
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
variable cfg path
2023-11-16 16:57:36 +01:00

24 lines
640 B
C++

#include <optional>
#include "bsp_q7s/fs/SdCardManager.h"
#include "mission/acs/str/strHelpers.h"
class StrConfigPathGetter : public startracker::SdCardConfigPathGetter {
public:
StrConfigPathGetter(SdCardManager& sdcMan) : sdcMan(sdcMan) {}
std::optional<std::string> getCfgPath() override {
if (!sdcMan.isSdCardUsable(std::nullopt)) {
return std::nullopt;
}
if (sdcMan.getActiveSdCard() == sd::SdCard::SLOT_1) {
return std::string("/mnt/sd1/startracker/flight-config.json");
} else {
return std::string("/mnt/sd0/startracker/flight-config.json");
}
}
private:
SdCardManager& sdcMan;
};