some more cleaning and refacoring
Some checks failed
EIVE/eive-obsw/pipeline/pr-v2.1.0-dev There was a failure building this commit

This commit is contained in:
Robin Müller 2023-05-15 15:19:12 +02:00
parent fabc6da562
commit 5ce0a60184
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 14 additions and 20 deletions

View File

@ -13,7 +13,7 @@ PlocMpsocHandler::PlocMpsocHandler(object_id_t objectId, object_id_t uartComIFid
Gpio uartIsolatorSwitch, object_id_t supervisorHandler)
: DeviceHandlerBase(objectId, uartComIFid, comCookie),
hkReport(this),
plocMPSoCHelper(plocMPSoCHelper),
specialComHelper(plocMPSoCHelper),
uartIsolatorSwitch(uartIsolatorSwitch),
supervisorHandler(supervisorHandler),
commandActionHelper(this) {
@ -65,12 +65,12 @@ ReturnValue_t PlocMpsocHandler::initialize() {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
result = plocMPSoCHelper->setComIF(communicationInterface);
result = specialComHelper->setComIF(communicationInterface);
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
plocMPSoCHelper->setComCookie(comCookie);
plocMPSoCHelper->setSequenceCount(&sequenceCount);
specialComHelper->setComCookie(comCookie);
specialComHelper->setSequenceCount(&sequenceCount);
result = commandActionHelper.initialize();
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
@ -136,9 +136,9 @@ ReturnValue_t PlocMpsocHandler::executeAction(ActionId_t actionId, MessageQueueI
if (result != returnvalue::OK) {
return result;
}
plocMPSoCHelper->setSequenceCount(&sequenceCount);
result = plocMPSoCHelper->startFlashWrite(flashWritePusCmd.getObcFile(),
flashWritePusCmd.getMPSoCFile());
specialComHelper->setSequenceCount(&sequenceCount);
result = specialComHelper->startFlashWrite(flashWritePusCmd.getObcFile(),
flashWritePusCmd.getMPSoCFile());
if (result != returnvalue::OK) {
return result;
}
@ -151,12 +151,10 @@ ReturnValue_t PlocMpsocHandler::executeAction(ActionId_t actionId, MessageQueueI
if (result != returnvalue::OK) {
return result;
}
sif::debug << "starting flash read" << std::endl;
sif::debug << "sequence count: " << sequenceCount.get() << std::endl;
plocMPSoCHelper->setSequenceCount(&sequenceCount);
result = plocMPSoCHelper->startFlashRead(flashReadPusCmd.getObcFile(),
flashReadPusCmd.getMPSoCFile(),
flashReadPusCmd.getReadSize());
specialComHelper->setSequenceCount(&sequenceCount);
result = specialComHelper->startFlashRead(flashReadPusCmd.getObcFile(),
flashReadPusCmd.getMPSoCFile(),
flashReadPusCmd.getReadSize());
if (result != returnvalue::OK) {
return result;
}
@ -790,10 +788,9 @@ ReturnValue_t PlocMpsocHandler::handleAckReport(const uint8_t* data) {
switch (apid) {
case mpsoc::apid::ACK_FAILURE: {
sif::debug << "PlocMPSoCHandler::handleAckReport: Received Ack failure report" << std::endl;
DeviceCommandId_t commandId = getPendingCommand();
uint16_t status = mpsoc::getStatusFromRawData(data);
sif::warning << "Verification report status: " << mpsoc::getStatusString(status) << std::endl;
sif::warning << "MPSoC ACK Failure: " << mpsoc::getStatusString(status) << std::endl;
if (commandId != DeviceHandlerIF::NO_COMMAND_ID) {
triggerEvent(ACK_FAILURE, commandId, status);
}
@ -835,15 +832,12 @@ ReturnValue_t PlocMpsocHandler::handleExecutionReport(const uint8_t* data) {
break;
}
case (mpsoc::apid::EXE_FAILURE): {
// TODO: Interpretation of status field in execution report
sif::warning << "PlocMPSoCHandler::handleExecutionReport: Received execution failure report"
<< std::endl;
DeviceCommandId_t commandId = getPendingCommand();
if (commandId == DeviceHandlerIF::NO_COMMAND_ID) {
sif::debug << "PlocMPSoCHandler::handleExecutionReport: Unknown command id" << std::endl;
}
uint16_t status = mpsoc::getStatusFromRawData(data);
sif::warning << "Verification report status: " << mpsoc::getStatusString(status) << std::endl;
sif::warning << "MPSoC EXE Failure: " << mpsoc::getStatusString(status) << std::endl;
triggerEvent(EXE_FAILURE, commandId, status);
sendFailureReport(mpsoc::EXE_REPORT, MPSoCReturnValuesIF::RECEIVED_EXE_FAILURE);
result = IGNORE_REPLY_DATA;

View File

@ -162,7 +162,7 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF {
SerialComIF* uartComIf = nullptr;
PlocMpsocSpecialComHelper* plocMPSoCHelper = nullptr;
PlocMpsocSpecialComHelper* specialComHelper = nullptr;
Gpio uartIsolatorSwitch;
object_id_t supervisorHandler = 0;
CommandActionHelper commandActionHelper;