Merge branch 'irini' into scex-additions
This commit is contained in:
commit
d3c7bae087
@ -382,10 +382,8 @@ add_subdirectory(${TEST_PATH})
|
||||
add_subdirectory(${UNITTEST_PATH})
|
||||
|
||||
# This should have already been downloaded by the FSFW Still include it to be
|
||||
# safe
|
||||
# find_package(etl ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)
|
||||
# Not installed, so use FetchContent to download and provide etl
|
||||
# if(NOT etl_FOUND)
|
||||
# safe find_package(etl ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET) Not
|
||||
# installed, so use FetchContent to download and provide etl if(NOT etl_FOUND)
|
||||
message(
|
||||
STATUS
|
||||
"No ETL installation was found with find_package. Installing and providing "
|
||||
|
@ -1,5 +1,5 @@
|
||||
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp gpioInit.cpp
|
||||
ObjectFactory.cpp)
|
||||
ObjectFactory.cpp RPiSdCardManager.cpp)
|
||||
|
||||
add_subdirectory(boardconfig)
|
||||
add_subdirectory(boardtest)
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
#include <linux/InitMission.h>
|
||||
#include <mission/utility/InitMission.h>
|
||||
|
||||
#include <iostream>
|
||||
@ -78,34 +79,10 @@ void initmission::initTasks() {
|
||||
sif::error << "Add component TMTC Polling failed" << std::endl;
|
||||
}
|
||||
|
||||
#if OBSW_ADD_SCEX == 1
|
||||
PeriodicTaskIF* scexDevHandler = factory->createPeriodicTask(
|
||||
"SCEX_DEV", 35, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc);
|
||||
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("SCEX_DEV", objects::SCEX);
|
||||
}
|
||||
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_WRITE);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("SCEX_DEV", objects::SCEX);
|
||||
}
|
||||
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_WRITE);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("SCEX_DEV", objects::SCEX);
|
||||
}
|
||||
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_READ);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("SCEX_DEV", objects::SCEX);
|
||||
}
|
||||
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_READ);
|
||||
|
||||
result = HasReturnvaluesIF::RETURN_OK;
|
||||
PeriodicTaskIF* scexReaderTask = factory->createPeriodicTask(
|
||||
"SCEX_UART_READER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||
result = scexReaderTask->addComponent(objects::SCEX_UART_READER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("SCEX_UART_READER", objects::SCEX_UART_READER);
|
||||
}
|
||||
#if OBSW_ADD_SCEX_DEVICE == 1
|
||||
PeriodicTaskIF* scexDevHandler;
|
||||
PeriodicTaskIF* scexReaderTask;
|
||||
scheduling::schedulingScex(*factory, scexDevHandler, scexReaderTask);
|
||||
#endif
|
||||
|
||||
/* PUS Services */
|
||||
@ -140,7 +117,7 @@ void initmission::initTasks() {
|
||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||
taskStarter(pstTasks, "PST Tasks");
|
||||
|
||||
#if OBSW_ADD_SCEX == 1
|
||||
#if OBSW_ADD_SCEX_DEVICE == 1
|
||||
scexDevHandler->startTask();
|
||||
scexReaderTask->startTask();
|
||||
#endif
|
||||
@ -229,9 +206,9 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask(
|
||||
"SPI_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc);
|
||||
result = pst::pstSpi(spiPst);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
if (result != FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;
|
||||
sif::error << "InitMission::createPstTasks: Creating PST failed!" << std::endl;
|
||||
}
|
||||
} else {
|
||||
taskVec.push_back(spiPst);
|
||||
@ -269,7 +246,7 @@ void initmission::createTestTasks(TaskFactory& factory,
|
||||
PeriodicTaskIF* scexReaderTask = factory.createPeriodicTask(
|
||||
"SCEX_UART_READER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||
result = scexReaderTask->addComponent(objects::SCEX_UART_READER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
initmission::printAddObjectError("SCEX_UART_READER", objects::SCEX_UART_READER);
|
||||
}
|
||||
taskVec.push_back(scexReaderTask);
|
||||
|
@ -28,7 +28,7 @@
|
||||
#define OBSW_ADD_RTD_DEVICES 0
|
||||
#define OBSW_ADD_PL_PCDU 0
|
||||
#define OBSW_ADD_TMP_DEVICES 0
|
||||
#define OBSW_ADD_SCEX 1
|
||||
#define OBSW_ADD_SCEX_DEVICE 1
|
||||
#define OBSW_ADD_RAD_SENSORS 0
|
||||
#define OBSW_ADD_SYRLINKS 0
|
||||
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "ObjectFactory.h"
|
||||
|
||||
#include <bsp_linux_board/RPiSdCardManager.h>
|
||||
#include <linux/devices/ScexUartReader.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
@ -47,8 +48,8 @@
|
||||
#include "fsfw_hal/linux/spi/SpiCookie.h"
|
||||
|
||||
void Factory::setStaticFrameworkObjectIds() {
|
||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
PusServiceBase::packetDestination = objects::TM_FUNNEL;
|
||||
PusServiceBase::PUS_DISTRIBUTOR = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
PusServiceBase::PACKET_DESTINATION = objects::TM_FUNNEL;
|
||||
|
||||
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
||||
@ -56,9 +57,6 @@ void Factory::setStaticFrameworkObjectIds() {
|
||||
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
|
||||
// No storage object for now.
|
||||
TmFunnel::storageDestination = objects::NO_OBJECT;
|
||||
|
||||
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
||||
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
|
||||
}
|
||||
|
||||
void ObjectFactory::produce(void* args) {
|
||||
@ -84,8 +82,9 @@ void ObjectFactory::produce(void* args) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_SCEX == 1
|
||||
createScexComponents(uart::DEV, pwrSwitcher);
|
||||
#if OBSW_ADD_SCEX_DEVICE == 1
|
||||
auto* sdcMan = new RPiSdCardManager("/tmp");
|
||||
createScexComponents(uart::DEV, pwrSwitcher, *sdcMan, true, std::nullopt);
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_SUN_SENSORS == 1
|
||||
@ -202,8 +201,7 @@ void ObjectFactory::createTestTasks() {
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_UART_TEST_CODE == 1
|
||||
auto scexReader = new ScexUartReader(objects::SCEX_UART_READER);
|
||||
new UartTestClass(objects::UART_TEST, scexReader);
|
||||
new UartTestClass(objects::UART_TEST);
|
||||
#else
|
||||
new UartComIF(objects::UART_COM_IF);
|
||||
#endif
|
||||
|
13
bsp_linux_board/RPiSdCardManager.cpp
Normal file
13
bsp_linux_board/RPiSdCardManager.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include "RPiSdCardManager.h"
|
||||
|
||||
RPiSdCardManager::RPiSdCardManager(std::string prefix) : prefix(std::move(prefix)) {}
|
||||
|
||||
const std::string& RPiSdCardManager::getCurrentMountPrefix() const { return prefix; }
|
||||
|
||||
bool RPiSdCardManager::isSdCardMounted(sd::SdCard sdCard) { return true; }
|
||||
|
||||
std::optional<sd::SdCard> RPiSdCardManager::getPreferredSdCard() const { return std::nullopt; }
|
||||
|
||||
void RPiSdCardManager::setActiveSdCard(sd::SdCard sdCard) {}
|
||||
|
||||
std::optional<sd::SdCard> RPiSdCardManager::getActiveSdCard() const { return std::nullopt; }
|
18
bsp_linux_board/RPiSdCardManager.h
Normal file
18
bsp_linux_board/RPiSdCardManager.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef BSP_LINUX_BOARD_RPISDCARDMANAGER_H_
|
||||
#define BSP_LINUX_BOARD_RPISDCARDMANAGER_H_
|
||||
#include <mission/memory/SdCardMountedIF.h>
|
||||
|
||||
class RPiSdCardManager : public SdCardMountedIF {
|
||||
public:
|
||||
RPiSdCardManager(std::string prefix);
|
||||
const std::string& getCurrentMountPrefix() const override;
|
||||
bool isSdCardMounted(sd::SdCard sdCard) override;
|
||||
std::optional<sd::SdCard> getPreferredSdCard() const override;
|
||||
void setActiveSdCard(sd::SdCard sdCard) override;
|
||||
std::optional<sd::SdCard> getActiveSdCard() const override;
|
||||
|
||||
private:
|
||||
std::string prefix;
|
||||
};
|
||||
|
||||
#endif /* BSP_LINUX_BOARD_RPISDCARDMANAGER_H_ */
|
@ -15,6 +15,7 @@ static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ul-plmpsoc";
|
||||
static constexpr char UART_PLOC_SUPERVSIOR_DEV[] = "/dev/ul-plsv";
|
||||
static constexpr char UART_SYRLINKS_DEV[] = "/dev/ul-syrlinks";
|
||||
static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ul-str";
|
||||
static constexpr char UART_SCEX_DEV[] = "/dev/ul-scex";
|
||||
|
||||
static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0";
|
||||
static constexpr char UIO_PTME[] = "/dev/uio1";
|
||||
|
@ -139,7 +139,11 @@ ReturnValue_t CoreController::initialize() {
|
||||
|
||||
ReturnValue_t CoreController::initializeAfterTaskCreation() {
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
sdInfo.pref = sdcMan->getPreferredSdCard();
|
||||
auto sdCard = sdcMan->getPreferredSdCard();
|
||||
if (not sdCard) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
sdInfo.pref = sdCard.value();
|
||||
sdcMan->setActiveSdCard(sdInfo.pref);
|
||||
currMntPrefix = sdcMan->getCurrentMountPrefix();
|
||||
if (BLOCKING_SD_INIT) {
|
||||
@ -337,7 +341,11 @@ ReturnValue_t CoreController::sdStateMachine() {
|
||||
if (sdInfo.state == SdStates::SET_STATE_SELF) {
|
||||
if (not sdInfo.commandExecuted) {
|
||||
result = sdcMan->getSdCardsStatus(sdInfo.currentState);
|
||||
sdInfo.pref = sdcMan->getPreferredSdCard();
|
||||
auto sdCard = sdcMan->getPreferredSdCard();
|
||||
if (not sdCard) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
sdInfo.pref = sdCard.value();
|
||||
updateSdInfoOther();
|
||||
if (sdInfo.pref != sd::SdCard::SLOT_0 and sdInfo.pref != sd::SdCard::SLOT_1) {
|
||||
sif::warning << "Preferred SD card invalid. Setting to card 0.." << std::endl;
|
||||
@ -384,6 +392,7 @@ ReturnValue_t CoreController::sdStateMachine() {
|
||||
if (nonBlockingOpChecking(SdStates::DETERMINE_OTHER, 5, "Mounting SD card")) {
|
||||
sdInfo.prefState = sd::SdState::MOUNTED;
|
||||
currentStateSetter(sdInfo.pref, sd::SdState::MOUNTED);
|
||||
sdcMan->setActiveSdCard(sdInfo.pref);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "bsp_q7s/core/InitMission.h"
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
|
||||
#include <linux/InitMission.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
@ -242,6 +243,11 @@ void initmission::initTasks() {
|
||||
initmission::printAddObjectError("PTME_TEST", objects::CCSDS_IP_CORE_BRIDGE);
|
||||
}
|
||||
#endif
|
||||
#if OBSW_ADD_SCEX_DEVICE == 1
|
||||
PeriodicTaskIF* scexDevHandler;
|
||||
PeriodicTaskIF* scexReaderTask;
|
||||
scheduling::schedulingScex(*factory, scexDevHandler, scexReaderTask);
|
||||
#endif
|
||||
|
||||
std::vector<PeriodicTaskIF*> pusTasks;
|
||||
createPusTasks(*factory, missedDeadlineFunc, pusTasks);
|
||||
@ -280,8 +286,9 @@ void initmission::initTasks() {
|
||||
|
||||
taskStarter(pstTasks, "PST task vector");
|
||||
taskStarter(pusTasks, "PUS task vector");
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
taskStarter(testTasks, "Test task vector");
|
||||
#if OBSW_ADD_SCEX_DEVICE == 1
|
||||
scexDevHandler->startTask();
|
||||
scexReaderTask->startTask();
|
||||
#endif
|
||||
|
||||
#if OBSW_TEST_CCSDS_BRIDGE == 1
|
||||
@ -304,6 +311,11 @@ void initmission::initTasks() {
|
||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||
supvHelperTask->startTask();
|
||||
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
||||
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
taskStarter(testTasks, "Test task vector");
|
||||
#endif
|
||||
|
||||
sif::info << "Tasks started.." << std::endl;
|
||||
}
|
||||
|
||||
@ -514,23 +526,23 @@ void initmission::createTestTasks(TaskFactory& factory,
|
||||
}
|
||||
|
||||
/**
|
||||
▄ ▄
|
||||
▌▒█ ▄▀▒▌
|
||||
▌▒▒█ ▄▀▒▒▒▐
|
||||
▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐
|
||||
▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐
|
||||
▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌
|
||||
▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌
|
||||
▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐
|
||||
▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌
|
||||
▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌
|
||||
▌▒▀▐▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒▐
|
||||
▐▒▒▐▀▐▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌
|
||||
▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒▐
|
||||
▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌
|
||||
▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▄▒▒▐
|
||||
▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌
|
||||
▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀
|
||||
▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀
|
||||
▒▒▒▒▒▒▒▒▒▒▀▀
|
||||
â–„ â–„
|
||||
▌▒█ ▄▀▒▌
|
||||
▌▒▒█ ▄▀▒▒▒â–<EFBFBD>
|
||||
â–<EFBFBD>▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒â–<EFBFBD>
|
||||
▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒â–<EFBFBD>
|
||||
▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌
|
||||
â–<EFBFBD>▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌
|
||||
▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒â–<EFBFBD>
|
||||
â–<EFBFBD>░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌
|
||||
▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌
|
||||
▌▒▀â–<EFBFBD>▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒â–<EFBFBD>
|
||||
â–<EFBFBD>â–’â–’â–<EFBFBD>â–€â–<EFBFBD>▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌
|
||||
â–<EFBFBD>▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒â–<EFBFBD>
|
||||
▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌
|
||||
â–<EFBFBD>â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–‘â–’â–‘â–’â–‘â–’â–’â–„â–’â–’â–<EFBFBD>
|
||||
▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌
|
||||
▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀
|
||||
▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀
|
||||
▒▒▒▒▒▒▒▒▒▒▀▀
|
||||
**/
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "ObjectFactory.h"
|
||||
|
||||
#include <linux/devices/ScexUartReader.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "bsp_q7s/boardtest/Q7STestTask.h"
|
||||
#include "bsp_q7s/callbacks/gnssCallback.h"
|
||||
@ -865,6 +867,7 @@ void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
||||
new I2cTestClass(objects::I2C_TEST, q7s::I2C_DEFAULT_DEV);
|
||||
#endif
|
||||
#if OBSW_ADD_UART_TEST_CODE == 1
|
||||
// auto* reader= new ScexUartReader(objects::SCEX_UART_READER);
|
||||
new UartTestClass(objects::UART_TEST);
|
||||
#endif
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "bsp_q7s/core/CoreController.h"
|
||||
#include "bsp_q7s/core/ObjectFactory.h"
|
||||
@ -56,6 +58,11 @@ void ObjectFactory::produce(void* args) {
|
||||
#if OBSW_USE_CCSDS_IP_CORE == 1
|
||||
createCcsdsComponents(gpioComIF);
|
||||
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
|
||||
|
||||
#if OBSW_ADD_SCEX_DEVICE == 1
|
||||
createScexComponents(q7s::UART_GNSS_DEV, pwrSwitcher, *SdCardManager::instance(), false,
|
||||
pcdu::Switches::PDU1_CH5_SOLAR_CELL_EXP_5V);
|
||||
#endif
|
||||
/* Test Task */
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
createTestComponents(gpioComIF);
|
||||
|
@ -71,8 +71,9 @@ void FileSystemHandler::fileSystemHandlerLoop() {
|
||||
void FileSystemHandler::fileSystemCheckup() {
|
||||
SdCardManager::SdStatePair statusPair;
|
||||
sdcMan->getSdCardsStatus(statusPair);
|
||||
sd::SdCard preferredSdCard = sdcMan->getPreferredSdCard();
|
||||
if ((preferredSdCard == sd::SdCard::SLOT_0) and (statusPair.first == sd::SdState::MOUNTED)) {
|
||||
auto preferredSdCard = sdcMan->getPreferredSdCard();
|
||||
if (preferredSdCard and (preferredSdCard == sd::SdCard::SLOT_0) and
|
||||
(statusPair.first == sd::SdState::MOUNTED)) {
|
||||
currentMountPrefix = SdCardManager::SD_0_MOUNT_POINT;
|
||||
} else if ((preferredSdCard == sd::SdCard::SLOT_1) and
|
||||
(statusPair.second == sd::SdState::MOUNTED)) {
|
||||
@ -90,7 +91,7 @@ void FileSystemHandler::fileSystemCheckup() {
|
||||
sif::warning << "Preferred SD card is " << sdString
|
||||
<< " but does not appear to be mounted. Attempting fix.." << std::endl;
|
||||
// This function will appear to fix the inconsistent state
|
||||
ReturnValue_t result = sdcMan->sanitizeState(&statusPair, preferredSdCard);
|
||||
ReturnValue_t result = sdcMan->sanitizeState(&statusPair, preferredSdCard.value());
|
||||
if (result != returnvalue::OK) {
|
||||
// Oh no.
|
||||
triggerEvent(SdCardManager::SANITIZATION_FAILED, 0, 0);
|
||||
@ -108,7 +109,11 @@ ReturnValue_t FileSystemHandler::initialize() {
|
||||
<< std::endl;
|
||||
}
|
||||
sdcMan = SdCardManager::instance();
|
||||
sd::SdCard preferredSdCard = sdcMan->getPreferredSdCard();
|
||||
auto sdCard = sdcMan->getPreferredSdCard();
|
||||
if (not sdCard) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
sd::SdCard preferredSdCard = sdCard.value();
|
||||
if (preferredSdCard == sd::SdCard::SLOT_0) {
|
||||
currentMountPrefix = SdCardManager::SD_0_MOUNT_POINT;
|
||||
} else if (preferredSdCard == sd::SdCard::SLOT_1) {
|
||||
|
@ -300,11 +300,6 @@ ReturnValue_t SdCardManager::sanitizeState(SdStatePair* statusPair, sd::SdCard p
|
||||
blocking = true;
|
||||
resetNonBlockingState = true;
|
||||
}
|
||||
if (prefSdCard == sd::SdCard::NONE) {
|
||||
result = getPreferredSdCard();
|
||||
if (result != returnvalue::OK) {
|
||||
}
|
||||
}
|
||||
if (statusPair == nullptr) {
|
||||
sdStatusPtr = std::make_unique<SdStatePair>();
|
||||
statusPair = sdStatusPtr.get();
|
||||
@ -379,7 +374,7 @@ void SdCardManager::processSdStatusLine(std::pair<sd::SdState, sd::SdState>& act
|
||||
idx++;
|
||||
}
|
||||
|
||||
sd::SdCard SdCardManager::getPreferredSdCard() const {
|
||||
std::optional<sd::SdCard> SdCardManager::getPreferredSdCard() const {
|
||||
MutexGuard mg(mutex);
|
||||
auto res = mg.getLockResult();
|
||||
if (res != returnvalue::OK) {
|
||||
@ -412,13 +407,9 @@ ReturnValue_t SdCardManager::updateSdCardStateFile() {
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string SdCardManager::getCurrentMountPrefix() const {
|
||||
const std::string& SdCardManager::getCurrentMountPrefix() const {
|
||||
MutexGuard mg(mutex);
|
||||
if (sdInfo.active == sd::SdCard::SLOT_0) {
|
||||
return SD_0_MOUNT_POINT;
|
||||
} else {
|
||||
return SD_1_MOUNT_POINT;
|
||||
}
|
||||
return currentPrefix;
|
||||
}
|
||||
|
||||
SdCardManager::OpStatus SdCardManager::checkCurrentOp(Operations& currentOp) {
|
||||
@ -552,6 +543,17 @@ ReturnValue_t SdCardManager::performFsck(sd::SdCard sdcard, bool printOutput, in
|
||||
return result;
|
||||
}
|
||||
|
||||
void SdCardManager::setActiveSdCard(sd::SdCard sdCard) { sdInfo.active = sdCard; }
|
||||
void SdCardManager::setActiveSdCard(sd::SdCard sdCard) {
|
||||
MutexGuard mg(mutex);
|
||||
sdInfo.active = sdCard;
|
||||
if (sdInfo.active == sd::SdCard::SLOT_0) {
|
||||
currentPrefix = SD_0_MOUNT_POINT;
|
||||
} else {
|
||||
currentPrefix = SD_1_MOUNT_POINT;
|
||||
}
|
||||
}
|
||||
|
||||
sd::SdCard SdCardManager::getActiveSdCard() const { return sdInfo.active; }
|
||||
std::optional<sd::SdCard> SdCardManager::getActiveSdCard() const {
|
||||
MutexGuard mg(mutex);
|
||||
return sdInfo.active;
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* @param sdCard
|
||||
* @return
|
||||
*/
|
||||
sd::SdCard getPreferredSdCard() const override;
|
||||
std::optional<sd::SdCard> getPreferredSdCard() const override;
|
||||
|
||||
/**
|
||||
* Switch on the specified SD card.
|
||||
@ -159,7 +159,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* mounted
|
||||
* @return
|
||||
*/
|
||||
sd::SdCard getActiveSdCard() const override;
|
||||
std::optional<sd::SdCard> getActiveSdCard() const override;
|
||||
|
||||
/**
|
||||
* Unmount the specified SD card. This is recommended before switching it off. The SD card
|
||||
@ -188,7 +188,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* @param prefSdCardPtr
|
||||
* @return
|
||||
*/
|
||||
std::string getCurrentMountPrefix() const override;
|
||||
const std::string& getCurrentMountPrefix() const override;
|
||||
|
||||
OpStatus checkCurrentOp(Operations& currentOp);
|
||||
|
||||
|
@ -215,4 +215,6 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
||||
13701;0x3585;REBOOT_SW;MEDIUM; Software reboot occurred. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h
|
||||
13702;0x3586;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s/core/CoreController.h
|
||||
13703;0x3587;REBOOT_HW;MEDIUM;;bsp_q7s/core/CoreController.h
|
||||
13800;0x35e8;EXPERIMENT_TIMEDOUT;LOW;;mission/devices/devicedefinitions/ScexDefinitions.h
|
||||
13800;0x35e8;MISSING_PACKET;LOW;;mission/devices/devicedefinitions/ScexDefinitions.h
|
||||
13801;0x35e9;EXPERIMENT_TIMEDOUT;LOW;;mission/devices/devicedefinitions/ScexDefinitions.h
|
||||
13802;0x35ea;MULTI_PACKET_COMMAND_DONE;INFO;;mission/devices/devicedefinitions/ScexDefinitions.h
|
||||
|
|
@ -1,6 +1,6 @@
|
||||
Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
|
||||
0x0000;OK;System-wide code for ok.;0;HasReturnvaluesIF;fsfw/returnvalues/HasReturnvaluesIF.h
|
||||
0x0001;Failed;Unspecified system-wide code for failed.;1;HasReturnvaluesIF;fsfw/returnvalues/HasReturnvaluesIF.h
|
||||
0x0000;OK;System-wide code for ok.;0;HasReturnvaluesIF;fsfw/returnvalues/returnvalue.h
|
||||
0x0001;Failed;Unspecified system-wide code for failed.;1;HasReturnvaluesIF;fsfw/returnvalues/returnvalue.h
|
||||
0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h
|
||||
0x58a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h
|
||||
0x58a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h
|
||||
@ -361,8 +361,9 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
|
||||
0x2cd2;CCS_TooShortBlockedPacket;;210;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h
|
||||
0x2cd3;CCS_TooShortMapExtraction;;211;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h
|
||||
0x4201;PUS11_InvalidTypeTimeWindow;;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4202;PUS11_TimeshiftingNotPossible;;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4203;PUS11_InvalidRelativeTime;;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4202;PUS11_InvalidTimeWindow;;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4203;PUS11_TimeshiftingNotPossible;;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4204;PUS11_InvalidRelativeTime;;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x3401;DC_NoReplyReceived;;1;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h
|
||||
0x3402;DC_ProtocolError;;2;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h
|
||||
0x3403;DC_Nullpointer;;3;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h
|
||||
|
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @brief Auto-generated event translation file. Contains 217 translations.
|
||||
* @brief Auto-generated event translation file. Contains 219 translations.
|
||||
* @details
|
||||
* Generated on: 2022-08-24 16:53:50
|
||||
* Generated on: 2022-08-31 16:07:07
|
||||
*/
|
||||
#include "translateEvents.h"
|
||||
|
||||
@ -217,7 +217,9 @@ const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE";
|
||||
const char *REBOOT_SW_STRING = "REBOOT_SW";
|
||||
const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED";
|
||||
const char *REBOOT_HW_STRING = "REBOOT_HW";
|
||||
const char *MISSING_PACKET_STRING = "MISSING_PACKET";
|
||||
const char *EXPERIMENT_TIMEDOUT_STRING = "EXPERIMENT_TIMEDOUT";
|
||||
const char *MULTI_PACKET_COMMAND_DONE_STRING = "MULTI_PACKET_COMMAND_DONE";
|
||||
|
||||
const char *translateEvents(Event event) {
|
||||
switch ((event & 0xFFFF)) {
|
||||
@ -646,7 +648,11 @@ const char *translateEvents(Event event) {
|
||||
case (13703):
|
||||
return REBOOT_HW_STRING;
|
||||
case (13800):
|
||||
return MISSING_PACKET_STRING;
|
||||
case (13801):
|
||||
return EXPERIMENT_TIMEDOUT_STRING;
|
||||
case (13802):
|
||||
return MULTI_PACKET_COMMAND_DONE_STRING;
|
||||
default:
|
||||
return "UNKNOWN_EVENT";
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @brief Auto-generated object translation file.
|
||||
* @details
|
||||
* Contains 135 translations.
|
||||
* Generated on: 2022-08-24 16:53:50
|
||||
* Generated on: 2022-08-31 16:07:07
|
||||
*/
|
||||
#include "translateObjects.h"
|
||||
|
||||
|
@ -6,4 +6,4 @@ add_subdirectory(devices)
|
||||
add_subdirectory(fsfwconfig)
|
||||
add_subdirectory(obc)
|
||||
|
||||
target_sources(${OBSW_NAME} PUBLIC ObjectFactory.cpp)
|
||||
target_sources(${OBSW_NAME} PUBLIC ObjectFactory.cpp InitMission.cpp)
|
||||
|
47
linux/InitMission.cpp
Normal file
47
linux/InitMission.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
#include "InitMission.h"
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||
#include <mission/utility/InitMission.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "ObjectFactory.h"
|
||||
|
||||
void scheduling::schedulingScex(TaskFactory& factory, PeriodicTaskIF*& scexDevHandler,
|
||||
PeriodicTaskIF*& scexReaderTask) {
|
||||
using namespace initmission;
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
#if OBSW_PRINT_MISSED_DEADLINES == 1
|
||||
void (*missedDeadlineFunc)(void) = TaskFactory::printMissedDeadline;
|
||||
#else
|
||||
void (*missedDeadlineFunc)(void) = nullptr;
|
||||
#endif
|
||||
scexDevHandler = factory.createPeriodicTask(
|
||||
"SCEX_DEV", 35, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc);
|
||||
|
||||
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
if (result != returnvalue::OK) {
|
||||
printAddObjectError("SCEX_DEV", objects::SCEX);
|
||||
}
|
||||
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_WRITE);
|
||||
if (result != returnvalue::OK) {
|
||||
printAddObjectError("SCEX_DEV", objects::SCEX);
|
||||
}
|
||||
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_WRITE);
|
||||
if (result != returnvalue::OK) {
|
||||
printAddObjectError("SCEX_DEV", objects::SCEX);
|
||||
}
|
||||
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_READ);
|
||||
if (result != returnvalue::OK) {
|
||||
printAddObjectError("SCEX_DEV", objects::SCEX);
|
||||
}
|
||||
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_READ);
|
||||
|
||||
result = returnvalue::OK;
|
||||
scexReaderTask = factory.createPeriodicTask(
|
||||
"SCEX_UART_READER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||
result = scexReaderTask->addComponent(objects::SCEX_UART_READER);
|
||||
if (result != returnvalue::OK) {
|
||||
printAddObjectError("SCEX_UART_READER", objects::SCEX_UART_READER);
|
||||
}
|
||||
}
|
7
linux/InitMission.h
Normal file
7
linux/InitMission.h
Normal file
@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
|
||||
namespace scheduling {
|
||||
void schedulingScex(TaskFactory& factory, PeriodicTaskIF*& scexDevHandler,
|
||||
PeriodicTaskIF*& scexReaderTask);
|
||||
}
|
@ -323,15 +323,21 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
|
||||
#endif // OBSW_ADD_RTD_DEVICES == 1
|
||||
}
|
||||
|
||||
void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher) {
|
||||
void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher,
|
||||
SdCardMountedIF& mountedIF, bool onImmediately,
|
||||
std::optional<power::Switch_t> switchId) {
|
||||
// objekte anlegen
|
||||
SdCardMountedIF* sdcMan = nullptr;
|
||||
auto* cookie = new UartCookie(objects::SCEX, uartDev, uart::SCEX_BAUD, 4096);
|
||||
|
||||
auto scexUartReader = new ScexUartReader(objects::SCEX_UART_READER);
|
||||
auto scexHandler = new ScexDeviceHandler(objects::SCEX, *scexUartReader, cookie, sdcMan);
|
||||
auto scexHandler = new ScexDeviceHandler(objects::SCEX, *scexUartReader, cookie, mountedIF);
|
||||
if (onImmediately) {
|
||||
scexHandler->setStartUpImmediately();
|
||||
}
|
||||
if (switchId) {
|
||||
scexHandler->setPowerSwitcher(*pwrSwitcher, switchId.value());
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectFactory::createThermalController() {
|
||||
new ThermalController(objects::THERMAL_CONTROLLER, objects::NO_OBJECT);
|
||||
|
@ -1,8 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <fsfw/power/definitions.h>
|
||||
#include <fsfw/returnvalues/returnvalue.h>
|
||||
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
|
||||
#include <mission/memory/SdCardMountedIF.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
class GpioIF;
|
||||
@ -16,7 +19,9 @@ void createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitc
|
||||
void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher,
|
||||
SpiComIF* comIF);
|
||||
|
||||
void createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher);
|
||||
void createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher,
|
||||
SdCardMountedIF& mountedIF, bool onImmediately,
|
||||
std::optional<power::Switch_t> switchId);
|
||||
|
||||
void gpioChecker(ReturnValue_t result, std::string output);
|
||||
|
||||
|
@ -27,12 +27,11 @@
|
||||
|
||||
using namespace returnvalue;
|
||||
|
||||
UartTestClass::UartTestClass(object_id_t objectId, ScexUartReader* reader)
|
||||
: TestTask(objectId), reader(reader) {
|
||||
UartTestClass::UartTestClass(object_id_t objectId) : TestTask(objectId) {
|
||||
mode = TestModes::SCEX;
|
||||
scexMode = ScexModes::READER_TASK;
|
||||
scexMode = ScexModes::SIMPLE;
|
||||
// No one-cell and all-cell support implemented yet
|
||||
currCmd = scex::Cmds::FRAM;
|
||||
currCmd = scex::Cmds::PING;
|
||||
if (scexMode == ScexModes::SIMPLE) {
|
||||
auto encodingBuf = new std::array<uint8_t, 4096>;
|
||||
DleParser::BufPair encodingBufPair{encodingBuf->data(), encodingBuf->size()};
|
||||
@ -40,6 +39,8 @@ UartTestClass::UartTestClass(object_id_t objectId, ScexUartReader* reader)
|
||||
DleParser::BufPair decodingBufPair{decodedBuf->data(), decodedBuf->size()};
|
||||
dleParser = new ScexDleParser(*(new SimpleRingBuffer(4096, true)), dleEncoder, encodingBufPair,
|
||||
decodingBufPair, &foundDlePacketHandler, this);
|
||||
} else {
|
||||
reader = new ScexUartReader(objects::SCEX_UART_READER);
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,13 +151,13 @@ void UartTestClass::gpsPeriodic() {
|
||||
}
|
||||
|
||||
void UartTestClass::scexInit() {
|
||||
if (scexMode == ScexModes::SIMPLE) {
|
||||
scexSimpleInit();
|
||||
} else {
|
||||
if (reader == nullptr) {
|
||||
sif::warning << "UartTestClass::scexInit: Reader invalid" << std::endl;
|
||||
return;
|
||||
}
|
||||
if (scexMode == ScexModes::SIMPLE) {
|
||||
scexSimpleInit();
|
||||
} else {
|
||||
#if defined(RASPBERRY_PI)
|
||||
std::string devname = "/dev/serial0";
|
||||
#else
|
||||
@ -176,13 +177,13 @@ void UartTestClass::scexInit() {
|
||||
void UartTestClass::scexPeriodic() {
|
||||
using namespace std;
|
||||
using namespace scex;
|
||||
if (reader == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (scexMode == ScexModes::SIMPLE) {
|
||||
scexSimplePeriodic();
|
||||
} else {
|
||||
if (reader == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (not cmdSent) {
|
||||
size_t len = 0;
|
||||
prepareScexCmd(currCmd, false, cmdBuf.data(), &len);
|
||||
@ -375,6 +376,7 @@ int UartTestClass::prepareScexCmd(scex::Cmds cmd, bool tempCheck, uint8_t* cmdBu
|
||||
uint16_t crc = CRC::crc16ccitt(cmdBuf, 5);
|
||||
cmdBuf[5] = (crc >> 8) & 0xff;
|
||||
cmdBuf[6] = crc & 0xff;
|
||||
*len = 7;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ class ScexDleParser;
|
||||
|
||||
class UartTestClass : public TestTask {
|
||||
public:
|
||||
UartTestClass(object_id_t objectId, ScexUartReader* reader);
|
||||
UartTestClass(object_id_t objectId);
|
||||
|
||||
ReturnValue_t initialize() override;
|
||||
ReturnValue_t performOneShotAction() override;
|
||||
|
@ -34,7 +34,6 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) {
|
||||
lock->unlockMutex();
|
||||
while (true) {
|
||||
semaphore->acquire();
|
||||
sif::info << "task was started" << std::endl;
|
||||
int bytesRead = 0;
|
||||
while (true) {
|
||||
bytesRead = read(serialPort, reinterpret_cast<void *>(recBuf.data()),
|
||||
@ -42,7 +41,6 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) {
|
||||
if (bytesRead == 0) {
|
||||
MutexGuard mg(lock);
|
||||
if (state == States::FINISH) {
|
||||
sif::debug << "finish detected" << std::endl;
|
||||
state = States::IDLE;
|
||||
break;
|
||||
}
|
||||
@ -66,8 +64,6 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) {
|
||||
}
|
||||
}
|
||||
};
|
||||
// task block comes here
|
||||
sif::info << "task was stopped" << std::endl;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
@ -135,7 +131,6 @@ ReturnValue_t ScexUartReader::sendMessage(CookieIF *cookie, const uint8_t *sendD
|
||||
sif::warning << "ScexUartReader::sendMessage: Encoding failed" << std::endl;
|
||||
return FAILED;
|
||||
}
|
||||
arrayprinter::print(cmdbuf.data(), encodedLen);
|
||||
size_t bytesWritten = write(serialPort, cmdbuf.data(), encodedLen);
|
||||
if (bytesWritten != encodedLen) {
|
||||
sif::warning << "ScexUartReader::sendMessage: Sending ping command to solar experiment failed"
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @brief Auto-generated event translation file. Contains 217 translations.
|
||||
* @brief Auto-generated event translation file. Contains 219 translations.
|
||||
* @details
|
||||
* Generated on: 2022-08-24 16:53:50
|
||||
* Generated on: 2022-08-31 16:07:07
|
||||
*/
|
||||
#include "translateEvents.h"
|
||||
|
||||
@ -217,7 +217,9 @@ const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE";
|
||||
const char *REBOOT_SW_STRING = "REBOOT_SW";
|
||||
const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED";
|
||||
const char *REBOOT_HW_STRING = "REBOOT_HW";
|
||||
const char *MISSING_PACKET_STRING = "MISSING_PACKET";
|
||||
const char *EXPERIMENT_TIMEDOUT_STRING = "EXPERIMENT_TIMEDOUT";
|
||||
const char *MULTI_PACKET_COMMAND_DONE_STRING = "MULTI_PACKET_COMMAND_DONE";
|
||||
|
||||
const char *translateEvents(Event event) {
|
||||
switch ((event & 0xFFFF)) {
|
||||
@ -646,7 +648,11 @@ const char *translateEvents(Event event) {
|
||||
case (13703):
|
||||
return REBOOT_HW_STRING;
|
||||
case (13800):
|
||||
return MISSING_PACKET_STRING;
|
||||
case (13801):
|
||||
return EXPERIMENT_TIMEDOUT_STRING;
|
||||
case (13802):
|
||||
return MULTI_PACKET_COMMAND_DONE_STRING;
|
||||
default:
|
||||
return "UNKNOWN_EVENT";
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @brief Auto-generated object translation file.
|
||||
* @details
|
||||
* Contains 135 translations.
|
||||
* Generated on: 2022-08-24 16:53:50
|
||||
* Generated on: 2022-08-31 16:07:07
|
||||
*/
|
||||
#include "translateObjects.h"
|
||||
|
||||
|
@ -102,8 +102,8 @@ ReturnValue_t GomspaceDeviceHandler::buildCommandFromCommand(DeviceCommandId_t d
|
||||
if (getDevType(devType) != returnvalue::OK) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
result = generateRequestFullCfgTableCmd(devType, tableCfg.cfgTableSize,
|
||||
deviceCommand, cspCookie);
|
||||
result =
|
||||
generateRequestFullCfgTableCmd(devType, tableCfg.cfgTableSize, deviceCommand, cspCookie);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
|
@ -93,9 +93,8 @@ class GomspaceDeviceHandler : public DeviceHandlerBase {
|
||||
* @param cspCookie
|
||||
* @return
|
||||
*/
|
||||
ReturnValue_t generateRequestFullCfgTableCmd(GOMSPACE::DeviceType devType,
|
||||
uint16_t tableSize, DeviceCommandId_t id,
|
||||
CspCookie *cspCookie);
|
||||
ReturnValue_t generateRequestFullCfgTableCmd(GOMSPACE::DeviceType devType, uint16_t tableSize,
|
||||
DeviceCommandId_t id, CspCookie *cspCookie);
|
||||
ReturnValue_t getDevType(GOMSPACE::DeviceType &type) const;
|
||||
/**
|
||||
* This command handles printing the HK table to the console. This is useful for debugging
|
||||
|
@ -491,8 +491,8 @@ void PayloadPcduHandler::checkAdcValues() {
|
||||
|
||||
void PayloadPcduHandler::checkJsonFileInit() {
|
||||
if (not jsonFileInitComplete) {
|
||||
sd::SdCard activeSd = sdcMan->getActiveSdCard();
|
||||
if (sdcMan->isSdCardMounted(activeSd)) {
|
||||
auto activeSd = sdcMan->getActiveSdCard();
|
||||
if (activeSd and sdcMan->isSdCardMounted(activeSd.value())) {
|
||||
params.initialize(sdcMan->getCurrentMountPrefix());
|
||||
jsonFileInitComplete = true;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <mission/memory/SdCardMountedIF.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
|
||||
@ -14,25 +15,18 @@ using std::ofstream;
|
||||
using namespace returnvalue;
|
||||
|
||||
ScexDeviceHandler::ScexDeviceHandler(object_id_t objectId, ScexUartReader& reader, CookieIF* cookie,
|
||||
SdCardMountedIF* sdcMan)
|
||||
SdCardMountedIF& sdcMan)
|
||||
: DeviceHandlerBase(objectId, reader.getObjectId(), cookie), sdcMan(sdcMan), reader(reader) {}
|
||||
|
||||
ScexDeviceHandler::~ScexDeviceHandler() {}
|
||||
|
||||
void ScexDeviceHandler::doStartUp() {
|
||||
// mode on
|
||||
setMode(MODE_ON);
|
||||
}
|
||||
void ScexDeviceHandler::doStartUp() { setMode(MODE_ON); }
|
||||
|
||||
void ScexDeviceHandler::doShutDown() { setMode(_MODE_POWER_DOWN); }
|
||||
|
||||
ReturnValue_t ScexDeviceHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
||||
return OK;
|
||||
}
|
||||
ReturnValue_t ScexDeviceHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { return OK; }
|
||||
|
||||
ReturnValue_t ScexDeviceHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
||||
return OK;
|
||||
}
|
||||
ReturnValue_t ScexDeviceHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { return OK; }
|
||||
|
||||
ReturnValue_t ScexDeviceHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
||||
const uint8_t* commandData,
|
||||
@ -88,8 +82,17 @@ ReturnValue_t ScexDeviceHandler::buildCommandFromCommand(DeviceCommandId_t devic
|
||||
finishCountdown.setTimeout(LONG_CD);
|
||||
// countdown starten
|
||||
finishCountdown.resetTimer();
|
||||
if (debugMode) {
|
||||
uint32_t remainingMillis = finishCountdown.getRemainingMillis();
|
||||
|
||||
sif::info << "ScexDeviceHandler::buildCommandFromCommand: RemainingMillis: "
|
||||
<< remainingMillis << std::endl;
|
||||
}
|
||||
|
||||
prepareScexCmd(cmdTyped, {cmdBuf.data(), cmdBuf.size()}, rawPacketLen,
|
||||
{commandData + 1, commandDataLen - 1}, tempCheck);
|
||||
updatePeriodicReply(true, deviceCommand);
|
||||
actionHelper.finish(true, getCommanderQueueId(deviceCommand), deviceCommand, OK);
|
||||
break;
|
||||
}
|
||||
case (ONE_CELL): {
|
||||
@ -98,6 +101,8 @@ ReturnValue_t ScexDeviceHandler::buildCommandFromCommand(DeviceCommandId_t devic
|
||||
finishCountdown.resetTimer();
|
||||
prepareScexCmd(cmdTyped, {cmdBuf.data(), cmdBuf.size()}, rawPacketLen,
|
||||
{commandData + 1, commandDataLen - 1}, tempCheck);
|
||||
updatePeriodicReply(true, deviceCommand);
|
||||
actionHelper.finish(true, getCommanderQueueId(deviceCommand), deviceCommand, OK);
|
||||
break;
|
||||
}
|
||||
case (ALL_CELLS_CMD): {
|
||||
@ -106,6 +111,8 @@ ReturnValue_t ScexDeviceHandler::buildCommandFromCommand(DeviceCommandId_t devic
|
||||
finishCountdown.resetTimer();
|
||||
prepareScexCmd(cmdTyped, {cmdBuf.data(), cmdBuf.size()}, rawPacketLen,
|
||||
{commandData + 1, commandDataLen - 1}, tempCheck);
|
||||
actionHelper.finish(true, getCommanderQueueId(deviceCommand), deviceCommand, OK);
|
||||
updatePeriodicReply(true, deviceCommand);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@ -123,12 +130,12 @@ void ScexDeviceHandler::fillCommandAndReplyMap() {
|
||||
insertInCommandAndReplyMap(scex::Cmds::TEMP_CMD, 3);
|
||||
insertInCommandAndReplyMap(scex::Cmds::EXP_STATUS_CMD, 3);
|
||||
|
||||
insertInCommandAndReplyMap(scex::Cmds::ALL_CELLS_CMD, 0, nullptr, 0, false, false,
|
||||
insertInCommandAndReplyMap(scex::Cmds::ALL_CELLS_CMD, 0, nullptr, 0, true, false,
|
||||
scex::Cmds::ALL_CELLS_CMD, &finishCountdown);
|
||||
insertInCommandAndReplyMap(scex::Cmds::ONE_CELL, 0, nullptr, 0, false, false,
|
||||
scex::Cmds::ONE_CELL, &finishCountdown);
|
||||
insertInCommandAndReplyMap(scex::Cmds::FRAM, 0, nullptr, 0, false, false,
|
||||
scex::Cmds::FRAM, &finishCountdown);
|
||||
insertInCommandAndReplyMap(scex::Cmds::ONE_CELL, 0, nullptr, 0, true, false, scex::Cmds::ONE_CELL,
|
||||
&finishCountdown);
|
||||
insertInCommandAndReplyMap(scex::Cmds::FRAM, 0, nullptr, 0, true, false, scex::Cmds::FRAM,
|
||||
&finishCountdown);
|
||||
|
||||
insertInReplyMap(scex::Cmds::ERROR_REPLY, 3);
|
||||
}
|
||||
@ -140,58 +147,93 @@ ReturnValue_t ScexDeviceHandler::scanForReply(const uint8_t* start, size_t remai
|
||||
|
||||
if (result == ScexHelper::INVALID_CRC) {
|
||||
sif::warning << "ScexDeviceHandler::scanForReply: CRC invalid" << std::endl;
|
||||
*foundLen = remainingSize;
|
||||
} else {
|
||||
result = handleValidReply(remainingSize, foundId, foundLen);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
*foundId = helper.getCmd();
|
||||
*foundLen = remainingSize;
|
||||
|
||||
return OK;
|
||||
ReturnValue_t ScexDeviceHandler::handleValidReply(size_t remSize, DeviceCommandId_t* foundId,
|
||||
size_t* foundLen) {
|
||||
using namespace scex;
|
||||
ReturnValue_t result = OK;
|
||||
|
||||
switch (helper.getCmd()) {
|
||||
case (FRAM): {
|
||||
if (debugMode) {
|
||||
uint32_t remainingMillis = finishCountdown.getRemainingMillis();
|
||||
|
||||
sif::info << "ScexDeviceHandler::handleValidReply: RemMillis: " << remainingMillis
|
||||
<< std::endl;
|
||||
}
|
||||
result = APERIODIC_REPLY;
|
||||
break;
|
||||
}
|
||||
case (ONE_CELL): {
|
||||
result = APERIODIC_REPLY;
|
||||
break;
|
||||
}
|
||||
case (ALL_CELLS_CMD): {
|
||||
result = APERIODIC_REPLY;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
*foundId = helper.getCmd();
|
||||
*foundLen = remSize;
|
||||
return result;
|
||||
}
|
||||
|
||||
ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) {
|
||||
// cmd auswertung (in file reinschreiben)
|
||||
using namespace scex;
|
||||
|
||||
ReturnValue_t status = OK;
|
||||
auto oneFileHandler = [&](std::string cmdName) {
|
||||
fileId = random_string(6);
|
||||
std::ostringstream oss("/tmp/scex-", std::ostringstream::ate);
|
||||
oss << cmdName << fileId << ".bin";
|
||||
fileId = date_time_string();
|
||||
std::ostringstream oss;
|
||||
auto prefix = sdcMan.getCurrentMountPrefix();
|
||||
oss << prefix << "/scex-" << cmdName << fileId << ".bin";
|
||||
fileName = oss.str();
|
||||
std::cout << fileName << std::endl;
|
||||
sif::info << "ScexDeviceHandler::interpretDeviceReply: FileName: " << fileName << std::endl;
|
||||
ofstream out(fileName, ofstream::binary);
|
||||
if (out.bad()) {
|
||||
sif::error << "ScexDeviceHandler::interpretDeviceReply: Could not open file " << fileName
|
||||
<< std::endl;
|
||||
return FAILED;
|
||||
}
|
||||
if (debugMode) {
|
||||
out << helper;
|
||||
}
|
||||
return OK;
|
||||
};
|
||||
auto multiFileHandler = [&](std::string cmdName) {
|
||||
if ((helper.getPacketCounter() == 1) or (not fileNameSet)) {
|
||||
|
||||
fileId = random_string(6);
|
||||
std::ostringstream oss("/tmp/scex-", std::ostringstream::ate);
|
||||
oss << cmdName << fileId << ".bin";
|
||||
fileId = date_time_string();
|
||||
std::ostringstream oss;
|
||||
auto prefix = sdcMan.getCurrentMountPrefix();
|
||||
oss << prefix << "/scex-" << cmdName << fileId << ".bin";
|
||||
fileName = oss.str();
|
||||
sif::info << "ScexDeviceHandler::interpretDeviceReply: FileName: " << fileName
|
||||
<< std::endl; // TODO remove
|
||||
fileNameSet = true;
|
||||
ofstream out(fileName, ofstream::binary);
|
||||
if (out.bad()) {
|
||||
sif::error << "ScexDeviceHandler::interpretDeviceReply: Could not open file " << fileName
|
||||
sif::error << "ScexDeviceHandler::handleValidReply: Could not open file " << fileName
|
||||
<< std::endl;
|
||||
return FAILED;
|
||||
}
|
||||
out << helper;
|
||||
} else {
|
||||
ofstream out(fileName,
|
||||
ofstream::binary | ofstream::app); // append
|
||||
if (debugMode) {
|
||||
if (out.bad()) {
|
||||
sif::error << "ScexDeviceHandler::handleValidReply: Could not open file " << fileName
|
||||
<< std::endl;
|
||||
return FAILED;
|
||||
}
|
||||
out << helper;
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
};
|
||||
switch (id) {
|
||||
@ -220,7 +262,7 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
||||
break;
|
||||
}
|
||||
case (ALL_CELLS_CMD): {
|
||||
status = multiFileHandler("all_cell_");
|
||||
status = multiFileHandler("multi_cell_");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -231,29 +273,40 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
||||
reader.finish();
|
||||
commandActive = false;
|
||||
if (id != PING) {
|
||||
sif::info << "Reader is finished" << std::endl;
|
||||
fileNameSet = false;
|
||||
}
|
||||
if (id == FRAM or id == ALL_CELLS_CMD or id == ONE_CELL) {
|
||||
triggerEvent(MULTI_PACKET_COMMAND_DONE, id);
|
||||
updatePeriodicReply(false, id);
|
||||
}
|
||||
}
|
||||
if (debugMode) {
|
||||
uint32_t remainingMillis = finishCountdown.getRemainingMillis();
|
||||
sif::info << __FILE__ << __func__ << "(" << __LINE__ << ") RemMillis: " << remainingMillis
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
void ScexDeviceHandler::performOperationHook() {
|
||||
uint32_t remainingMillis = finishCountdown.getRemainingMillis();
|
||||
if (commandActive and finishCountdown.hasTimedOut()) {
|
||||
triggerEvent(scex::EXPERIMENT_TIMEDOUT, currCmd, 0);
|
||||
reader.finish();
|
||||
sif::warning << "ScexDeviceHandler::performOperationHook: Reader timeout" << std::endl;
|
||||
sif::warning << "ScexDeviceHandler::scanForReply: Reader timeout; RemMillis: "
|
||||
<< remainingMillis << std::endl;
|
||||
fileNameSet = false;
|
||||
commandActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t ScexDeviceHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) {
|
||||
return OK;
|
||||
}
|
||||
uint32_t ScexDeviceHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return OK; }
|
||||
|
||||
ReturnValue_t ScexDeviceHandler::getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) {
|
||||
if (switchId) {
|
||||
*numberOfSwitches = 1;
|
||||
*switches = &switchId.value();
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
@ -262,23 +315,38 @@ ReturnValue_t ScexDeviceHandler::initializeLocalDataPool(localpool::DataPool& lo
|
||||
return OK;
|
||||
}
|
||||
|
||||
std::string ScexDeviceHandler::random_string(std::string::size_type length) {
|
||||
static auto& chrs =
|
||||
"0123456789"
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
std::string ScexDeviceHandler::date_time_string() {
|
||||
using namespace std;
|
||||
string date_time;
|
||||
Clock::TimeOfDay_t tod;
|
||||
Clock::getDateAndTime(&tod);
|
||||
ostringstream oss(std::ostringstream::ate);
|
||||
|
||||
thread_local static std::mt19937 rg{std::random_device{}()};
|
||||
thread_local static std::uniform_int_distribution<std::string::size_type> pick(0,
|
||||
sizeof(chrs) - 2);
|
||||
if (tod.hour < 10) {
|
||||
oss << tod.year << tod.month << tod.day << "_0" << tod.hour;
|
||||
} else {
|
||||
oss << tod.year << tod.month << tod.day << "_" << tod.hour;
|
||||
}
|
||||
if (tod.minute < 10) {
|
||||
oss << 0 << tod.minute;
|
||||
|
||||
std::string s;
|
||||
} else {
|
||||
oss << tod.minute;
|
||||
}
|
||||
if (tod.second < 10) {
|
||||
oss << 0 << tod.second;
|
||||
} else {
|
||||
oss << tod.second;
|
||||
}
|
||||
|
||||
s.reserve(length);
|
||||
date_time = oss.str();
|
||||
|
||||
while (length--) s += chrs[pick(rg)];
|
||||
|
||||
return s;
|
||||
return date_time;
|
||||
}
|
||||
|
||||
void ScexDeviceHandler::modeChanged() {}
|
||||
|
||||
void ScexDeviceHandler::setPowerSwitcher(PowerSwitchIF& powerSwitcher, power::Switch_t switchId) {
|
||||
DeviceHandlerBase::setPowerSwitcher(&powerSwitcher);
|
||||
this->switchId = switchId;
|
||||
}
|
||||
|
@ -5,12 +5,17 @@
|
||||
#include <linux/devices/ScexHelper.h>
|
||||
#include <linux/devices/ScexUartReader.h>
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "commonSubsystemIds.h"
|
||||
|
||||
class SdCardMountedIF;
|
||||
|
||||
class ScexDeviceHandler : public DeviceHandlerBase {
|
||||
public:
|
||||
ScexDeviceHandler(object_id_t objectId, ScexUartReader &reader, CookieIF *cookie,
|
||||
SdCardMountedIF *sdcMan);
|
||||
SdCardMountedIF &sdcMan);
|
||||
void setPowerSwitcher(PowerSwitchIF &powerSwitcher, power::Switch_t switchId);
|
||||
virtual ~ScexDeviceHandler();
|
||||
|
||||
private:
|
||||
@ -18,17 +23,18 @@ class ScexDeviceHandler : public DeviceHandlerBase {
|
||||
static constexpr uint32_t SHORT_CD = 7000;
|
||||
std::array<uint8_t, 64> cmdBuf = {};
|
||||
|
||||
std::optional<power::Switch_t> switchId;
|
||||
std::string fileId = "";
|
||||
std::string fileName = "";
|
||||
bool fileNameSet = false;
|
||||
bool commandActive = false;
|
||||
bool debugMode = true;
|
||||
bool debugMode = false;
|
||||
|
||||
scex::Cmds currCmd = scex::Cmds::PING;
|
||||
SdCardMountedIF *sdcMan = nullptr;
|
||||
SdCardMountedIF &sdcMan;
|
||||
Countdown finishCountdown = Countdown(LONG_CD);
|
||||
|
||||
std::string random_string(std::string::size_type length);
|
||||
std::string date_time_string();
|
||||
|
||||
// DeviceHandlerBase private function implementation
|
||||
void doStartUp() override;
|
||||
@ -45,6 +51,7 @@ class ScexDeviceHandler : public DeviceHandlerBase {
|
||||
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;
|
||||
ReturnValue_t handleValidReply(size_t remSize, DeviceCommandId_t *foundId, size_t *foundLen);
|
||||
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
|
||||
ReturnValue_t getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches) override;
|
||||
|
||||
|
@ -14,8 +14,10 @@ namespace scex {
|
||||
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SCEX_HANDLER;
|
||||
|
||||
static constexpr Event MISSING_PACKET = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW);
|
||||
|
||||
static constexpr Event EXPERIMENT_TIMEDOUT = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW);
|
||||
static constexpr Event EXPERIMENT_TIMEDOUT = event::makeEvent(SUBSYSTEM_ID, 1, severity::LOW);
|
||||
//! FRAM, One Cell or All cells command finished. P1: Command ID
|
||||
static constexpr Event MULTI_PACKET_COMMAND_DONE =
|
||||
event::makeEvent(SUBSYSTEM_ID, 2, severity::INFO);
|
||||
|
||||
enum Cmds : DeviceCommandId_t {
|
||||
PING = 0b00111,
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef MISSION_MEMORY_SDCARDMOUNTERIF_H_
|
||||
#define MISSION_MEMORY_SDCARDMOUNTERIF_H_
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "definitions.h"
|
||||
@ -8,11 +9,11 @@
|
||||
class SdCardMountedIF {
|
||||
public:
|
||||
virtual ~SdCardMountedIF(){};
|
||||
virtual std::string getCurrentMountPrefix() const = 0;
|
||||
virtual const std::string& getCurrentMountPrefix() const = 0;
|
||||
virtual bool isSdCardMounted(sd::SdCard sdCard) = 0;
|
||||
virtual sd::SdCard getPreferredSdCard() const = 0;
|
||||
virtual std::optional<sd::SdCard> getPreferredSdCard() const = 0;
|
||||
virtual void setActiveSdCard(sd::SdCard sdCard) = 0;
|
||||
virtual sd::SdCard getActiveSdCard() const = 0;
|
||||
virtual std::optional<sd::SdCard> getActiveSdCard() const = 0;
|
||||
|
||||
private:
|
||||
};
|
||||
|
@ -1,12 +1,11 @@
|
||||
#ifndef MISSION_UTILITY_INITMISSION_H_
|
||||
#define MISSION_UTILITY_INITMISSION_H_
|
||||
#pragma once
|
||||
|
||||
#include <fsfw/objectmanager/SystemObjectIF.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
|
||||
namespace initmission {
|
||||
|
||||
void printAddObjectError(const char* name, object_id_t objectId) {
|
||||
static void printAddObjectError(const char* name, object_id_t objectId) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "InitMission::printAddError: Adding object " << name << " with object ID 0x"
|
||||
<< std::hex << std::setfill('0') << std::setw(8) << objectId << " failed!" << std::dec
|
||||
@ -18,5 +17,3 @@ void printAddObjectError(const char* name, object_id_t objectId) {
|
||||
}
|
||||
|
||||
} // namespace initmission
|
||||
|
||||
#endif /* MISSION_UTILITY_INITMISSION_H_ */
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit 603b7e8574d74ba60692115133cde3cd8b8bd423
|
||||
Subproject commit a7714747bc45dfa6a9ccb41cc6eb890b21ca0481
|
Loading…
x
Reference in New Issue
Block a user