From 0f3563643d3a339645aa70c71db382479b5a4e17 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Wed, 7 Sep 2022 23:43:32 +0200 Subject: [PATCH] - fixed - server scrahs when SyncIntegrityReportTimes in active and IntgPd=0 (LIB61850-355) --- src/iec61850/server/mms_mapping/reporting.c | 33 ++++++++++++++------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/iec61850/server/mms_mapping/reporting.c b/src/iec61850/server/mms_mapping/reporting.c index d26bff8c..a18d91b6 100644 --- a/src/iec61850/server/mms_mapping/reporting.c +++ b/src/iec61850/server/mms_mapping/reporting.c @@ -968,11 +968,18 @@ refreshIntegrityPeriod(ReportControl* rc) #endif if (rc->buffered == false) { - if (rc->server->syncIntegrityReportTimes) { - rc->nextIntgReportTime = getNextRoundedStartTime(Hal_getTimeInMs(), rc->intgPd); - } - else { - rc->nextIntgReportTime = Hal_getTimeInMs() + rc->intgPd; + + if (rc->triggerOps & TRG_OPT_INTEGRITY) { + + if (rc->intgPd > 0) { + + if (rc->server->syncIntegrityReportTimes) { + rc->nextIntgReportTime = getNextRoundedStartTime(Hal_getTimeInMs(), rc->intgPd); + } + else { + rc->nextIntgReportTime = Hal_getTimeInMs() + rc->intgPd; + } + } } } } @@ -2159,11 +2166,17 @@ Reporting_RCBWriteAccessHandler(MmsMapping* self, ReportControl* rc, char* eleme if (rc->buffered) { - if (rc->server->syncIntegrityReportTimes) { - rc->nextIntgReportTime = getNextRoundedStartTime(Hal_getTimeInMs(), rc->intgPd); - } - else { - rc->nextIntgReportTime = 0; + if (rc->triggerOps & TRG_OPT_INTEGRITY) { + + if (rc->intgPd > 0) { + + if (rc->server->syncIntegrityReportTimes) { + rc->nextIntgReportTime = getNextRoundedStartTime(Hal_getTimeInMs(), rc->intgPd); + } + else { + rc->nextIntgReportTime = 0; + } + } } purgeBuf(rc);