diff --git a/inc/Message.hpp b/inc/Message.hpp index 0d4aa67d8e47cd6ee6045a48015991f93d78bf3d..f42b7a3c43a2e5d5197031574ab857dc018f2797 100644 --- a/inc/Message.hpp +++ b/inc/Message.hpp @@ -20,6 +20,8 @@ class Message; */ class Message { public: + Message (){} + enum PacketType { TM = 0, // Telemetry TC = 1 // Telecommand diff --git a/inc/MessageParser.hpp b/inc/MessageParser.hpp index 9de268e461bfdb2f872a6b6a6b4fe1822708434e..a8cbaa4c3fca35d4d48469718474acd3759c2844 100644 --- a/inc/MessageParser.hpp +++ b/inc/MessageParser.hpp @@ -37,6 +37,17 @@ public: */ Message parse(uint8_t * data, uint32_t length); + /** + * @todo: elaborate on this comment + * Create a message so that a string can be parsed + */ + Message parseTC(String<256> data, ){ + Message message; + message.packetType = Message::TC; + parseTC(data, 15, message); + return message; + } + private: /** * Parse the ECSS Telecommand packet secondary header diff --git a/inc/Services/EventActionService.hpp b/inc/Services/EventActionService.hpp index 22f94e492b8626526597383cb95137680978ff9a..a355be1df790057d66e0312d37ca0a4fb4731350 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 execute(Message &message); + void executeAction(Message &message); /** * Setter for event-action function status @@ -105,11 +105,6 @@ 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 f9b0394c53ba5f67d5e2f257fc5bd00b0ce2d670..b27ee17973e6c266dff3f2c01012924059af31af 100644 --- a/src/MessageParser.cpp +++ b/src/MessageParser.cpp @@ -8,7 +8,6 @@ TestService TestService::instance; RequestVerificationService RequestVerificationService::instance; -EventActionService EventActionService::instance; void MessageParser::execute(Message &message) { switch (message.serviceType) { @@ -18,8 +17,6 @@ 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 497d3aa8ab95cf97d9be2ff66fc462a899d8b3a0..51fb07503859e2fcdefa26eab9e4335bc064dc2d 100644 --- a/src/Services/EventActionService.cpp +++ b/src/Services/EventActionService.cpp @@ -170,7 +170,7 @@ void EventActionService::disableEventActionFunction(Message message) { setEventActionFunctionStatus(EventActionFunctionStatus::disabledFunction); } } - +// Should I use the name execute here instead of executeAction? void EventActionService::execute(Message &message) { // Custom function if (eventActionFunctionStatus == enabledFunction) {