diff --git a/CMakeLists.txt b/CMakeLists.txt index d25e161adf5dc35089d8dde1b20b9d7af1bb3ec5..c8b7254b83f55823550e813f4e8c5e84be13a8fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,6 @@ IF (EXISTS "${PROJECT_SOURCE_DIR}/lib/Catch2/CMakeLists.txt") add_executable(tests $<TARGET_OBJECTS:common> ${test_main_SRC} - ${test_SRC}) + ${test_SRC} test/Services/EventActionService.cpp) target_link_libraries(tests Catch2::Catch2) ENDIF () diff --git a/inc/Services/EventActionService.hpp b/inc/Services/EventActionService.hpp index 59cc86937e06234bb28b268ee20b83b93a3b3cd1..22f94e492b8626526597383cb95137680978ff9a 100644 --- a/inc/Services/EventActionService.hpp +++ b/inc/Services/EventActionService.hpp @@ -97,7 +97,7 @@ public: * Custom function that is called right after an event takes place, to initiate * the execution of the action */ - void executeAction(); + void execute(Message &message); /** * Setter for event-action function status @@ -105,6 +105,11 @@ public: void setEventActionFunctionStatus(EventActionFunctionStatus e) { eventActionFunctionStatus = e; } + + /** + * The purpose of this instance is to access the execute function + */ + static EventActionService instance; }; #endif //ECSS_SERVICES_EVENTACTIONSERVICE_HPP diff --git a/src/MessageParser.cpp b/src/MessageParser.cpp index fe2426e5d394ca2d63e6036793417267e645ad47..f9b0394c53ba5f67d5e2f257fc5bd00b0ce2d670 100644 --- a/src/MessageParser.cpp +++ b/src/MessageParser.cpp @@ -1,4 +1,5 @@ #include <cstring> +#include <Services/EventActionService.hpp> #include "ErrorHandler.hpp" #include "MessageParser.hpp" #include "macros.hpp" @@ -7,6 +8,7 @@ TestService TestService::instance; RequestVerificationService RequestVerificationService::instance; +EventActionService EventActionService::instance; void MessageParser::execute(Message &message) { switch (message.serviceType) { @@ -16,6 +18,8 @@ void MessageParser::execute(Message &message) { case 17: TestService::instance.execute(message); break; + case 19: + EventActionService::instance.execute(message); default: // cout is very bad for embedded systems std::cout << "This service hasn't been implemented yet or it doesn't exist"; diff --git a/src/Services/EventActionService.cpp b/src/Services/EventActionService.cpp index c26e07c7a5cc242caf38fe894341a1597b23a5b4..497d3aa8ab95cf97d9be2ff66fc462a899d8b3a0 100644 --- a/src/Services/EventActionService.cpp +++ b/src/Services/EventActionService.cpp @@ -171,7 +171,7 @@ void EventActionService::disableEventActionFunction(Message message) { } } -void EventActionService::executeAction() { +void EventActionService::execute(Message &message) { // Custom function if (eventActionFunctionStatus == enabledFunction) { diff --git a/test/Services/EventActionService.cpp b/test/Services/EventActionService.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e783b1a1643eec5f17063eea67a0b221ee4b5174 --- /dev/null +++ b/test/Services/EventActionService.cpp @@ -0,0 +1,41 @@ +#include <catch2/catch.hpp> +#include <Services/EventActionService.hpp> +#include <Message.hpp> +#include "ServiceTests.hpp" +#include <cstring> + +TEST_CASE("Add event-action definitions TC[19,1]", "[service][st09]") { + +} + +TEST_CASE("Delete event-action definitions TC[19,2]", "[service][st09]") { + +} + +TEST_CASE("Delete all event-action definitions TC[19,3]", "[service][st09]") { + +} + +TEST_CASE("Enable event-action definitions TC[19,4]", "[service][st09]") { + +} + +TEST_CASE("Disable event-action definitions TC[19,5]", "[service][st09]") { + +} + +TEST_CASE("Request event-action definition status TC[19,6]", "[service][st09]") { + +} + +TEST_CASE("Event-action status report TM[19,7]", "[service][st09]") { + +} + +TEST_CASE("Enable event-action function TC[19,8]", "[service][st09]") { + +} + +TEST_CASE("Disable event-action function TC[19,1]", "[service][st09]") { + +} diff --git a/test/Services/EventReportService.cpp b/test/Services/EventReportService.cpp index 0bf8133a30947c79942c360fc9f4db86c98c0143..ca90bee5d782856869384041d48f13d13054c694 100644 --- a/test/Services/EventReportService.cpp +++ b/test/Services/EventReportService.cpp @@ -5,7 +5,7 @@ #include <cstring> /* - * @todo Change the reinterpret_cast + * @todo: Change the reinterpret_cast */ TEST_CASE("Informative Event Report TM[5,1]", "[service][st05]") { EventReportService eventReportService;