diff --git a/inc/Services/EventReportService.hpp b/inc/Services/EventReportService.hpp index 5d17779bf78e0bfa7a59437688e3de938db81ed3..3b2c2bdd82502d57fb964a3a3ff7a10a686b524e 100644 --- a/inc/Services/EventReportService.hpp +++ b/inc/Services/EventReportService.hpp @@ -2,6 +2,7 @@ #define ECSS_SERVICES_EVENTREPORTSERVICE_HPP #include "Service.hpp" +#include <Services/EventActionService.hpp> // Not sure if this is needed here or just in .cpp file #include <bitset> /** * Implementation of ST[05] event reporting service diff --git a/src/Services/EventReportService.cpp b/src/Services/EventReportService.cpp index f0326119bfd473332673265aa1e6635d7f0477d3..8190f87f9900a7846c112fdbaafd894260445b53 100644 --- a/src/Services/EventReportService.cpp +++ b/src/Services/EventReportService.cpp @@ -1,5 +1,5 @@ #include <Services/EventReportService.hpp> -#include "Services/EventReportService.hpp" +#include <Services/EventActionService.hpp> #include "Message.hpp" /** @@ -14,6 +14,8 @@ void EventReportService::informativeEventReport(Event eventID, String<64> data) report.appendString(data); storeMessage(report); + EventActionService eventActionService; + eventActionService.executeAction(eventID); } } @@ -29,6 +31,8 @@ EventReportService::lowSeverityAnomalyReport(Event eventID, String<64> data) { lastLowSeverityReportID = static_cast<uint16_t >(eventID); storeMessage(report); + EventActionService eventActionService; + eventActionService.executeAction(eventID); } } @@ -43,6 +47,8 @@ void EventReportService::mediumSeverityAnomalyReport(Event eventID, String<64> d lastMediumSeverityReportID = static_cast<uint16_t >(eventID); storeMessage(report); + EventActionService eventActionService; + eventActionService.executeAction(eventID); } } @@ -58,6 +64,8 @@ EventReportService::highSeverityAnomalyReport(Event eventID, String<64> data) { lastHighSeverityReportID = static_cast<uint16_t >(eventID); storeMessage(report); + EventActionService eventActionService; + eventActionService.executeAction(eventID); } } diff --git a/test/MessageParser.cpp b/test/MessageParser.cpp index 25265d55137c85cdb7fbdbf1796cafb3d6d1f1f5..d06d7c2570cb9d036c7e1c01db5ba09a25fdf4bf 100644 --- a/test/MessageParser.cpp +++ b/test/MessageParser.cpp @@ -78,3 +78,7 @@ TEST_CASE("TC message parsing", "[MessageParser]") { CHECK(message.messageType == 31); CHECK(memcmp(message.data, "hello", 5) == 0); } + +TEST_CASE("TC data parsing into a message", "[MessageParser]") { + +}