all retval replacements
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
@ -33,10 +33,10 @@ CoreController::CoreController(object_id_t objectId)
|
||||
opDivider5(5),
|
||||
opDivider10(10),
|
||||
hkSet(this) {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
try {
|
||||
result = initWatchdogFifo();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "CoreController::CoreController: Watchdog FIFO init failed" << std::endl;
|
||||
}
|
||||
sdcMan = SdCardManager::instance();
|
||||
@ -50,7 +50,7 @@ CoreController::CoreController(object_id_t objectId)
|
||||
sdStateMachine();
|
||||
|
||||
result = initBootCopy();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "CoreController::CoreController: Boot copy init" << std::endl;
|
||||
}
|
||||
} catch (const std::filesystem::filesystem_error &e) {
|
||||
@ -66,7 +66,7 @@ ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) {
|
||||
|
||||
void CoreController::performControlOperation() {
|
||||
EventMessage event;
|
||||
for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == RETURN_OK;
|
||||
for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == returnvalue::OK;
|
||||
result = eventQueue->receiveMessage(&event)) {
|
||||
switch (event.getEvent()) {
|
||||
case (GpsHyperion::GPS_FIX_CHANGE): {
|
||||
@ -93,7 +93,7 @@ ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &local
|
||||
localDataPoolMap.emplace(core::PS_VOLTAGE, new PoolEntry<float>({0}));
|
||||
localDataPoolMap.emplace(core::PL_VOLTAGE, new PoolEntry<float>({0}));
|
||||
poolManager.subscribeForRegularPeriodicPacket({hkSet.getSid(), false, 10.0});
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
LocalPoolDataSetBase *CoreController::getDataSetHandle(sid_t sid) {
|
||||
@ -105,11 +105,11 @@ LocalPoolDataSetBase *CoreController::getDataSetHandle(sid_t sid) {
|
||||
|
||||
ReturnValue_t CoreController::initialize() {
|
||||
ReturnValue_t result = ExtendedControllerBase::initialize();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "CoreController::initialize: Base init failed" << std::endl;
|
||||
}
|
||||
result = scratch::writeNumber(scratch::ALLOC_FAILURE_COUNT, 0);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "CoreController::initialize: Setting up alloc failure "
|
||||
"count failed"
|
||||
<< std::endl;
|
||||
@ -126,31 +126,31 @@ ReturnValue_t CoreController::initialize() {
|
||||
<< std::endl;
|
||||
}
|
||||
result = eventManager->registerListener(eventQueue->getId());
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "CoreController::initialize: Registering as event listener failed" << std::endl;
|
||||
}
|
||||
result = eventManager->subscribeToEvent(eventQueue->getId(),
|
||||
event::getEventId(GpsHyperion::GPS_FIX_CHANGE));
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "Subscribing for GPS GPS_FIX_CHANGE event failed" << std::endl;
|
||||
}
|
||||
return RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::initializeAfterTaskCreation() {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
sdInfo.pref = sdcMan->getPreferredSdCard();
|
||||
sdcMan->setActiveSdCard(sdInfo.pref);
|
||||
currMntPrefix = sdcMan->getCurrentMountPrefix();
|
||||
if (BLOCKING_SD_INIT) {
|
||||
ReturnValue_t result = initSdCardBlocking();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK and result != SdCardManager::ALREADY_MOUNTED) {
|
||||
if (result != returnvalue::OK and result != SdCardManager::ALREADY_MOUNTED) {
|
||||
sif::warning << "CoreController::CoreController: SD card init failed" << std::endl;
|
||||
}
|
||||
}
|
||||
sdStateMachine();
|
||||
performMountedSdCardOperations();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "CoreController::initialize: Version initialization failed" << std::endl;
|
||||
}
|
||||
// Add script folder to path
|
||||
@ -236,22 +236,22 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
|
||||
|
||||
ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode,
|
||||
uint32_t *msToReachTheMode) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::initSdCardBlocking() {
|
||||
// Create update status file
|
||||
ReturnValue_t result = sdcMan->updateSdCardStateFile();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "CoreController::initialize: Updating SD card state file failed" << std::endl;
|
||||
}
|
||||
#if Q7S_SD_CARD_CONFIG == Q7S_SD_NONE
|
||||
sif::info << "No SD card initialization will be performed" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
#else
|
||||
|
||||
result = sdcMan->getSdCardsStatus(sdInfo.currentState);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "Getting SD card activity status failed" << std::endl;
|
||||
}
|
||||
|
||||
@ -269,14 +269,14 @@ ReturnValue_t CoreController::initSdCardBlocking() {
|
||||
sdCardSetup(sd::SdCard::SLOT_1, sd::SdState::MOUNTED, "1", false);
|
||||
// Update status file
|
||||
sdcMan->updateSdCardStateFile();
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
#endif
|
||||
|
||||
#endif /* Q7S_SD_CARD_CONFIG != Q7S_SD_NONE */
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::sdStateMachine() {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
SdCardManager::Operations operation;
|
||||
|
||||
if (sdInfo.state == SdStates::IDLE) {
|
||||
@ -324,7 +324,7 @@ ReturnValue_t CoreController::sdStateMachine() {
|
||||
if (not sdInfo.commandExecuted) {
|
||||
// Create update status file
|
||||
result = sdcMan->updateSdCardStateFile();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "CoreController::initialize: Updating SD card state file failed"
|
||||
<< std::endl;
|
||||
}
|
||||
@ -343,7 +343,7 @@ ReturnValue_t CoreController::sdStateMachine() {
|
||||
sif::warning << "Preferred SD card invalid. Setting to card 0.." << std::endl;
|
||||
sdInfo.pref = sd::SdCard::SLOT_0;
|
||||
}
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "Getting SD card activity status failed" << std::endl;
|
||||
}
|
||||
#if Q7S_SD_CARD_CONFIG == Q7S_SD_COLD_REDUNDANT
|
||||
@ -473,7 +473,7 @@ ReturnValue_t CoreController::sdStateMachine() {
|
||||
sdcMan->setBlocking(true);
|
||||
// Update status file
|
||||
result = sdcMan->updateSdCardStateFile();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "CoreController::initialize: Updating SD card state file failed" << std::endl;
|
||||
}
|
||||
sdInfo.commandExecuted = false;
|
||||
@ -497,7 +497,7 @@ ReturnValue_t CoreController::sdStateMachine() {
|
||||
}
|
||||
|
||||
sdInfo.cycleCount++;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void CoreController::executeNextExternalSdCommand() {
|
||||
@ -628,28 +628,28 @@ ReturnValue_t CoreController::sdCardSetup(sd::SdCard sdCard, sd::SdState targetS
|
||||
} else {
|
||||
sif::warning << "CoreController::sdCardSetup: Invalid state for this call" << std::endl;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::sdColdRedundantBlockingInit() {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
|
||||
result = sdCardSetup(sdInfo.pref, sd::SdState::MOUNTED, sdInfo.prefChar);
|
||||
if (result != SdCardManager::ALREADY_MOUNTED and result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != SdCardManager::ALREADY_MOUNTED and result != returnvalue::OK) {
|
||||
sif::warning << "Setting up preferred card " << sdInfo.otherChar
|
||||
<< " in cold redundant mode failed" << std::endl;
|
||||
// Try other SD card and mark set up operation as failed
|
||||
sdCardSetup(sdInfo.pref, sd::SdState::MOUNTED, sdInfo.prefChar);
|
||||
result = HasReturnvaluesIF::RETURN_FAILED;
|
||||
result = returnvalue::FAILED;
|
||||
}
|
||||
|
||||
if (result != HasReturnvaluesIF::RETURN_FAILED and sdInfo.otherState != sd::SdState::OFF) {
|
||||
if (result != returnvalue::FAILED and sdInfo.otherState != sd::SdState::OFF) {
|
||||
sif::info << "Switching off secondary SD card " << sdInfo.otherChar << std::endl;
|
||||
// Switch off other SD card in cold redundant mode if setting up preferred one worked
|
||||
// without issues
|
||||
ReturnValue_t result2 =
|
||||
sdcMan->switchOffSdCard(sdInfo.other, sdInfo.otherState, &sdInfo.currentState);
|
||||
if (result2 != HasReturnvaluesIF::RETURN_OK and result2 != SdCardManager::ALREADY_OFF) {
|
||||
if (result2 != returnvalue::OK and result2 != SdCardManager::ALREADY_OFF) {
|
||||
sif::warning << "Switching off secondary SD card " << sdInfo.otherChar
|
||||
<< " in cold redundant mode failed" << std::endl;
|
||||
}
|
||||
@ -660,7 +660,7 @@ ReturnValue_t CoreController::sdColdRedundantBlockingInit() {
|
||||
ReturnValue_t CoreController::incrementAllocationFailureCount() {
|
||||
uint32_t count = 0;
|
||||
ReturnValue_t result = scratch::readNumber(scratch::ALLOC_FAILURE_COUNT, count);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
count++;
|
||||
@ -698,7 +698,7 @@ ReturnValue_t CoreController::initVersionFile() {
|
||||
versionFile << fullObswVersionString << std::endl;
|
||||
versionFile << fullFsfwVersionString << std::endl;
|
||||
versionFile << systemString << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
// Check whether any version has changed
|
||||
@ -745,7 +745,7 @@ ReturnValue_t CoreController::initVersionFile() {
|
||||
versionFile << systemString << std::endl;
|
||||
}
|
||||
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::actionListDirectoryIntoFile(ActionId_t actionId,
|
||||
@ -800,7 +800,7 @@ ReturnValue_t CoreController::actionListDirectoryIntoFile(ActionId_t actionId,
|
||||
utility::handleSystemError(result, "CoreController::actionListDirectoryIntoFile");
|
||||
actionHelper.finish(false, commandedBy, actionId);
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::initBootCopy() {
|
||||
@ -815,7 +815,7 @@ ReturnValue_t CoreController::initBootCopy() {
|
||||
}
|
||||
|
||||
getCurrentBootCopy(CURRENT_CHIP, CURRENT_COPY);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void CoreController::getCurrentBootCopy(xsc::Chip &chip, xsc::Copy ©) {
|
||||
@ -829,10 +829,10 @@ void CoreController::getCurrentBootCopy(xsc::Chip &chip, xsc::Copy ©) {
|
||||
|
||||
ReturnValue_t CoreController::initWatchdogFifo() {
|
||||
if (not std::filesystem::exists(watchdog::FIFO_NAME)) {
|
||||
// Still return RETURN_OK for now
|
||||
// Still return returnvalue::OK for now
|
||||
sif::info << "Watchdog FIFO " << watchdog::FIFO_NAME << " does not exist, can't initiate"
|
||||
<< " watchdog" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
// Open FIFO write only and non-blocking to prevent SW from killing itself.
|
||||
watchdogFifoFd = open(watchdog::FIFO_NAME.c_str(), O_WRONLY | O_NONBLOCK);
|
||||
@ -843,10 +843,10 @@ ReturnValue_t CoreController::initWatchdogFifo() {
|
||||
} else {
|
||||
sif::error << "Opening pipe " << watchdog::FIFO_NAME << " write-only failed with " << errno
|
||||
<< ": " << strerror(errno) << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void CoreController::initPrint() {
|
||||
@ -872,7 +872,7 @@ ReturnValue_t CoreController::actionXscReboot(const uint8_t *data, size_t size)
|
||||
int result = std::system("xsc_boot_copy -r");
|
||||
if (result != 0) {
|
||||
utility::handleSystemError(result, "CoreController::executeAction");
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
return HasActionsIF::EXECUTION_FINISHED;
|
||||
}
|
||||
@ -929,14 +929,14 @@ ReturnValue_t CoreController::actionXscReboot(const uint8_t *data, size_t size)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::actionReboot(const uint8_t *data, size_t size) {
|
||||
bool protOpPerformed = false;
|
||||
gracefulShutdownTasks(xsc::Chip::CHIP_0, xsc::Copy::COPY_0, protOpPerformed);
|
||||
std::system("reboot");
|
||||
return RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::gracefulShutdownTasks(xsc::Chip chip, xsc::Copy copy,
|
||||
@ -948,7 +948,7 @@ ReturnValue_t CoreController::gracefulShutdownTasks(xsc::Chip chip, xsc::Copy co
|
||||
// If any boot copies are unprotected
|
||||
ReturnValue_t result = setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, true,
|
||||
protOpPerformed, false);
|
||||
if (result == HasReturnvaluesIF::RETURN_OK and protOpPerformed) {
|
||||
if (result == returnvalue::OK and protOpPerformed) {
|
||||
// TODO: Would be nice to notify operator. But we can't use the filesystem anymore
|
||||
// and a reboot is imminent. Use scratch buffer?
|
||||
sif::info << "Running slot was writeprotected before reboot" << std::endl;
|
||||
@ -983,9 +983,9 @@ ReturnValue_t CoreController::generateChipStateFile() {
|
||||
int result = std::system(CHIP_PROT_SCRIPT);
|
||||
if (result != 0) {
|
||||
utility::handleSystemError(result, "CoreController::generateChipStateFile");
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::setBootCopyProtection(xsc::Chip targetChip, xsc::Copy targetCopy,
|
||||
@ -1003,7 +1003,7 @@ ReturnValue_t CoreController::setBootCopyProtection(xsc::Chip targetChip, xsc::C
|
||||
break;
|
||||
}
|
||||
case (xsc::Chip::NO_CHIP): {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
case (xsc::Chip::SELF_CHIP): {
|
||||
selfChip = true;
|
||||
@ -1020,7 +1020,7 @@ ReturnValue_t CoreController::setBootCopyProtection(xsc::Chip targetChip, xsc::C
|
||||
break;
|
||||
}
|
||||
case (xsc::Copy::NO_COPY): {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
case (xsc::Copy::SELF_COPY): {
|
||||
selfCopy = true;
|
||||
@ -1042,7 +1042,7 @@ ReturnValue_t CoreController::setBootCopyProtection(xsc::Chip targetChip, xsc::C
|
||||
if (protOperationPerformed and updateProtFile) {
|
||||
updateProtInfo();
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
int CoreController::handleBootCopyProtAtIndex(xsc::Chip targetChip, xsc::Copy targetCopy,
|
||||
@ -1130,28 +1130,28 @@ int CoreController::handleBootCopyProtAtIndex(xsc::Chip targetChip, xsc::Copy ta
|
||||
|
||||
ReturnValue_t CoreController::updateProtInfo(bool regenerateChipStateFile) {
|
||||
using namespace std;
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
if (regenerateChipStateFile) {
|
||||
result = generateChipStateFile();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::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;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
ifstream chipStateFile(CHIP_STATE_FILE);
|
||||
if (not chipStateFile.good()) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
string nextLine;
|
||||
uint8_t lineCounter = 0;
|
||||
string word;
|
||||
while (getline(chipStateFile, nextLine)) {
|
||||
ReturnValue_t result = handleProtInfoUpdateLine(nextLine);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "CoreController::updateProtInfo: Protection info update failed!" << std::endl;
|
||||
return result;
|
||||
}
|
||||
@ -1162,7 +1162,7 @@ ReturnValue_t CoreController::updateProtInfo(bool regenerateChipStateFile) {
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::handleProtInfoUpdateLine(std::string nextLine) {
|
||||
@ -1207,7 +1207,7 @@ ReturnValue_t CoreController::handleProtInfoUpdateLine(std::string nextLine) {
|
||||
}
|
||||
wordIdx++;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void CoreController::performWatchdogControlOperation() {
|
||||
@ -1274,7 +1274,7 @@ ReturnValue_t CoreController::performSdCardCheck() {
|
||||
sdcMan->getSdCardsStatus(active);
|
||||
auto sdCardCheck = [&](sd::SdCard sdCard) {
|
||||
ReturnValue_t result = sdcMan->isSdCardMountedReadOnly(sdCard, mountedReadOnly);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::error << "CoreController::performSdCardCheck: Could not check "
|
||||
"read-only mount state"
|
||||
<< std::endl;
|
||||
@ -1283,13 +1283,13 @@ ReturnValue_t CoreController::performSdCardCheck() {
|
||||
if (mountedReadOnly) {
|
||||
int linuxErrno = 0;
|
||||
result = sdcMan->performFsck(sdCard, true, linuxErrno);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
sif::error << "CoreController::performSdCardCheck: fsck command on SD Card "
|
||||
<< static_cast<uint8_t>(sdCard) << " failed with code " << linuxErrno << " | "
|
||||
<< strerror(linuxErrno);
|
||||
}
|
||||
result = sdcMan->remountReadWrite(sdCard);
|
||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == returnvalue::OK) {
|
||||
sif::warning << "CoreController::performSdCardCheck: Remounted SD Card "
|
||||
<< static_cast<uint8_t>(sdCard) << " read-write";
|
||||
} else {
|
||||
@ -1305,7 +1305,7 @@ ReturnValue_t CoreController::performSdCardCheck() {
|
||||
sdCardCheck(sd::SdCard::SLOT_1);
|
||||
}
|
||||
|
||||
return RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void CoreController::performRebootFileHandling(bool recreateFile) {
|
||||
@ -1759,7 +1759,7 @@ ReturnValue_t CoreController::timeFileHandler() {
|
||||
// It is assumed that the system time is set from the GPS time
|
||||
timeval currentTime = {};
|
||||
ReturnValue_t result = Clock::getClock_timeval(¤tTime);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
std::string fileName = currMntPrefix + TIME_FILE;
|
||||
@ -1767,11 +1767,11 @@ ReturnValue_t CoreController::timeFileHandler() {
|
||||
if (not timeFile.good()) {
|
||||
sif::error << "CoreController::timeFileHandler: Error opening time file: " << strerror(errno)
|
||||
<< std::endl;
|
||||
return RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
timeFile << "UNIX SECONDS: " << currentTime.tv_sec << std::endl;
|
||||
}
|
||||
return RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::initClockFromTimeFile() {
|
||||
@ -1787,18 +1787,18 @@ ReturnValue_t CoreController::initClockFromTimeFile() {
|
||||
istringstream iss(nextWord);
|
||||
iss >> nextWord;
|
||||
if (iss.bad() or nextWord != "UNIX") {
|
||||
return RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
iss >> nextWord;
|
||||
if (iss.bad() or nextWord != "SECONDS:") {
|
||||
return RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
iss >> nextWord;
|
||||
timeval currentTime = {};
|
||||
char *checkPtr;
|
||||
currentTime.tv_sec = strtol(nextWord.c_str(), &checkPtr, 10);
|
||||
if (iss.bad() or *checkPtr) {
|
||||
return RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
time_t timeRaw = currentTime.tv_sec;
|
||||
@ -1808,30 +1808,30 @@ ReturnValue_t CoreController::initClockFromTimeFile() {
|
||||
#endif
|
||||
return Clock::setClock(¤tTime);
|
||||
}
|
||||
return RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void CoreController::readHkData() {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
result = hkSet.read(TIMEOUT_TYPE, MUTEX_TIMEOUT);
|
||||
if (result != RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return;
|
||||
}
|
||||
Xadc xadc;
|
||||
result = xadc.getTemperature(hkSet.temperature.value);
|
||||
if (result != RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
hkSet.temperature.setValid(false);
|
||||
} else {
|
||||
hkSet.temperature.setValid(true);
|
||||
}
|
||||
result = xadc.getVccPint(hkSet.psVoltage.value);
|
||||
if (result != RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
hkSet.psVoltage.setValid(false);
|
||||
} else {
|
||||
hkSet.psVoltage.setValid(true);
|
||||
}
|
||||
result = xadc.getVccInt(hkSet.plVoltage.value);
|
||||
if (result != RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
hkSet.plVoltage.setValid(false);
|
||||
} else {
|
||||
hkSet.plVoltage.setValid(true);
|
||||
@ -1840,7 +1840,7 @@ void CoreController::readHkData() {
|
||||
hkSet.printSet();
|
||||
#endif /* OBSW_PRINT_CORE_HK == 1 */
|
||||
result = hkSet.commit(TIMEOUT_TYPE, MUTEX_TIMEOUT);
|
||||
if (result != RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user