supervisor event buffer request
This commit is contained in:
@ -117,11 +117,18 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId,
|
||||
plocSupvHelperExecuting = true;
|
||||
return EXECUTION_FINISHED;
|
||||
}
|
||||
case LOGGING_REQUEST_EVENT_BUFFERS:
|
||||
case LOGGING_REQUEST_EVENT_BUFFERS: {
|
||||
if (size > config::MAX_PATH_SIZE) {
|
||||
return SupvReturnValuesIF::FILENAME_TOO_LONG;
|
||||
}
|
||||
supvHelper->startEventbBufferRequest(std::string(reinterpret_cast<const char*>(data), size));
|
||||
result = supvHelper->startEventbBufferRequest(
|
||||
std::string(reinterpret_cast<const char*>(data), size));
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
plocSupvHelperExecuting = true;
|
||||
return EXECUTION_FINISHED;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -335,7 +342,8 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d
|
||||
break;
|
||||
}
|
||||
case LOGGING_SET_TOPIC: {
|
||||
RequestLoggingData packet(RequestLoggingData::Sa::SET_LOGGING_TOPIC);
|
||||
uint8_t tpc = *(commandData);
|
||||
RequestLoggingData packet(RequestLoggingData::Sa::SET_LOGGING_TOPIC, tpc);
|
||||
packetToOutBuffer(packet.getWholeData(), packet.getFullSize());
|
||||
result = RETURN_OK;
|
||||
break;
|
||||
@ -394,6 +402,8 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() {
|
||||
this->insertInCommandMap(ENABLE_ADC_MONITOR_TASK);
|
||||
this->insertInCommandMap(DISABLE_ADC_MONITOR_TASK);
|
||||
this->insertInCommandMap(LOGGING_REQUEST_COUNTERS);
|
||||
this->insertInCommandMap(LOGGING_CLEAR_COUNTERS);
|
||||
this->insertInCommandMap(LOGGING_SET_TOPIC);
|
||||
this->insertInCommandAndReplyMap(FIRST_MRAM_DUMP, 3);
|
||||
this->insertInCommandAndReplyMap(CONSECUTIVE_MRAM_DUMP, 3);
|
||||
this->insertInReplyMap(ACK_REPORT, 3, nullptr, SIZE_ACK_REPORT);
|
||||
@ -504,6 +514,8 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
|
||||
case supv::DISABLE_AUTO_TM:
|
||||
case supv::ENABLE_ADC_MONITOR_TASK:
|
||||
case supv::DISABLE_ADC_MONITOR_TASK:
|
||||
case supv::LOGGING_CLEAR_COUNTERS:
|
||||
case supv::LOGGING_SET_TOPIC:
|
||||
enabledReplies = 2;
|
||||
break;
|
||||
default:
|
||||
@ -534,11 +546,12 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
|
||||
|
||||
ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
||||
DeviceCommandId_t* foundId, size_t* foundLen) {
|
||||
if (nextReplyId == supv::FIRST_MRAM_DUMP) {
|
||||
*foundId = supv::FIRST_MRAM_DUMP;
|
||||
using namespace supv;
|
||||
if (nextReplyId == FIRST_MRAM_DUMP) {
|
||||
*foundId = FIRST_MRAM_DUMP;
|
||||
return parseMramPackets(start, remainingSize, foundLen);
|
||||
} else if (nextReplyId == supv::CONSECUTIVE_MRAM_DUMP) {
|
||||
*foundId = supv::CONSECUTIVE_MRAM_DUMP;
|
||||
} else if (nextReplyId == CONSECUTIVE_MRAM_DUMP) {
|
||||
*foundId = CONSECUTIVE_MRAM_DUMP;
|
||||
return parseMramPackets(start, remainingSize, foundLen);
|
||||
}
|
||||
|
||||
@ -547,37 +560,37 @@ ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t* start, size_t r
|
||||
uint16_t apid = (*(start) << 8 | *(start + 1)) & APID_MASK;
|
||||
|
||||
switch (apid) {
|
||||
case (supv::APID_ACK_SUCCESS):
|
||||
*foundLen = supv::SIZE_ACK_REPORT;
|
||||
*foundId = supv::ACK_REPORT;
|
||||
case (APID_ACK_SUCCESS):
|
||||
*foundLen = SIZE_ACK_REPORT;
|
||||
*foundId = ACK_REPORT;
|
||||
break;
|
||||
case (supv::APID_ACK_FAILURE):
|
||||
*foundLen = supv::SIZE_ACK_REPORT;
|
||||
*foundId = supv::ACK_REPORT;
|
||||
case (APID_ACK_FAILURE):
|
||||
*foundLen = SIZE_ACK_REPORT;
|
||||
*foundId = ACK_REPORT;
|
||||
break;
|
||||
case (supv::APID_HK_REPORT):
|
||||
*foundLen = supv::SIZE_HK_REPORT;
|
||||
*foundId = supv::HK_REPORT;
|
||||
case (APID_HK_REPORT):
|
||||
*foundLen = SIZE_HK_REPORT;
|
||||
*foundId = HK_REPORT;
|
||||
break;
|
||||
case (supv::APID_BOOT_STATUS_REPORT):
|
||||
*foundLen = supv::SIZE_BOOT_STATUS_REPORT;
|
||||
*foundId = supv::BOOT_STATUS_REPORT;
|
||||
case (APID_BOOT_STATUS_REPORT):
|
||||
*foundLen = SIZE_BOOT_STATUS_REPORT;
|
||||
*foundId = BOOT_STATUS_REPORT;
|
||||
break;
|
||||
case (supv::APID_LATCHUP_STATUS_REPORT):
|
||||
*foundLen = supv::SIZE_LATCHUP_STATUS_REPORT;
|
||||
*foundId = supv::LATCHUP_REPORT;
|
||||
case (APID_LATCHUP_STATUS_REPORT):
|
||||
*foundLen = SIZE_LATCHUP_STATUS_REPORT;
|
||||
*foundId = LATCHUP_REPORT;
|
||||
break;
|
||||
case (supv::APID_DATA_LOGGER_DATA):
|
||||
*foundLen = supv::SIZE_LOGGING_REPORT;
|
||||
*foundId = supv::LOGGING_REPORT;
|
||||
case (APID_DATA_LOGGER_DATA):
|
||||
*foundLen = SIZE_LOGGING_REPORT;
|
||||
*foundId = LOGGING_REPORT;
|
||||
break;
|
||||
case (supv::APID_EXE_SUCCESS):
|
||||
*foundLen = supv::SIZE_EXE_REPORT;
|
||||
*foundId = supv::EXE_REPORT;
|
||||
case (APID_EXE_SUCCESS):
|
||||
*foundLen = SIZE_EXE_REPORT;
|
||||
*foundId = EXE_REPORT;
|
||||
break;
|
||||
case (supv::APID_EXE_FAILURE):
|
||||
*foundLen = supv::SIZE_EXE_REPORT;
|
||||
*foundId = supv::EXE_REPORT;
|
||||
case (APID_EXE_FAILURE):
|
||||
*foundLen = SIZE_EXE_REPORT;
|
||||
*foundId = EXE_REPORT;
|
||||
break;
|
||||
default: {
|
||||
sif::debug << "PlocSupervisorHandler::scanForReply: Reply has invalid apid" << std::endl;
|
||||
@ -687,6 +700,16 @@ ReturnValue_t PlocSupervisorHandler::initializeLocalDataPool(localpool::DataPool
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_TIME_YEAR, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_RPT_IS_SET, new PoolEntry<uint8_t>({0}));
|
||||
|
||||
localDataPoolMap.emplace(supv::SUPERVISOR_REBOOTS, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::LATCHUP_EVENTS, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::ADC_TRIGGERS, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::PS_HEARTBEATS_LOST, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::PL_HEARTBEATS_LOST, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::TC_RECEIVED, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::TM_RECEIVED, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::SOC_BOOTS, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(supv::SOC_BOOT_FAILS, new PoolEntry<uint32_t>({0}));
|
||||
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
@ -1037,7 +1060,7 @@ ReturnValue_t PlocSupervisorHandler::handleLoggingReport(const uint8_t* data) {
|
||||
return result;
|
||||
}
|
||||
|
||||
const uint8_t* dataField = data + supv::DATA_FIELD_OFFSET + sizeof(sa);
|
||||
const uint8_t* dataField = data + supv::DATA_FIELD_OFFSET + sizeof(supv::RequestLoggingData::Sa);
|
||||
result = loggingReport.read();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
@ -1078,6 +1101,9 @@ void PlocSupervisorHandler::setNextReplyId() {
|
||||
case supv::CONSECUTIVE_MRAM_DUMP:
|
||||
nextReplyId = supv::CONSECUTIVE_MRAM_DUMP;
|
||||
break;
|
||||
case supv::LOGGING_REQUEST_COUNTERS:
|
||||
nextReplyId = supv::LOGGING_REPORT;
|
||||
break;
|
||||
default:
|
||||
/* If no telemetry is expected the next reply is always the execution report */
|
||||
nextReplyId = supv::EXE_REPORT;
|
||||
@ -1331,9 +1357,10 @@ void PlocSupervisorHandler::prepareSetShutdownTimeoutCmd(const uint8_t* commandD
|
||||
|
||||
ReturnValue_t PlocSupervisorHandler::prepareLoggingRequest(const uint8_t* commandData,
|
||||
size_t commandDataLen) {
|
||||
uint8_t sa = *commandData;
|
||||
using namespace supv;
|
||||
RequestLoggingData::Sa sa = static_cast<RequestLoggingData::Sa>(*commandData);
|
||||
uint8_t tpc = *(commandData + 1);
|
||||
supv::RequestLoggingData packet(sa, tpc);
|
||||
RequestLoggingData packet(sa, tpc);
|
||||
packetToOutBuffer(packet.getWholeData(), packet.getFullSize());
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user