diff --git a/src/iec61850/server/mms_mapping/reporting.c b/src/iec61850/server/mms_mapping/reporting.c index ea73a7d8..e8341ff7 100644 --- a/src/iec61850/server/mms_mapping/reporting.c +++ b/src/iec61850/server/mms_mapping/reporting.c @@ -2104,6 +2104,8 @@ enqueueReport(ReportControl* reportControl, bool isIntegrity, bool isGI, uint64_ ReportBufferEntry* entry = (ReportBufferEntry*) entryBufPos; + entry->timeOfEntry = timeOfEntry; + if (isBuffered) { /* ENTRY_ID is set to system time in ms! */ uint64_t entryId = timeOfEntry; @@ -2111,8 +2113,6 @@ enqueueReport(ReportControl* reportControl, bool isIntegrity, bool isGI, uint64_ if (entryId <= reportControl->lastEntryId) entryId = reportControl->lastEntryId + 1; - entry->timeOfEntry = entryId; - #if (ORDER_LITTLE_ENDIAN == 1) memcpyReverseByteOrder(entry->entryId, (uint8_t*) &entryId, 8); #else