diff --git a/bsp_q7s/boardtest/Q7STestTask.cpp b/bsp_q7s/boardtest/Q7STestTask.cpp index f9439fc1..18baf124 100644 --- a/bsp_q7s/boardtest/Q7STestTask.cpp +++ b/bsp_q7s/boardtest/Q7STestTask.cpp @@ -1,3 +1,4 @@ +#include #include #include #include "Q7STestTask.h" @@ -24,6 +25,7 @@ ReturnValue_t Q7STestTask::performOneShotAction() { //testScratchApi(); //testJsonLibDirect(); //testDummyParams(); + //testProtHandler(); //FsOpCodes opCode = FsOpCodes::ATTEMPT_DIR_REMOVAL_NON_EMPTY; //testFileSystemHandlerDirect(opCode); return TestTask::performOneShotAction(); @@ -131,6 +133,87 @@ void Q7STestTask::testDummyParams() { sif::info << "Test value 2 (\"blirb\" expected): " << test2 << std::endl; } +ReturnValue_t Q7STestTask::initialize() { + coreController = ObjectManager::instance()->get(objects::CORE_CONTROLLER); + if(coreController == nullptr) { + sif::warning << "Q7STestTask::initialize: Could not retrieve CORE_CONTROLLER object" << + std::endl; + } + return TestTask::initialize(); +} + +void Q7STestTask::testProtHandler() { + bool opPerformed = false; + ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + // If any chips are unlocked, lock them here + result = coreController->setBootCopyProtection( + CoreController::Chip::ALL_CHIP, CoreController::Copy::ALL_COPY, true, + opPerformed, true); + if(result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl; + } + + // unlock own copy + result = coreController->setBootCopyProtection( + CoreController::Chip::SELF_CHIP, CoreController::Copy::SELF_COPY, false, + opPerformed, true); + if(result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl; + } + if(not opPerformed) { + sif::warning << "Q7STestTask::testProtHandler: No op performed" << std::endl; + } + int retval = std::system("print-chip-prot-status.sh"); + if(retval != 0) { + utility::handleSystemError(retval, "Q7STestTask::testProtHandler"); + } + + // lock own copy + result = coreController->setBootCopyProtection( + CoreController::Chip::SELF_CHIP, CoreController::Copy::SELF_COPY, true, + opPerformed, true); + if(result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl; + } + if(not opPerformed) { + sif::warning << "Q7STestTask::testProtHandler: No op performed" << std::endl; + } + retval = std::system("print-chip-prot-status.sh"); + if(retval != 0) { + utility::handleSystemError(retval, "Q7STestTask::testProtHandler"); + } + + // unlock specific copy + result = coreController->setBootCopyProtection( + CoreController::Chip::CHIP_1, CoreController::Copy::COPY_1, false, + opPerformed, true); + if(result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl; + } + if(not opPerformed) { + sif::warning << "Q7STestTask::testProtHandler: No op performed" << std::endl; + } + retval = std::system("print-chip-prot-status.sh"); + if(retval != 0) { + utility::handleSystemError(retval, "Q7STestTask::testProtHandler"); + } + + // lock specific copy + result = coreController->setBootCopyProtection( + CoreController::Chip::CHIP_1, CoreController::Copy::COPY_1, true, + opPerformed, true); + if(result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl; + } + if(not opPerformed) { + sif::warning << "Q7STestTask::testProtHandler: No op performed" << std::endl; + } + retval = std::system("print-chip-prot-status.sh"); + if(retval != 0) { + utility::handleSystemError(retval, "Q7STestTask::testProtHandler"); + } +} + void Q7STestTask::testFileSystemHandlerDirect(FsOpCodes opCode) { auto fsHandler = ObjectManager::instance()-> get(objects::FILE_SYSTEM_HANDLER); diff --git a/bsp_q7s/boardtest/Q7STestTask.h b/bsp_q7s/boardtest/Q7STestTask.h index a14d8428..b0153ce9 100644 --- a/bsp_q7s/boardtest/Q7STestTask.h +++ b/bsp_q7s/boardtest/Q7STestTask.h @@ -6,7 +6,10 @@ class Q7STestTask: public TestTask { public: Q7STestTask(object_id_t objectId); + + ReturnValue_t initialize() override; private: + CoreController* coreController = nullptr; ReturnValue_t performOneShotAction() override; void testSdCard(); @@ -15,6 +18,7 @@ private: void testScratchApi(); void testJsonLibDirect(); void testDummyParams(); + void testProtHandler(); enum FsOpCodes { CREATE_EMPTY_FILE_IN_TMP, diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index bf1a1b1a..b899e60f 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -21,12 +21,11 @@ #include -CoreController::Chip CoreController::currentChip = Chip::NO_CHIP; -CoreController::Copy CoreController::currentCopy = Copy::NO_COPY; +CoreController::Chip CoreController::CURRENT_CHIP = Chip::NO_CHIP; +CoreController::Copy CoreController::CURRENT_COPY = Copy::NO_COPY; CoreController::CoreController(object_id_t objectId): - ExtendedControllerBase(objectId, objects::NO_OBJECT, 5), - opDivider(5) { + ExtendedControllerBase(objectId, objects::NO_OBJECT, 5), opDivider(5) { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; try { result = initWatchdogFifo(); @@ -86,6 +85,28 @@ ReturnValue_t CoreController::initialize() { return ExtendedControllerBase::initialize(); } +ReturnValue_t CoreController::initializeAfterTaskCreation() { + ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + if(BLOCKING_SD_INIT) { + ReturnValue_t result = initSdCardBlocking(); + if(result != HasReturnvaluesIF::RETURN_OK and result != SdCardManager::ALREADY_MOUNTED) { + sif::warning << "CoreController::CoreController: SD card init failed" << std::endl; + } + } + sdStateMachine(); + result = initVersionFile(); + if(result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "CoreController::initialize: Version initialization failed" << std::endl; + } + // Add script folder to path + char* currentEnvPath = getenv("PATH"); + std::string updatedEnvPath = std::string(currentEnvPath) + ":/home/root/scripts"; + setenv("PATH", updatedEnvPath.c_str(), true); + updateProtInfo(); + initPrint(); + return result; +} + ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode, uint32_t *msToReachTheMode) { return HasReturnvaluesIF::RETURN_OK; @@ -539,23 +560,6 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_ } } -ReturnValue_t CoreController::initializeAfterTaskCreation() { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - if(BLOCKING_SD_INIT) { - ReturnValue_t result = initSdCardBlocking(); - if(result != HasReturnvaluesIF::RETURN_OK and result != SdCardManager::ALREADY_MOUNTED) { - sif::warning << "CoreController::CoreController: SD card init failed" << std::endl; - } - } - sdStateMachine(); - result = initVersionFile(); - if(result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "CoreController::initialize: Version initialization failed" << std::endl; - } - initPrint(); - return result; -} - ReturnValue_t CoreController::sdColdRedundantBlockingInit() { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; @@ -614,7 +618,7 @@ ReturnValue_t CoreController::initVersionFile() { std::to_string(FSFW_SUBVERSION) + "." + std::to_string(FSFW_REVISION); std::string systemString = "System: " + unameLine; std::string mountPrefix = SdCardManager::instance()->getCurrentMountPrefix(); - std::string versionFilePath = mountPrefix + "/conf/version.txt"; + std::string versionFilePath = mountPrefix + VERSION_FILE; std::fstream versionFile; if(not std::filesystem::exists(versionFilePath)) { @@ -731,32 +735,31 @@ ReturnValue_t CoreController::actionListDirectoryIntoFile(ActionId_t actionId, } ReturnValue_t CoreController::initBootCopy() { - std::string fileName = "/tmp/curr_copy.txt"; - if(not std::filesystem::exists(fileName)) { + if(not std::filesystem::exists(CURR_COPY_FILE)) { // Thils file is created by the systemd service eive-early-config so this should // not happen normally - std::string cmd = "xsc_boot_copy > " + fileName; + std::string cmd = "xsc_boot_copy > " + std::string(CURR_COPY_FILE); int result = std::system(cmd.c_str()); if(result != 0) { utility::handleSystemError(result, "CoreController::initBootCopy"); } } - std::ifstream file(fileName); + std::ifstream file(CURR_COPY_FILE); std::string line; std::getline(file, line); std::istringstream iss(line); int value = 0; iss >> value; - currentChip = static_cast(value); + CURRENT_CHIP = static_cast(value); iss >> value; - currentCopy = static_cast(value); + CURRENT_COPY = static_cast(value); return HasReturnvaluesIF::RETURN_OK; } void CoreController::getCurrentBootCopy(Chip &chip, Copy ©) { // Not really thread-safe but it does not need to be - chip = currentChip; - copy = currentCopy; + chip = CURRENT_CHIP; + copy = CURRENT_COPY; } ReturnValue_t CoreController::initWatchdogFifo() { @@ -795,6 +798,7 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si return HasActionsIF::INVALID_PARAMETERS; } bool rebootSameBootCopy = data[0]; + bool protOpPerformed; if(rebootSameBootCopy) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "CoreController::actionPerformReboot: Rebooting on current image" << std::endl; @@ -802,6 +806,12 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si // Attempt graceful shutdown by unmounting and switching off SD cards SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_0); SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_1); + // If any boot copies are unprotected + ReturnValue_t retval = setBootCopyProtection(Chip::SELF_CHIP, Copy::SELF_COPY, + true, protOpPerformed, false); + if(retval == HasReturnvaluesIF::RETURN_OK and protOpPerformed) { + sif::info << "Running slot was writeprotected before reboot" << std::endl; + } int result = std::system("xsc_boot_copy -r"); if(result != 0) { utility::handleSystemError(result, "CoreController::executeAction"); @@ -816,6 +826,16 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si sif::info << "CoreController::actionPerformReboot: Rebooting on " << static_cast(data[1]) << " " << static_cast(data[2]) << std::endl; #endif + + // Check that the target chip and copy is writeprotected first + generateChipStateFile(); + // If any boot copies are unprotected, protect them here + ReturnValue_t retval = setBootCopyProtection(static_cast(data[1]), + static_cast(data[2]), true, protOpPerformed, false); + if(retval == HasReturnvaluesIF::RETURN_OK and protOpPerformed) { + sif::info << "Target slot was writeprotected before reboot" << std::endl; + } + // The second byte in data is the target chip, the third byte is the target copy std::string cmdString = "xsc_boot_copy " + std::to_string(data[1]) + " " + std::to_string(data[2]); @@ -873,6 +893,250 @@ bool CoreController::sdInitFinished() const { return sdInfo.initFinished; } +ReturnValue_t CoreController::generateChipStateFile() { + int result = std::system(CHIP_PROT_SCRIPT); + if(result != 0) { + utility::handleSystemError(result, "CoreController::generateChipStateFile"); + return HasReturnvaluesIF::RETURN_FAILED; + } + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t CoreController::setBootCopyProtection(Chip targetChip, Copy targetCopy, + bool protect, bool& protOperationPerformed, bool updateProtFile) { + bool allChips = false; + bool allCopies = false; + bool selfChip = false; + bool selfCopy = false; + protOperationPerformed = false; + + switch(targetChip) { + case(Chip::ALL_CHIP): { + allChips = true; + break; + } + case(Chip::NO_CHIP): { + return HasReturnvaluesIF::RETURN_OK; + } + case(Chip::SELF_CHIP): { + selfChip = true; + targetChip = CURRENT_CHIP; + break; + } + default: { + break; + } + } + switch(targetCopy) { + case(Copy::ALL_COPY): { + allCopies = true; + break; + } + case(Copy::NO_COPY): { + return HasReturnvaluesIF::RETURN_OK; + } + case(Copy::SELF_COPY): { + selfCopy = true; + targetCopy = CURRENT_COPY; + break; + } + default: { + break; + } + } + + for(uint8_t arrIdx = 0; arrIdx < protArray.size(); arrIdx++) { + int result = handleBootCopyProtAtIndex(targetChip, targetCopy, protect, + protOperationPerformed, selfChip, selfCopy, allChips, allCopies, arrIdx); + if(result != 0) { + break; + } + } + if(protOperationPerformed and updateProtFile) { + updateProtInfo(); + } + return HasReturnvaluesIF::RETURN_OK; +} + +int CoreController::handleBootCopyProtAtIndex(Chip targetChip, Copy targetCopy, bool protect, + bool &protOperationPerformed, bool selfChip, bool selfCopy, bool allChips, + bool allCopies, uint8_t arrIdx) { + bool currentProt = protArray[arrIdx]; + std::ostringstream oss; + bool performOp = false; + if(protect == currentProt) { + return 0; + } + if(protOperationPerformed) { + if((selfChip and selfCopy) or (not allCopies and not allChips)) { + // No need to continue, only one operation was requested + return 1; + } + } + Chip currentChip; + Copy currentCopy; + oss << "writeprotect "; + if(arrIdx == 0 or arrIdx == 1) { + oss << "0 "; + currentChip = Chip::CHIP_0; + } + else { + oss << "1 "; + currentChip = Chip::CHIP_1; + } + if(arrIdx == 0 or arrIdx == 2) { + oss << "0 "; + currentCopy = Copy::COPY_0; + } + else { + oss << "1 "; + currentCopy = Copy::COPY_1; + } + if(protect) { + oss << "1"; + } + else { + oss << "0"; + } + + int result = 0; + if(allChips and allCopies) { + performOp = true; + } + else if(allChips) { + if((selfCopy and CURRENT_COPY == targetCopy) or + (currentCopy == targetCopy)) { + performOp = true; + } + } + else if(allCopies) { + if((selfChip and CURRENT_COPY == targetCopy) or + (currentChip == targetChip)) { + performOp = true; + } + } + else if(selfChip and (currentChip == targetChip)) { + if(selfCopy) { + if(currentCopy == targetCopy) { + performOp = true; + } + } + else { + performOp = true; + } + + } + else if(selfCopy and (currentCopy == targetCopy)) { + if(selfChip) { + if(currentChip == targetChip) { + performOp = true; + } + } + else { + performOp = true; + } + } + else if((targetChip == currentChip) and (targetCopy == currentCopy)) { + performOp = true; + } + if(result != 0) { + utility::handleSystemError(result, "CoreController::checkAndSetBootCopyProtection"); + } + if(performOp) { + // TODO: Lock operation take a long time. Use command executor? That would require a + // new state machine.. + protOperationPerformed = true; + sif::info << "Executing command: " << oss.str() << std::endl; + result = std::system(oss.str().c_str()); + } + return 0; +} + +ReturnValue_t CoreController::updateProtInfo(bool regenerateChipStateFile) { + using namespace std; + ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + if(regenerateChipStateFile) { + result = generateChipStateFile(); + if(result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "CoreController::updateProtInfo: Generating chip state file failed" << + std::endl; + return result; + } + } + if(not filesystem::exists(CHIP_STATE_FILE)) { + return HasReturnvaluesIF::RETURN_FAILED; + } + ifstream chipStateFile(CHIP_STATE_FILE); + if(not chipStateFile.good()) { + return HasReturnvaluesIF::RETURN_FAILED; + } + string nextLine; + uint8_t lineCounter = 0; + string word; + while(getline(chipStateFile, nextLine)) { + ReturnValue_t result = handleProtInfoUpdateLine(nextLine); + if(result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "CoreController::updateProtInfo: Protection info update failed!" << + std::endl; + return result; + } + ++lineCounter; + if(lineCounter > 4) { + sif::warning << "CoreController::checkAndProtectBootCopy: " + "Line counter larger than 4" << std::endl; + } + } + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t CoreController::handleProtInfoUpdateLine(std::string nextLine) { + using namespace std; + string word; + uint8_t wordIdx = 0; + uint8_t arrayIdx = 0; + istringstream iss(nextLine); + Chip currentChip; + Copy currentCopy; + while(iss >> word) { + if(wordIdx == 1) { + currentChip = static_cast(stoi(word)); + } + if(wordIdx == 3) { + currentCopy = static_cast(stoi(word)); + } + + if(wordIdx == 3) { + if(currentChip == Chip::CHIP_0) { + if(currentCopy == Copy::COPY_0) { + arrayIdx = 0; + } + else if(currentCopy == Copy::COPY_1) { + arrayIdx = 1; + } + } + + else if(currentChip == Chip::CHIP_1) { + if(currentCopy == Copy::COPY_0) { + arrayIdx = 2; + } + else if(currentCopy == Copy::COPY_1) { + arrayIdx = 3; + } + } + } + if(wordIdx == 5) { + if(word == "unlocked.") { + protArray[arrayIdx] = false; + } + else { + protArray[arrayIdx] = true; + } + } + wordIdx++; + } + return HasReturnvaluesIF::RETURN_OK; +} + void CoreController::performWatchdogControlOperation() { // Only perform each fifth iteration if(watchdogFifoFd != 0 and opDivider.checkAndIncrement()) { diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index b26c99c5..74702441 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -16,17 +16,28 @@ public: enum Chip: uint8_t { CHIP_0, CHIP_1, - NO_CHIP + NO_CHIP, + SELF_CHIP, + ALL_CHIP }; enum Copy: uint8_t { COPY_0, COPY_1, - NO_COPY + NO_COPY, + SELF_COPY, + ALL_COPY }; + static constexpr char CHIP_PROT_SCRIPT[] = "/home/root/scripts/get-chip-prot-status.sh"; + static constexpr char CHIP_STATE_FILE[] = "/tmp/chip_prot_status.txt"; + static constexpr char CURR_COPY_FILE[] = "/tmp/curr_copy.txt"; + static constexpr char VERSION_FILE[] = "/conf/sd_status"; + static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0; static constexpr ActionId_t REBOOT_OBC = 32; + static constexpr ActionId_t MOUNT_OTHER_COPY = 33; + static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::CORE; @@ -46,19 +57,39 @@ public: ReturnValue_t handleCommandMessage(CommandMessage *message) override; void performControlOperation() override; + /** + * Generate a file containing the chip lock/unlock states inside /tmp/chip_prot_status.txt + * @return + */ + static ReturnValue_t generateChipStateFile(); static ReturnValue_t incrementAllocationFailureCount(); static void getCurrentBootCopy(Chip& chip, Copy& copy); + + ReturnValue_t updateProtInfo(bool regenerateChipStateFile = true); + + /** + * Checks whether the target chip and copy are write protected and protect set them to a target + * state where applicable. + * @param targetChip + * @param targetCopy + * @param protect Target state + * @param protOperationPerformed [out] Can be used to determine whether any operation + * was performed + * @param updateProtFile Specify whether the protection info file is updated + * @return + */ + ReturnValue_t setBootCopyProtection(Chip targetChip, Copy targetCopy, + bool protect, bool& protOperationPerformed, bool updateProtFile = true); + bool sdInitFinished() const; private: - static Chip currentChip; - static Copy currentCopy; + static Chip CURRENT_CHIP; + static Copy CURRENT_COPY; - ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, - LocalDataPoolManager& poolManager) override; - LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; - ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, - uint32_t *msToReachTheMode); + // Designated value for rechecking FIFO open + static constexpr int RETRY_FIFO_OPEN = -2; + int watchdogFifoFd = 0; // States for SD state machine, which is used in non-blocking mode enum class SdStates { @@ -85,9 +116,6 @@ private: SdCardManager* sdcMan = nullptr; - ReturnValue_t initSdCardBlocking(); - ReturnValue_t sdStateMachine(); - struct SdInfo { sd::SdCard pref = sd::SdCard::NONE; sd::SdState prefState = sd::SdState::OFF; @@ -108,9 +136,30 @@ private: sd::SdCard commandedCard = sd::SdCard::NONE; sd::SdState commandedState = sd::SdState::OFF; }; - SdInfo sdInfo; + /** + * Index 0: Chip 0 Copy 0 + * Index 1: Chip 0 Copy 1 + * Index 2: Chip 1 Copy 0 + * Index 3: Chip 1 Copy 1 + */ + std::array protArray; + PeriodicOperationDivider opDivider; + + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; + ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t *msToReachTheMode); + + ReturnValue_t initVersionFile(); + ReturnValue_t initBootCopy(); + ReturnValue_t initWatchdogFifo(); + ReturnValue_t initSdCardBlocking(); + void initPrint(); + + ReturnValue_t sdStateMachine(); void updateSdInfoOther(); ReturnValue_t sdCardSetup(sd::SdCard sdCard, sd::SdState targetState, std::string sdChar, bool printOutput = true); @@ -120,24 +169,16 @@ private: void executeNextExternalSdCommand(); void checkExternalSdCommandStatus(); - ReturnValue_t initVersionFile(); - ReturnValue_t initBootCopy(); - ReturnValue_t initWatchdogFifo(); - ReturnValue_t actionListDirectoryIntoFile(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t *data, size_t size); ReturnValue_t actionPerformReboot(const uint8_t *data, size_t size); - void initPrint(); - - // Designated value for rechecking FIFO open - static constexpr int RETRY_FIFO_OPEN = -2; - int watchdogFifoFd = 0; - - PeriodicOperationDivider opDivider; void performWatchdogControlOperation(); + + ReturnValue_t handleProtInfoUpdateLine(std::string nextLine); + int handleBootCopyProtAtIndex(Chip targetChip, Copy targetCopy, bool protect, + bool &protOperationPerformed, bool selfChip, bool selfCopy, bool allChips, + bool allCopies, uint8_t arrIdx); }; - - #endif /* BSP_Q7S_CORE_CORECONTROLLER_H_ */ diff --git a/bsp_q7s/spiCallbacks/rwSpiCallback.cpp b/bsp_q7s/spiCallbacks/rwSpiCallback.cpp index f05fbbdf..dce79c42 100644 --- a/bsp_q7s/spiCallbacks/rwSpiCallback.cpp +++ b/bsp_q7s/spiCallbacks/rwSpiCallback.cpp @@ -24,7 +24,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie *cookie, const uint8_t *sen int fileDescriptor = 0; std::string device = cookie->getSpiDevice(); - UnixFileGuard fileHelper(device, &fileDescriptor, O_RDWR, "rwSpiCallback::spiCallback: "); + UnixFileGuard fileHelper(device, &fileDescriptor, O_RDWR, "rwSpiCallback::spiCallback"); if(fileHelper.getOpenResult() != HasReturnvaluesIF::RETURN_OK) { sif::error << "rwSpiCallback::spiCallback: Failed to open device file" << std::endl; return SpiComIF::OPENING_FILE_FAILED; diff --git a/fsfw b/fsfw index 1183e573..882da68a 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 1183e5739d73da42978e0ab3218b3ca53fff4489 +Subproject commit 882da68a2f0c1301d433d517c449c9c31f3cb35e diff --git a/linux/boardtest/SpiTestClass.cpp b/linux/boardtest/SpiTestClass.cpp index 290318a2..f3ba3279 100644 --- a/linux/boardtest/SpiTestClass.cpp +++ b/linux/boardtest/SpiTestClass.cpp @@ -85,7 +85,7 @@ void SpiTestClass::performRm3100Test(uint8_t mgmId) { UnixFileGuard fileHelper(deviceName, &fileDescriptor, O_RDWR, - "SpiComIF::initializeInterface: "); + "SpiComIF::initializeInterface"); if(fileHelper.getOpenResult()) { sif::error << "SpiTestClass::performRm3100Test: File descriptor could not be opened!" << std::endl; @@ -184,7 +184,7 @@ void SpiTestClass::performLis3MdlTest(uint8_t lis3Id) { int fileDescriptor = 0; UnixFileGuard fileHelper(deviceName, &fileDescriptor, O_RDWR, - "SpiComIF::initializeInterface: "); + "SpiComIF::initializeInterface"); if(fileHelper.getOpenResult()) { sif::error << "SpiTestClass::performLis3Mdl3100Test: File descriptor could not be opened!" << std::endl; @@ -235,7 +235,7 @@ void SpiTestClass::performL3gTest(uint8_t l3gId) { int fileDescriptor = 0; UnixFileGuard fileHelper(deviceName, &fileDescriptor, O_RDWR, - "SpiComIF::initializeInterface: "); + "SpiComIF::initializeInterface"); if(fileHelper.getOpenResult()) { sif::error << "SpiTestClass::performLis3Mdl3100Test: File descriptor could not be opened!" << std::endl; diff --git a/mission/devices/GyroADIS16507Handler.cpp b/mission/devices/GyroADIS16507Handler.cpp index 3065c249..2034d6a2 100644 --- a/mission/devices/GyroADIS16507Handler.cpp +++ b/mission/devices/GyroADIS16507Handler.cpp @@ -393,7 +393,7 @@ ReturnValue_t GyroADIS16507Handler::spiSendCallback(SpiComIF *comIf, SpiCookie * // Prepare transfer int fileDescriptor = 0; std::string device = cookie->getSpiDevice(); - UnixFileGuard fileHelper(device, &fileDescriptor, O_RDWR, "SpiComIF::sendMessage: "); + UnixFileGuard fileHelper(device, &fileDescriptor, O_RDWR, "SpiComIF::sendMessage"); if(fileHelper.getOpenResult() != HasReturnvaluesIF::RETURN_OK) { return SpiComIF::OPENING_FILE_FAILED; } diff --git a/tmtc b/tmtc index 261eef44..a7f1ed90 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 261eef449e309549644d8566c8d1034c5696335d +Subproject commit a7f1ed904c460005c6d22f17ab496694ae150046