removed unused ploc commands, fix in logging report reply
This commit is contained in:
@ -416,7 +416,6 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() {
|
||||
this->insertInCommandMap(REQUEST_ADC_REPORT);
|
||||
this->insertInCommandMap(RUN_AUTO_EM_TESTS);
|
||||
this->insertInCommandMap(WIPE_MRAM);
|
||||
this->insertInCommandMap(PRINT_CPU_STATS);
|
||||
this->insertInCommandMap(SET_GPIO);
|
||||
this->insertInCommandMap(READ_GPIO);
|
||||
this->insertInCommandMap(RESTART_SUPERVISOR);
|
||||
@ -537,7 +536,6 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
|
||||
case COPY_ADC_DATA_TO_MRAM:
|
||||
case RUN_AUTO_EM_TESTS:
|
||||
case WIPE_MRAM:
|
||||
case PRINT_CPU_STATS:
|
||||
case SET_GPIO:
|
||||
case READ_GPIO:
|
||||
case RESTART_SUPERVISOR:
|
||||
@ -837,6 +835,9 @@ void PlocSupervisorHandler::setExecutionTimeout(DeviceCommandId_t command) {
|
||||
case CONSECUTIVE_MRAM_DUMP:
|
||||
executionTimeout.setTimeout(MRAM_DUMP_EXECUTION_TIMEOUT);
|
||||
break;
|
||||
case COPY_ADC_DATA_TO_MRAM:
|
||||
executionTimeout.setTimeout(COPY_ADC_TO_MRAM_TIMEOUT);
|
||||
break;
|
||||
default:
|
||||
executionTimeout.setTimeout(EXECUTION_DEFAULT_TIMEOUT);
|
||||
break;
|
||||
@ -873,13 +874,14 @@ ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) {
|
||||
result = ack.checkApid();
|
||||
|
||||
switch (result) {
|
||||
case SupvReturnValuesIF::CRC_FAILURE: {
|
||||
// TODO: Interpretation of status field in acknowledgment report
|
||||
sif::debug << "PlocSupervisorHandler::handleAckReport: Received Ack failure report"
|
||||
<< std::endl;
|
||||
case SupvReturnValuesIF::RECEIVED_ACK_FAILURE: {
|
||||
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1
|
||||
sif::debug << "PlocSupervisorHandler: Received Ack failure report with status code: 0x"
|
||||
<< std::hex << ack.getStatusCode() << std::endl;
|
||||
#endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */
|
||||
DeviceCommandId_t commandId = getPendingCommand();
|
||||
if (commandId != DeviceHandlerIF::NO_COMMAND_ID) {
|
||||
triggerEvent(SUPV_ACK_FAILURE, commandId);
|
||||
triggerEvent(SUPV_ACK_FAILURE, commandId, static_cast<uint32_t>(ack.getStatusCode()));
|
||||
}
|
||||
sendFailureReport(supv::ACK_REPORT, SupvReturnValuesIF::RECEIVED_ACK_FAILURE);
|
||||
disableAllReplies();
|
||||
@ -930,7 +932,7 @@ ReturnValue_t PlocSupervisorHandler::handleExecutionReport(const uint8_t* data)
|
||||
break;
|
||||
}
|
||||
case (SupvReturnValuesIF::RECEIVED_EXE_FAILURE): {
|
||||
handleExecutionFailureReport();
|
||||
handleExecutionFailureReport(exe.getStatusCode());
|
||||
result = RETURN_OK;
|
||||
break;
|
||||
}
|
||||
@ -1172,7 +1174,7 @@ ReturnValue_t PlocSupervisorHandler::handleLoggingReport(const uint8_t* data) {
|
||||
result = verifyPacket(data, supv::SIZE_LOGGING_REPORT);
|
||||
|
||||
if (result == SupvReturnValuesIF::CRC_FAILURE) {
|
||||
sif::error << "PlocSupervisorHandler::handleLoggingReport: Logging report has "
|
||||
sif::warning << "PlocSupervisorHandler::handleLoggingReport: Logging report has "
|
||||
<< "invalid crc" << std::endl;
|
||||
return result;
|
||||
}
|
||||
@ -1853,7 +1855,21 @@ void PlocSupervisorHandler::handleExecutionSuccessReport(const uint8_t* data) {
|
||||
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1
|
||||
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);
|
||||
DeviceCommandMap::iterator iter = deviceCommandMap.find(commandId);
|
||||
if (iter->second.sendReplyTo == NO_COMMAND_ID) {
|
||||
return;
|
||||
}
|
||||
uint8_t data[sizeof(gpioState)];
|
||||
size_t size = 0;
|
||||
ReturnValue_t result = SerializeAdapter::serialize(
|
||||
&gpioState, data, &size, sizeof(gpioState), SerializeIF::Endianness::BIG);
|
||||
if (result != RETURN_OK) {
|
||||
sif::debug << "PlocSupervisorHandler: Failed to deserialize GPIO state" << std::endl;
|
||||
}
|
||||
result = actionHelper.reportData(iter->second.sendReplyTo, commandId, data, sizeof(data));
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning << "PlocSupervisorHandler: Read GPIO, failed to report data" << std::endl;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case supv::SET_TIME_REF: {
|
||||
@ -1867,13 +1883,11 @@ void PlocSupervisorHandler::handleExecutionSuccessReport(const uint8_t* data) {
|
||||
}
|
||||
}
|
||||
|
||||
void PlocSupervisorHandler::handleExecutionFailureReport() {
|
||||
void PlocSupervisorHandler::handleExecutionFailureReport(uint16_t statusCode) {
|
||||
using namespace supv;
|
||||
DeviceCommandId_t commandId = getPendingCommand();
|
||||
if (commandId != DeviceHandlerIF::NO_COMMAND_ID) {
|
||||
triggerEvent(SUPV_EXE_FAILURE, commandId);
|
||||
} else {
|
||||
sif::debug << "PlocSupervisorHandler::handleExecutionReport: Unknown command id" << std::endl;
|
||||
triggerEvent(SUPV_EXE_FAILURE, commandId, static_cast<uint32_t>(statusCode));
|
||||
}
|
||||
sendFailureReport(EXE_REPORT, SupvReturnValuesIF::RECEIVED_EXE_FAILURE);
|
||||
disableExeReportReply();
|
||||
|
@ -66,6 +66,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
||||
//! [EXPORT] : [COMMENT] PLOC supervisor received acknowledgment failure report
|
||||
static const Event SUPV_ACK_FAILURE = MAKE_EVENT(2, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] PLOC received execution failure report
|
||||
//! P1: ID of command for which the execution failed
|
||||
//! P2: Status code sent by the supervisor handler
|
||||
static const Event SUPV_EXE_FAILURE = MAKE_EVENT(3, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] PLOC supervisor reply has invalid crc
|
||||
static const Event SUPV_CRC_FAILURE_EVENT = MAKE_EVENT(4, severity::LOW);
|
||||
@ -82,6 +84,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
||||
static const uint32_t EXECUTION_DEFAULT_TIMEOUT = 5000;
|
||||
// 30 s
|
||||
static const uint32_t MRAM_DUMP_EXECUTION_TIMEOUT = 30000;
|
||||
// 70 s
|
||||
static const uint32_t COPY_ADC_TO_MRAM_TIMEOUT = 70000;
|
||||
// 2 s
|
||||
static const uint32_t BOOT_TIMEOUT = 2000;
|
||||
enum class StartupState: uint8_t {
|
||||
@ -363,7 +367,7 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
|
||||
ReturnValue_t eventSubscription();
|
||||
|
||||
void handleExecutionSuccessReport(const uint8_t* data);
|
||||
void handleExecutionFailureReport();
|
||||
void handleExecutionFailureReport(uint16_t statusCode);
|
||||
};
|
||||
|
||||
#endif /* MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_ */
|
||||
|
@ -161,6 +161,7 @@ ReturnValue_t PlocSupvHelper::performUpdate() {
|
||||
supv::SequenceFlags seqFlags = supv::SequenceFlags::FIRST_PKT;
|
||||
while (remainingSize > 0) {
|
||||
if (terminate) {
|
||||
terminate = false;
|
||||
return PROCESS_TERMINATED;
|
||||
}
|
||||
if (remainingSize > supv::WriteMemory::CHUNK_MAX) {
|
||||
|
Reference in New Issue
Block a user