improved acknowledgment and execution handling in supervisor handler

This commit is contained in:
Jakob Meier 2022-04-30 11:08:36 +02:00
parent 6524f924c9
commit e1ffa97232
3 changed files with 121 additions and 115 deletions

View File

@ -637,7 +637,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
#if OBSW_ADD_PLOC_MPSOC == 1
consumer << "0x" << std::hex << objects::PLOC_MPSOC_HANDLER;
auto gpioConfigMPSoC = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_MPSOC_UART,
consumer.str(), Direction::OUT, Levels::HIGH);
consumer.str(), Direction::OUT, Levels::LOW);
auto mpsocGpioCookie = new GpioCookie;
mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC);
gpioComIF->addGpios(mpsocGpioCookie);
@ -654,7 +654,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
#if OBSW_ADD_PLOC_SUPERVISOR == 1
consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER;
auto gpioConfigSupv = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_SUPV_UART, consumer.str(),
Direction::OUT, Levels::HIGH);
Direction::OUT, Levels::LOW);
auto supvGpioCookie = new GpioCookie;
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
gpioComIF->addGpios(supvGpioCookie);

View File

@ -1425,6 +1425,8 @@ class ExecutionReport : public VerificationReport {
}
private:
static constexpr char STATUS_PRINTOUT_PREFIX[] = "Supervisor execution failure report status: ";
enum class StatusCode : uint16_t {
OK = 0x0,
INIT_ERROR = 0x1,
@ -1478,191 +1480,191 @@ class ExecutionReport : public VerificationReport {
StatusCode statusCode = static_cast<StatusCode>(getStatusCode());
switch (statusCode) {
case StatusCode::OK: {
sif::warning << "Supervisor execution report status: Ok" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Ok" << std::endl;
break;
}
case StatusCode::INIT_ERROR: {
sif::warning << "Supervisor execution report status: Init error" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Init error" << std::endl;
break;
}
case StatusCode::BAD_PARAM: {
sif::warning << "Supervisor execution report status: Bad param" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Bad param" << std::endl;
break;
}
case StatusCode::NOT_INITIALIZED: {
sif::warning << "Supervisor execution report status: Not initialized" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Not initialized" << std::endl;
break;
}
case StatusCode::BAD_PERIPH_ID: {
sif::warning << "Supervisor execution report status: Bad periph ID" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Bad periph ID" << std::endl;
break;
}
case StatusCode::TIMEOUT: {
sif::warning << "Supervisor execution report status: Timeout" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Timeout" << std::endl;
break;
}
case StatusCode::RX_ERROR: {
sif::warning << "Supervisor execution report status: RX error" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "RX error" << std::endl;
break;
}
case StatusCode::TX_ERROR: {
sif::warning << "Supervisor execution report status: TX error" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "TX error" << std::endl;
break;
}
case StatusCode::BUF_EMPTY: {
sif::warning << "Supervisor execution report status: Buf empty" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Buf empty" << std::endl;
break;
}
case StatusCode::BUF_FULL: {
sif::warning << "Supervisor execution report status: Buf full" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Buf full" << std::endl;
break;
}
case StatusCode::NAK: {
sif::warning << "Supervisor execution report status: Nak, default error code" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Nak, default error code" << std::endl;
break;
}
case StatusCode::ARB_LOST: {
sif::warning << "Supervisor execution report status: Arb lost" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Arb lost" << std::endl;
break;
}
case StatusCode::BUSY: {
sif::warning << "Supervisor execution report status: Busy" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Busy" << std::endl;
break;
}
case StatusCode::NOT_IMPLEMENTED: {
sif::warning << "Supervisor execution report status: Not implemented" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Not implemented" << std::endl;
break;
}
case StatusCode::ALIGNEMENT_ERROR: {
sif::warning << "Supervisor execution report status: Alignment error" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Alignment error" << std::endl;
break;
}
case StatusCode::PERIPH_ERR: {
sif::warning << "Supervisor execution report status: Periph error" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Periph error" << std::endl;
break;
}
case StatusCode::FAILED_LATCH: {
sif::warning << "Supervisor execution report status: Failed latch" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Failed latch" << std::endl;
break;
}
case StatusCode::GPIO_HIGH: {
sif::warning << "Supervisor execution report status: GPIO high" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "GPIO high" << std::endl;
break;
}
case StatusCode::GPIO_LOW: {
sif::warning << "Supervisor execution report status: GPIO low" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "GPIO low" << std::endl;
break;
}
case StatusCode::TEST_PASSED: {
sif::warning << "Supervisor execution report status: Test passed" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Test passed" << std::endl;
break;
}
case StatusCode::TEST_FAILED: {
sif::warning << "Supervisor execution report status: Test failed" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Test failed" << std::endl;
break;
}
case StatusCode::NOTHING_TODO: {
sif::warning
<< "Supervisor execution report status: Nothing todo, not an error but a warning"
<< STATUS_PRINTOUT_PREFIX << "Nothing todo, not an error but a warning"
<< std::endl;
break;
}
case StatusCode::POWER_FAULT: {
sif::warning << "Supervisor execution report status: Power fault" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Power fault" << std::endl;
break;
}
case StatusCode::INVALID_LENGTH: {
sif::warning << "Supervisor execution report status: Invalid length" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Invalid length" << std::endl;
break;
}
case StatusCode::OUT_OF_RANGE: {
sif::warning
<< "Supervisor execution report status: Out of range, lenght check of parameter failed"
<< STATUS_PRINTOUT_PREFIX << "Out of range, lenght check of parameter failed"
<< std::endl;
break;
}
case StatusCode::OUT_OF_HEAP_MEMORY: {
sif::warning << "Supervisor execution report status: Out of heap memory" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Out of heap memory" << std::endl;
break;
}
case StatusCode::INVALID_STATE_TRANSITION: {
sif::warning << "Supervisor execution report status: Invalid state transition" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Invalid state transition" << std::endl;
break;
}
case StatusCode::MPSOC_BOOT_FAILED: {
sif::warning << "Supervisor execution report status: MPSoC boot failed" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "MPSoC boot failed" << std::endl;
break;
}
case StatusCode::SP_NOT_AVAILABLE: {
sif::warning << "Supervisor execution report status: SP not available" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "SP not available" << std::endl;
break;
}
case StatusCode::SP_DATA_INSUFFICIENT: {
sif::warning << "Supervisor execution report status: SP data insufficient" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "SP data insufficient" << std::endl;
break;
}
case StatusCode::SP_MEMORY_ID_INVALID: {
sif::warning << "Supervisor execution report status: SP data insufficient" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "SP data insufficient" << std::endl;
break;
}
case StatusCode::MPSOC_NOT_IN_RESET: {
sif::warning << "Supervisor execution report status: MPSoC not in reset" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "MPSoC not in reset" << std::endl;
break;
}
case StatusCode::FLASH_INIT_FAILED: {
sif::warning << "Supervisor execution report status: Flash init failed" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Flash init failed" << std::endl;
break;
}
case StatusCode::FLASH_ERASE_FAILED: {
sif::warning << "Supervisor execution report status: Flash erase failed" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Flash erase failed" << std::endl;
break;
}
case StatusCode::FLASH_WRITE_FAILED: {
sif::warning << "Supervisor execution report status: Flash write failed" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Flash write failed" << std::endl;
break;
}
case StatusCode::FLASH_VERIFY_FAILED: {
sif::warning << "Supervisor execution report status: Flash verify failed" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Flash verify failed" << std::endl;
break;
}
case StatusCode::CANNOT_ACCESS_TM: {
sif::warning << "Supervisor execution report status: Can not access tm" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Can not access tm" << std::endl;
break;
}
case StatusCode::CANNOT_SEND_TM: {
sif::warning << "Supervisor execution report status: Can not access tm" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "Can not access tm" << std::endl;
break;
}
case StatusCode::PG_LOW: {
sif::warning << "Supervisor execution report status: PG low" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "PG low" << std::endl;
break;
}
case StatusCode::PG_5V_LOW: {
sif::warning << "Supervisor execution report status: PG 5V low" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "PG 5V low" << std::endl;
break;
}
case StatusCode::PG_0V85_LOW: {
sif::warning << "Supervisor execution report status: PG 0V85 low" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "PG 0V85 low" << std::endl;
break;
}
case StatusCode::PG_1V8_LOW: {
sif::warning << "Supervisor execution report status: PG 1V8 low" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "PG 1V8 low" << std::endl;
break;
}
case StatusCode::PG_MISC_LOW: {
sif::warning << "Supervisor execution report status: PG misc low" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "PG misc low" << std::endl;
break;
}
case StatusCode::PG_3V3_LOW: {
sif::warning << "Supervisor execution report status: PG 3V3 low" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "PG 3V3 low" << std::endl;
break;
}
case StatusCode::PG_MB_VAIO_LOW: {
sif::warning << "Supervisor execution report status: PG mb vaio low" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "PG mb vaio low" << std::endl;
break;
}
case StatusCode::PG_MB_MPSOCIO_LOW: {
sif::warning << "Supervisor execution report status: PG mb mpsocio low" << std::endl;
sif::warning << STATUS_PRINTOUT_PREFIX << "PG mb mpsocio low" << std::endl;
break;
}
default:

View File

@ -162,7 +162,7 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d
switch (deviceCommand) {
case GET_HK_REPORT: {
sif::warning << "PlocSupervisorHandler::buildCommandFromCommand: Housekeeping report is "
<< "faulty. Needs to be fixed in vorago software" << std::endl;
<< "faulty. Needs to be fixed in vorago software" << std::endl;
prepareEmptyCmd(APID_GET_HK_REPORT);
result = RETURN_OK;
break;
@ -428,11 +428,10 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
switch (command->first) {
case GET_HK_REPORT: {
enabledReplies = 3;
result =
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, HK_REPORT);
result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, HK_REPORT);
if (result != RETURN_OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
<< HK_REPORT << " not in replyMap" << std::endl;
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << HK_REPORT
<< " not in replyMap" << std::endl;
}
break;
}
@ -448,8 +447,8 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
}
case GET_LATCHUP_STATUS_REPORT: {
enabledReplies = 3;
result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true,
LATCHUP_REPORT);
result =
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, LATCHUP_REPORT);
if (result != RETURN_OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
<< LATCHUP_REPORT << " not in replyMap" << std::endl;
@ -458,8 +457,8 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
}
case LOGGING_REQUEST_COUNTERS: {
enabledReplies = 3;
result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true,
LOGGING_REPORT);
result =
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, LOGGING_REPORT);
if (result != RETURN_OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
<< LOGGING_REPORT << " not in replyMap" << std::endl;
@ -468,18 +467,17 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
}
case REQUEST_ADC_REPORT: {
enabledReplies = 3;
result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true,
ADC_REPORT);
result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, ADC_REPORT);
if (result != RETURN_OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
<< ADC_REPORT << " not in replyMap" << std::endl;
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << ADC_REPORT
<< " not in replyMap" << std::endl;
}
break;
}
case FIRST_MRAM_DUMP: {
enabledReplies = 2; // expected replies will be increased in handleMramDumpPacket
result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true,
FIRST_MRAM_DUMP);
result =
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, FIRST_MRAM_DUMP);
if (result != RETURN_OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
<< FIRST_MRAM_DUMP << " not in replyMap" << std::endl;
@ -539,15 +537,13 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
* Every command causes at least one acknowledgment and one execution report. Therefore both
* replies will be enabled here.
*/
result =
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, ACK_REPORT);
result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, ACK_REPORT);
if (result != RETURN_OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << ACK_REPORT
<< " not in replyMap" << std::endl;
}
result =
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, EXE_REPORT);
result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, EXE_REPORT);
if (result != RETURN_OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << EXE_REPORT
<< " not in replyMap" << std::endl;
@ -792,7 +788,8 @@ void PlocSupervisorHandler::handleEvent(EventMessage* eventMessage) {
if (result != RETURN_OK) {
triggerEvent(SUPV_MPSOC_SHUWDOWN_BUILD_FAILED);
sif::warning << "PlocSupervisorHandler::handleEvent: Failed to build MPSoC shutdown "
"command" << std::endl;
"command"
<< std::endl;
return;
}
}
@ -806,14 +803,14 @@ void PlocSupervisorHandler::handleEvent(EventMessage* eventMessage) {
void PlocSupervisorHandler::setExecutionTimeout(DeviceCommandId_t command) {
using namespace supv;
switch(command) {
case FIRST_MRAM_DUMP:
case CONSECUTIVE_MRAM_DUMP:
executionTimeout.setTimeout(MRAM_DUMP_EXECUTION_TIMEOUT);
break;
default:
executionTimeout.setTimeout(EXECUTION_DEFAULT_TIMEOUT);
break;
switch (command) {
case FIRST_MRAM_DUMP:
case CONSECUTIVE_MRAM_DUMP:
executionTimeout.setTimeout(MRAM_DUMP_EXECUTION_TIMEOUT);
break;
default:
executionTimeout.setTimeout(EXECUTION_DEFAULT_TIMEOUT);
break;
}
}
@ -828,10 +825,10 @@ ReturnValue_t PlocSupervisorHandler::verifyPacket(const uint8_t* start, size_t f
ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) {
using namespace supv;
ReturnValue_t result = RETURN_OK;
ReturnValue_t result = RETURN_OK;
AcknowledgmentReport ack;
ack.addWholeData(data, SIZE_ACK_REPORT);
AcknowledgmentReport ack;
ack.addWholeData(data, SIZE_ACK_REPORT);
result = ack.checkCrc();
if (result != RETURN_OK) {
@ -844,12 +841,10 @@ ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) {
return RETURN_OK;
}
uint16_t apid = (*(data) << 8 | *(data + 1)) & APID_MASK;
result = ack.checkApid();
switch (result) {
case supv::APID_ACK_FAILURE: {
case SupvReturnValuesIF::CRC_FAILURE: {
// TODO: Interpretation of status field in acknowledgment report
sif::debug << "PlocSupervisorHandler::handleAckReport: Received Ack failure report"
<< std::endl;
@ -863,43 +858,49 @@ ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) {
result = IGNORE_REPLY_DATA;
break;
}
case supv::APID_ACK_SUCCESS: {
case RETURN_OK: {
setNextReplyId();
break;
}
case SupvReturnValuesIF::INVALID_APID:
sif::warning << "PlocSupervisorHandler::handleAckReport: Invalid APID in Ack report"
<< std::endl;
sendFailureReport(supv::ACK_REPORT, result);
disableAllReplies();
nextReplyId = supv::NONE;
result = IGNORE_REPLY_DATA;
break;
default: {
sif::debug << "PlocSupervisorHandler::handleAckReport: Invalid APID in Ack report"
<< std::endl;
sif::error << "PlocSupervisorHandler::handleAckReport: APID parsing failed" << std::endl;
result = RETURN_FAILED;
break;
}
}
return result;
}
ReturnValue_t PlocSupervisorHandler::handleExecutionReport(const uint8_t* data) {
using namespace supv;
ReturnValue_t result = RETURN_OK;
result = verifyPacket(data, supv::SIZE_EXE_REPORT);
if (result == SupvReturnValuesIF::CRC_FAILURE) {
ExecutionReport exe;
exe.addWholeData(data, SIZE_EXE_REPORT);
result = exe.checkCrc();
if (result != RETURN_OK) {
sif::error << "PlocSupervisorHandler::handleExecutionReport: CRC failure" << std::endl;
nextReplyId = supv::NONE;
return result;
}
uint16_t apid = (*(data) << 8 | *(data + 1)) & APID_MASK;
result = exe.checkApid();
switch (apid) {
case (supv::APID_EXE_SUCCESS): {
handleSpecialExecutionReport(data);
switch (result) {
case (RETURN_OK): {
handleSpecialExecutionReport(data);
break;
}
case (supv::APID_EXE_FAILURE): {
// TODO: Interpretation of status field in execution report
sif::error
<< "PlocSupervisorHandler::handleExecutionReport: Received execution failure report"
<< std::endl;
case (SupvReturnValuesIF::RECEIVED_EXE_FAILURE): {
DeviceCommandId_t commandId = getPendingCommand();
if (commandId != DeviceHandlerIF::NO_COMMAND_ID) {
triggerEvent(SUPV_EXE_FAILURE, commandId);
@ -907,9 +908,7 @@ ReturnValue_t PlocSupervisorHandler::handleExecutionReport(const uint8_t* data)
sif::debug << "PlocSupervisorHandler::handleExecutionReport: Unknown command id"
<< std::endl;
}
uint16_t status = *(data + EXE_STATUS_OFFSET) << 8 | *(data + EXE_STATUS_OFFSET + 1);
sif::info << "Execution status: 0x" << std::hex << status << std::endl;
sendFailureReport(supv::EXE_REPORT, SupvReturnValuesIF::RECEIVED_EXE_FAILURE);
sendFailureReport(EXE_REPORT, SupvReturnValuesIF::RECEIVED_EXE_FAILURE);
disableExeReportReply();
result = IGNORE_REPLY_DATA;
break;
@ -1038,7 +1037,8 @@ ReturnValue_t PlocSupervisorHandler::handleBootStatusReport(const uint8_t* data)
nextReplyId = supv::EXE_REPORT;
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PLOC_SUPERVISOR == 1
sif::info << "PlocSupervisorHandler::handleBootStatusReport: SoC State (0 - off, 1 - booting, 3 - operating): "
sif::info << "PlocSupervisorHandler::handleBootStatusReport: SoC State (0 - off, 1 - booting, 3 "
"- operating, 4 - Shutdown): "
<< static_cast<unsigned int>(bootStatusReport.socState.value) << std::endl;
sif::info << "PlocSupervisorHandler::handleBootStatusReport: Power Cycles: "
<< static_cast<unsigned int>(bootStatusReport.powerCycles.value) << std::endl;
@ -1167,7 +1167,8 @@ ReturnValue_t PlocSupervisorHandler::handleLoggingReport(const uint8_t* data) {
size_t size = loggingReport.getSerializedSize();
result = loggingReport.deSerialize(&dataField, &size, SerializeIF::Endianness::BIG);
if (result != RETURN_OK) {
sif::warning << "PlocSupervisorHandler::handleLoggingReport: Deserialization failed" << std::endl;
sif::warning << "PlocSupervisorHandler::handleLoggingReport: Deserialization failed"
<< std::endl;
}
loggingReport.setValidityBufferGeneration(true);
loggingReport.setValidity(true, true);
@ -1594,7 +1595,9 @@ ReturnValue_t PlocSupervisorHandler::parseMramPackets(const uint8_t* packet, siz
*foundLen = remainingSize;
disableAllReplies();
bufferTop = 0;
sif::info << "PlocSupervisorHandler::parseMramPackets: Can not find MRAM packet in space packet buffer" << std::endl;
sif::info << "PlocSupervisorHandler::parseMramPackets: Can not find MRAM packet in space "
"packet buffer"
<< std::endl;
return SupvReturnValuesIF::MRAM_PACKET_PARSING_FAILURE;
}
}
@ -1679,7 +1682,8 @@ void PlocSupervisorHandler::increaseExpectedMramReplies(DeviceCommandId_t id) {
ReturnValue_t PlocSupervisorHandler::checkMramPacketApid() {
uint16_t apid = (spacePacketBuffer[0] << 8 | spacePacketBuffer[1]) & supv::APID_MASK;
if (apid != supv::APID_MRAM_DUMP_TM) {
sif::warning << "PlocSupervisorHandler::checkMramPacketApid: 0x" << std::hex << apid << std::endl;
sif::warning << "PlocSupervisorHandler::checkMramPacketApid: 0x" << std::hex << apid
<< std::endl;
return SupvReturnValuesIF::NO_MRAM_PACKET;
}
return APERIODIC_REPLY;
@ -1821,18 +1825,18 @@ ReturnValue_t PlocSupervisorHandler::eventSubscription() {
void PlocSupervisorHandler::handleSpecialExecutionReport(const uint8_t* data) {
DeviceCommandId_t commandId = getPendingCommand();
switch(commandId) {
case supv::READ_GPIO: {
supv::ExecutionReport exe;
exe.addWholeData(data, supv::SIZE_EXE_REPORT);
uint16_t gpioState = exe.getStatusCode();
switch (commandId) {
case supv::READ_GPIO: {
supv::ExecutionReport exe;
exe.addWholeData(data, supv::SIZE_EXE_REPORT);
uint16_t gpioState = exe.getStatusCode();
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1
sif::info << "PlocsupervisorHandler: Read GPIO TM, State: " << gpioState << std::endl;
sif::info << "PlocsupervisorHandler: Read GPIO TM, State: " << gpioState << std::endl;
#endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */
handleDeviceTM(reinterpret_cast<uint8_t*>(&gpioState), sizeof(gpioState), supv::EXE_REPORT);
break;
}
default:
break;
handleDeviceTM(reinterpret_cast<uint8_t*>(&gpioState), sizeof(gpioState), supv::EXE_REPORT);
break;
}
default:
break;
}
}