diff --git a/inc/Services/EventActionService.hpp b/inc/Services/EventActionService.hpp index 19886d5c8460650effd566d525b278d89a3b54e1..9a542fa7a9aec8717af0192e57426f080c278e0e 100644 --- a/inc/Services/EventActionService.hpp +++ b/inc/Services/EventActionService.hpp @@ -40,7 +40,7 @@ public: EventActionService() { serviceType = 19; eventActionFunctionStatus = enabledFunction; - stateOfEventAction.reset(); + stateOfEventAction.set(); } /** diff --git a/src/Services/EventActionService.cpp b/src/Services/EventActionService.cpp index a8feab201f897836b98e812c3aed180315c81f77..3fb2659dec6d9e53598e5265249171f7ea48da31 100644 --- a/src/Services/EventActionService.cpp +++ b/src/Services/EventActionService.cpp @@ -85,7 +85,7 @@ void EventActionService::enableEventActionDefinitions(Message message) { uint16_t eventDefinitionID = message.readEnum16(); while (index<255){ if (eventActionDefinitionArray[index].applicationId == applicationID && - eventActionDefinitionArray[index].eventDefinitionID== eventDefinitionID) { + eventActionDefinitionArray[index].eventDefinitionID == eventDefinitionID) { stateOfEventAction[index] = 1; } index++; @@ -106,7 +106,7 @@ void EventActionService::disableEventActionDefinitions(Message message) { uint16_t eventDefinitionID = message.readEnum16(); while (index<255){ if (eventActionDefinitionArray[index].applicationId == applicationID && - eventActionDefinitionArray[index].eventDefinitionID== eventDefinitionID) { + eventActionDefinitionArray[index].eventDefinitionID == eventDefinitionID) { stateOfEventAction[index] = 0; } index++; diff --git a/test/Services/EventActionService.cpp b/test/Services/EventActionService.cpp index f088322a8408dffd72bd0dd7627d10ef17628eaf..0264a3fd83dda9b7af17308a0bb312642852a688 100644 --- a/test/Services/EventActionService.cpp +++ b/test/Services/EventActionService.cpp @@ -170,7 +170,26 @@ TEST_CASE("Enable event-action definitions TC[19,4]", "[service][st09]") { } TEST_CASE("Disable event-action definitions TC[19,5]", "[service][st09]") { - + EventActionService eventActionService; + Message message0(19, 1, Message::TC, 0); + message0.appendEnum16(1); + message0.appendEnum16(0); + String<64> data = "0"; + message0.appendString(data); + eventActionService.addEventActionDefinitions(message0); + Message message1(19, 1, Message::TC, 0); + message1.appendEnum16(1); + message1.appendEnum16(0); + data = "00"; + message1.appendString(data); + eventActionService.addEventActionDefinitions(message1); + Message message2(19, 5, Message::TC, 0); + message2.appendUint16(1); + message2.appendEnum16(1); + message2.appendEnum16(0); + eventActionService.disableEventActionDefinitions(message2); + CHECK(eventActionService.stateOfEventAction[0] == 0); + CHECK(eventActionService.stateOfEventAction[1] == 0); } TEST_CASE("Request event-action definition status TC[19,6]", "[service][st09]") {