diff --git a/inc/Services/EventReportService.hpp b/inc/Services/EventReportService.hpp index 52a2b51798b1065681592a169074d72739f9398b..b8f27ec8aab12e884280211bb544e47c845f2104 100644 --- a/inc/Services/EventReportService.hpp +++ b/inc/Services/EventReportService.hpp @@ -27,6 +27,11 @@ public: uint16_t disabledEventsCount; + uint16_t lastInformativeEventReportID; + uint16_t lastLowSeverityReportID; + uint16_t lastMediumSeverityReportID; + uint16_t lastHighSeverityReportID; + EventReportService() { stateOfEvents.set(); serviceType = 5; diff --git a/src/Services/EventReportService.cpp b/src/Services/EventReportService.cpp index f30a875bd36d15224ed1e7fb2e6d167f982aad39..8c8833c9a39913730ed1361513b2b7f650079068 100644 --- a/src/Services/EventReportService.cpp +++ b/src/Services/EventReportService.cpp @@ -12,6 +12,7 @@ void EventReportService::informativeEventReport(Event eventID, const uint8_t *da Message report = createTM(1); report.appendEnum16(eventID); report.appendString(length, data); + lastInformativeEventReportID = static_cast<uint16_t >(eventID); storeMessage(report); } @@ -24,6 +25,7 @@ EventReportService::lowSeverityAnomalyReport(Event eventID, const uint8_t *data, Message report = createTM(2); report.appendEnum16(eventID); report.appendString(length, data); + lastLowSeverityReportID = static_cast<uint16_t >(eventID); storeMessage(report); } @@ -35,6 +37,7 @@ void EventReportService::mediumSeverityAnomalyReport(Event eventID, Message report = createTM(3); report.appendEnum16(eventID); report.appendString(length, data); + lastMediumSeverityReportID = static_cast<uint16_t >(eventID); storeMessage(report); } @@ -47,6 +50,7 @@ EventReportService::highSeverityAnomalyReport(Event eventID, const uint8_t *data Message report = createTM(4); report.appendEnum16(eventID); report.appendString(length, data); + lastHighSeverityReportID = static_cast<uint16_t >(eventID); storeMessage(report); }