changes in supervisor commands
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:
@ -259,6 +259,26 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d
|
||||
nextReplyId = supv::ACK_REPORT;
|
||||
result = RETURN_OK;
|
||||
break;
|
||||
case (supv::PREPARE_UPDATE): {
|
||||
prepareEmptyCmd(supv::APID_PREPARE_UPDATE);
|
||||
result = RETURN_OK;
|
||||
break;
|
||||
}
|
||||
case (supv::START_MPSOC_QUIET): {
|
||||
prepareEmptyCmd(supv::APID_START_MPSOC_QUIET);
|
||||
result = RETURN_OK;
|
||||
break;
|
||||
}
|
||||
case (supv::SET_SHUTDOWN_TIMEOUT): {
|
||||
prepareSetShutdownTimeoutCmd(commandData);
|
||||
result = RETURN_OK;
|
||||
break;
|
||||
}
|
||||
case (supv::FACTORY_FLASH): {
|
||||
prepareEmptyCmd(supv::APID_FACTORY_FLASH);
|
||||
result = RETURN_OK;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
sif::debug << "PlocSupervisorHandler::buildCommandFromCommand: Command not implemented"
|
||||
<< std::endl;
|
||||
@ -317,6 +337,10 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() {
|
||||
this->insertInCommandMap(supv::FACTORY_RESET_CLEAR_MIRROR);
|
||||
this->insertInCommandMap(supv::FACTORY_RESET_CLEAR_CIRCULAR);
|
||||
this->insertInCommandMap(supv::CAN_LOOPBACK_TEST);
|
||||
this->insertInCommandMap(supv::PREPARE_UPDATE);
|
||||
this->insertInCommandMap(supv::START_MPSOC_QUIET);
|
||||
this->insertInCommandMap(supv::SET_SHUTDOWN_TIMEOUT);
|
||||
this->insertInCommandMap(supv::FACTORY_FLASH);
|
||||
this->insertInCommandAndReplyMap(supv::FIRST_MRAM_DUMP, 3);
|
||||
this->insertInCommandAndReplyMap(supv::CONSECUTIVE_MRAM_DUMP, 3);
|
||||
this->insertInReplyMap(supv::ACK_REPORT, 3, nullptr, supv::SIZE_ACK_REPORT);
|
||||
@ -445,7 +469,7 @@ ReturnValue_t PlocSupervisorHandler::initializeLocalDataPool(localpool::DataPool
|
||||
localDataPoolMap.emplace(supv::MISSION_IO_STATE, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(supv::FMC_STATE, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::NUM_TCS, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::UPTIME, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::UPTIME, new PoolEntry<uint64_t>({0}));
|
||||
localDataPoolMap.emplace(supv::CPULOAD, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::AVAILABLEHEAP, new PoolEntry<uint32_t>({0}));
|
||||
|
||||
@ -466,14 +490,13 @@ ReturnValue_t PlocSupervisorHandler::initializeLocalDataPool(localpool::DataPool
|
||||
localDataPoolMap.emplace(supv::CNT4, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(supv::CNT5, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(supv::CNT6, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_SEC, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_MIN, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_HOUR, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_DAY, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_MON, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_YEAR, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_MSEC, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_IS_SET, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_MSEC, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_SEC, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_MIN, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_HOUR, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_DAY, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_MON, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_YEAR, new PoolEntry<uint8_t>({0}));
|
||||
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
@ -575,6 +598,10 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
|
||||
case supv::FACTORY_RESET_CLEAR_CIRCULAR:
|
||||
case supv::REQUEST_LOGGING_DATA:
|
||||
case supv::DISABLE_PERIOIC_HK_TRANSMISSION:
|
||||
case supv::PREPARE_UPDATE:
|
||||
case supv::START_MPSOC_QUIET:
|
||||
case supv::SET_SHUTDOWN_TIMEOUT:
|
||||
case supv::FACTORY_FLASH:
|
||||
enabledReplies = 2;
|
||||
break;
|
||||
default:
|
||||
@ -722,9 +749,10 @@ ReturnValue_t PlocSupervisorHandler::handleHkReport(const uint8_t* data) {
|
||||
hkset.tempSup = *(data + offset) << 24 | *(data + offset + 1) << 16 | *(data + offset + 2) << 8 |
|
||||
*(data + offset + 3);
|
||||
offset += 4;
|
||||
hkset.uptime = *(data + offset) << 24 | *(data + offset + 1) << 16 | *(data + offset + 2) << 8 |
|
||||
*(data + offset + 3);
|
||||
offset += 4;
|
||||
size_t size = sizeof(hkset.uptime.value);
|
||||
result = SerializeAdapter::deSerialize(&hkset.uptime, data + offset, &size,
|
||||
SerializeIF::Endianness::BIG);
|
||||
offset += 8;
|
||||
hkset.cpuLoad = *(data + offset) << 24 | *(data + offset + 1) << 16 | *(data + offset + 2) << 8 |
|
||||
*(data + offset + 3);
|
||||
offset += 4;
|
||||
@ -806,6 +834,10 @@ ReturnValue_t PlocSupervisorHandler::handleBootStatusReport(const uint8_t* data)
|
||||
bootStatusReport.bp1State = *(data + offset);
|
||||
offset += 1;
|
||||
bootStatusReport.bp2State = *(data + offset);
|
||||
offset += 1;
|
||||
bootStatusReport.bootState = *(data + offset);
|
||||
offset += 1;
|
||||
bootStatusReport.bootCycles = *(data + offset);
|
||||
|
||||
nextReplyId = supv::EXE_REPORT;
|
||||
|
||||
@ -859,30 +891,19 @@ ReturnValue_t PlocSupervisorHandler::handleLatchupStatusReport(const uint8_t* da
|
||||
offset += 2;
|
||||
latchupStatusReport.cnt6 = *(data + offset) << 8 | *(data + offset + 1);
|
||||
offset += 2;
|
||||
latchupStatusReport.timeSec = *(data + offset) << 24 | *(data + offset + 1) << 16 |
|
||||
*(data + offset + 2) << 8 | *(data + offset + 3);
|
||||
offset += 4;
|
||||
latchupStatusReport.timeMin = *(data + offset) << 24 | *(data + offset + 1) << 16 |
|
||||
*(data + offset + 2) << 8 | *(data + offset + 3);
|
||||
offset += 4;
|
||||
latchupStatusReport.timeHour = *(data + offset) << 24 | *(data + offset + 1) << 16 |
|
||||
*(data + offset + 2) << 8 | *(data + offset + 3);
|
||||
offset += 4;
|
||||
latchupStatusReport.timeDay = *(data + offset) << 24 | *(data + offset + 1) << 16 |
|
||||
*(data + offset + 2) << 8 | *(data + offset + 3);
|
||||
offset += 4;
|
||||
latchupStatusReport.timeMon = *(data + offset) << 24 | *(data + offset + 1) << 16 |
|
||||
*(data + offset + 2) << 8 | *(data + offset + 3);
|
||||
offset += 4;
|
||||
latchupStatusReport.timeYear = *(data + offset) << 24 | *(data + offset + 1) << 16 |
|
||||
*(data + offset + 2) << 8 | *(data + offset + 3);
|
||||
offset += 4;
|
||||
latchupStatusReport.timeMsec = *(data + offset) << 24 | *(data + offset + 1) << 16 |
|
||||
*(data + offset + 2) << 8 | *(data + offset + 3);
|
||||
offset += 4;
|
||||
latchupStatusReport.isSet = *(data + offset) << 24 | *(data + offset + 1) << 16 |
|
||||
*(data + offset + 2) << 8 | *(data + offset + 3);
|
||||
offset += 4;
|
||||
latchupStatusReport.timeMsec = *(data + offset) << 8 | *(data + offset + 1);
|
||||
offset += 2;
|
||||
latchupStatusReport.timeSec = *(data + offset);
|
||||
offset += 1;
|
||||
latchupStatusReport.timeMin = *(data + offset);
|
||||
offset += 1;
|
||||
latchupStatusReport.timeHour = *(data + offset);
|
||||
offset += 1;
|
||||
latchupStatusReport.timeDay = *(data + offset);
|
||||
offset += 1;
|
||||
latchupStatusReport.timeMon = *(data + offset);
|
||||
offset += 1;
|
||||
latchupStatusReport.timeYear = *(data + offset);
|
||||
|
||||
nextReplyId = supv::EXE_REPORT;
|
||||
|
||||
@ -1267,6 +1288,21 @@ void PlocSupervisorHandler::packetToOutBuffer(uint8_t* packetData, size_t fullSi
|
||||
nextReplyId = supv::ACK_REPORT;
|
||||
}
|
||||
|
||||
void PlocSupervisorHandler::prepareSetShutdownTimeoutCmd(const uint8_t* commandData) {
|
||||
uint32_t timeout = 0;
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
size_t size = sizeof(timeout);
|
||||
result =
|
||||
SerializeAdapter::deSerialize(&timeout, &commandData, &size, SerializeIF::Endianness::BIG);
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning
|
||||
<< "PlocSupervisorHandler::prepareSetShutdownTimeoutCmd: Failed to deserialize timeout"
|
||||
<< std::endl;
|
||||
}
|
||||
supv::SetShutdownTimeout packet(timeout);
|
||||
packetToOutBuffer(packet.getWholeData(), packet.getFullSize());
|
||||
}
|
||||
|
||||
void PlocSupervisorHandler::disableAllReplies() {
|
||||
DeviceReplyMap::iterator iter;
|
||||
|
||||
|
Reference in New Issue
Block a user