From bb383b308dc820b62bb0c89c3853eba72ec1a786 Mon Sep 17 00:00:00 2001 From: athatheocsd <athatheo@csd.auth.gr> Date: Mon, 7 Jan 2019 20:02:51 +0200 Subject: [PATCH] Changed eventActionFunctionStatus from enum to boolean --- inc/Services/EventActionService.hpp | 11 ++++------- src/Services/EventActionService.cpp | 6 +++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/inc/Services/EventActionService.hpp b/inc/Services/EventActionService.hpp index d120fe29..48d37ff1 100644 --- a/inc/Services/EventActionService.hpp +++ b/inc/Services/EventActionService.hpp @@ -39,16 +39,13 @@ public: public: EventActionService() { serviceType = 19; - eventActionFunctionStatus = enabledFunction; + eventActionFunctionStatus = true; } /** * Event-action function status */ - enum EventActionFunctionStatus { - disabledFunction = 0, - enabledFunction = 1, - }; + bool enabledActionFunctionStatus; /** * TC[19,1] add event-action definitions @@ -108,8 +105,8 @@ public: /** * Setter for event-action function status */ - void setEventActionFunctionStatus(EventActionFunctionStatus e) { - eventActionFunctionStatus = e; + void setEventActionFunctionStatus(bool status) { + eventActionFunctionStatus = status; } }; diff --git a/src/Services/EventActionService.cpp b/src/Services/EventActionService.cpp index cc670962..e6207045 100644 --- a/src/Services/EventActionService.cpp +++ b/src/Services/EventActionService.cpp @@ -148,7 +148,7 @@ void EventActionService::enableEventActionFunction(Message message) { // TC[19,8] if (message.messageType == 8 && message.packetType == Message::TC && message.serviceType == 19) { - setEventActionFunctionStatus(EventActionFunctionStatus::enabledFunction); + setEventActionFunctionStatus(true); } } @@ -156,7 +156,7 @@ void EventActionService::disableEventActionFunction(Message message) { // TC[19,9] if (message.messageType == 9 && message.packetType == Message::TC && message.serviceType == 19) { - setEventActionFunctionStatus(EventActionFunctionStatus::disabledFunction); + setEventActionFunctionStatus(false); } } @@ -164,7 +164,7 @@ void EventActionService::disableEventActionFunction(Message message) { // Should I use applicationID too? void EventActionService::executeAction(uint16_t eventID) { // Custom function - if (eventActionFunctionStatus == enabledFunction) { + if (eventActionFunctionStatus) { uint16_t i = 0; while (i < 256) { if (eventActionDefinitionArray[i].empty == false && -- GitLab