TCP default now, bugfixes in CoreController
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2021-08-03 15:29:45 +02:00
parent 59c4ed74e0
commit 3cc3786505
8 changed files with 26 additions and 16 deletions

View File

@ -23,8 +23,8 @@ CoreController::Chip CoreController::currentChip = Chip::NO_CHIP;
CoreController::Copy CoreController::currentCopy = 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();
@ -49,7 +49,7 @@ CoreController::CoreController(object_id_t objectId):
}
ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) {
return HasReturnvaluesIF::RETURN_OK;
return ExtendedControllerBase::handleCommandMessage(message);
}
void CoreController::performControlOperation() {
@ -74,7 +74,7 @@ ReturnValue_t CoreController::initialize() {
"count failed" << std::endl;
}
return HasReturnvaluesIF::RETURN_OK;
return ExtendedControllerBase::initialize();
}
ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode,
@ -462,6 +462,12 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si
}
bool rebootSameBootCopy = data[0];
if(rebootSameBootCopy) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "CoreController::actionPerformReboot: Rebooting on current image" << std::endl;
#endif
// Attempt graceful shutdown by unmounting and switching off SD cards
SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_0);
SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_1);
int result = std::system("xsc_boot_copy -r");
if(result != 0) {
utility::handleSystemError(result, "CoreController::executeAction");
@ -472,6 +478,10 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si
if(size < 3) {
return HasActionsIF::INVALID_PARAMETERS;
}
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "CoreController::actionPerformReboot: Rebooting on " <<
static_cast<int>(data[1]) << " " << static_cast<int>(data[2]) << std::endl;
#endif
// 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]);