PLOC SUPV extensions #821

Merged
muellerr merged 45 commits from ploc-supv-extensions into main 2023-11-29 14:52:09 +01:00
2 changed files with 9 additions and 2 deletions
Showing only changes of commit cae76e17f5 - Show all commits

View File

@ -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;

View File

@ -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;