diff --git a/linux/payload/FreshSupvHandler.cpp b/linux/payload/FreshSupvHandler.cpp index eefd64af..b872f41c 100644 --- a/linux/payload/FreshSupvHandler.cpp +++ b/linux/payload/FreshSupvHandler.cpp @@ -85,7 +85,7 @@ void FreshSupvHandler::performDeviceOperation(uint8_t opCode) { } } else if (opCode == OpCode::PARSE_TM) { for (auto& activeCmd : activeActionCmds) { - if (activeCmd.second.cmdCountdown.hasTimedOut()) { + if (activeCmd.second.isPending and activeCmd.second.cmdCountdown.hasTimedOut()) { if (activeCmd.second.commandedBy != MessageQueueIF::NO_QUEUE) { actionHelper.finish(false, activeCmd.second.commandedBy, activeCmd.first, DeviceHandlerIF::TIMEOUT); @@ -238,6 +238,11 @@ ReturnValue_t FreshSupvHandler::executeAction(ActionId_t actionId, MessageQueueI default: break; } + // This might not be necessary, but I think the PLOC SUPV is not able to process multiple + // commands consecutively.. + if (isCommandPending()) { + return HasActionsIF::IS_BUSY; + } if (isCommandAlreadyActive(actionId)) { return HasActionsIF::IS_BUSY; } @@ -543,8 +548,9 @@ ReturnValue_t FreshSupvHandler::sendCommand(DeviceCommandId_t commandId, TcBase& auto activeCmdIter = activeActionCmds.find(buildActiveCmdKey(tc.getModuleApid(), tc.getServiceId())); if (activeCmdIter == activeActionCmds.end()) { + info.isPending = true; + info.replyPacketExpected = replyExpected; activeActionCmds.emplace(buildActiveCmdKey(tc.getModuleApid(), tc.getServiceId()), info); - } else { if (activeCmdIter->second.isPending) { return HasActionsIF::IS_BUSY; diff --git a/linux/payload/PlocSupvUartMan.cpp b/linux/payload/PlocSupvUartMan.cpp index 7cde1463..f73ca560 100644 --- a/linux/payload/PlocSupvUartMan.cpp +++ b/linux/payload/PlocSupvUartMan.cpp @@ -1061,6 +1061,7 @@ ReturnValue_t PlocSupvUartManager::parseRecRingBufForHdlc(size_t& readSize, size triggerEvent(HDLC_CRC_ERROR); } if (retval != 0) { + readSize = ++idx; return HDLC_ERROR; } return returnvalue::OK;