- IEC 61850 server: reporting - fixed problem with removing old GI reports when latest report is also GI

pull/147/head
Michael Zillgith 7 years ago
parent a22f04e71e
commit 77c88dd0df

@ -2167,7 +2167,6 @@ removeAllGIReportsFromReportBuffer(ReportBuffer* reportBuffer)
} }
else { else {
lastReport->next = currentReport->next; lastReport->next = currentReport->next;
} }
#if (DEBUG_IED_SERVER == 1) #if (DEBUG_IED_SERVER == 1)
@ -2179,12 +2178,20 @@ removeAllGIReportsFromReportBuffer(ReportBuffer* reportBuffer)
if (reportBuffer->nextToTransmit == currentReport) if (reportBuffer->nextToTransmit == currentReport)
reportBuffer->nextToTransmit = currentReport->next; reportBuffer->nextToTransmit = currentReport->next;
currentReport = currentReport->next; if (reportBuffer->lastEnqueuedReport == currentReport) {
if (lastReport != NULL) {
reportBuffer->lastEnqueuedReport = lastReport;
}
else {
reportBuffer->lastEnqueuedReport = reportBuffer->oldestReport;
}
}
} }
else { else {
lastReport = currentReport; lastReport = currentReport;
currentReport = currentReport->next;
} }
currentReport = currentReport->next;
} }
if (reportBuffer->oldestReport == NULL) if (reportBuffer->oldestReport == NULL)

Loading…
Cancel
Save