From 52ce85dc85ef801fd06b9e1d2d1635865b62bb39 Mon Sep 17 00:00:00 2001
From: athatheocsd <athatheo@csd.auth.gr>
Date: Tue, 11 Dec 2018 16:07:30 +0200
Subject: [PATCH] added another observable

---
 inc/Services/EventReportService.hpp | 5 +++++
 src/Services/EventReportService.cpp | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/inc/Services/EventReportService.hpp b/inc/Services/EventReportService.hpp
index 52a2b517..b8f27ec8 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 f30a875b..8c8833c9 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);
 }
-- 
GitLab