diff --git a/inc/Services/TimeBasedSchedulingService.hpp b/inc/Services/TimeBasedSchedulingService.hpp index cc7e119a8615dc5ca959d4d00710bd915b9da420..e3a6b7721a0e056fac509cb54a1db5c18dbcdbba 100644 --- a/inc/Services/TimeBasedSchedulingService.hpp +++ b/inc/Services/TimeBasedSchedulingService.hpp @@ -54,8 +54,6 @@ private: */ bool executionFunctionStatus = false; // True indicates "enabled" and False "disabled" state - MessageParser msgParser; // Parse TC packets - /** * @brief Request identifier of the received packet * diff --git a/src/Services/EventActionService.cpp b/src/Services/EventActionService.cpp index 26e67d0d4195617590daffcd5f0e48df5f6240d5..bd06114d32b917eab4f894c077a1331474c2dc43 100644 --- a/src/Services/EventActionService.cpp +++ b/src/Services/EventActionService.cpp @@ -180,8 +180,7 @@ void EventActionService::executeAction(uint16_t eventID) { auto range = eventActionDefinitionMap.equal_range(eventID); for (auto& element = range.first; element != range.second; ++element) { if (element->second.enabled) { - MessageParser messageParser; - Message message = messageParser.parseECSSTC(element->second.request); + Message message = MessageParser::parseECSSTC(element->second.request); MessageParser::execute(message); } } diff --git a/src/Services/TimeBasedSchedulingService.cpp b/src/Services/TimeBasedSchedulingService.cpp index d917585ec826b9919398b461980ce03645788b4b..d381318e8adb84d14eeea958713104d5d712ef74 100644 --- a/src/Services/TimeBasedSchedulingService.cpp +++ b/src/Services/TimeBasedSchedulingService.cpp @@ -49,7 +49,7 @@ void TimeBasedSchedulingService::insertActivities(Message& request) { // Get the TC packet request uint8_t requestData[ECSS_TC_REQUEST_STRING_SIZE] = {0}; request.readString(requestData, ECSS_TC_REQUEST_STRING_SIZE); - Message receivedTCPacket = msgParser.parseECSSTC(requestData); + Message receivedTCPacket = MessageParser::parseECSSTC(requestData); ScheduledActivity newActivity; // Create the new activity // Assign the attributes to the newly created activity @@ -168,7 +168,7 @@ void TimeBasedSchedulingService::detailReportAllActivities(Message& request) { // todo: append sub-schedule and group ID if they are defined report.appendUint32(activity.requestReleaseTime); - report.appendString(msgParser.composeECSS(activity.request)); + report.appendString(MessageParser::composeECSS(activity.request)); } storeMessage(report); // Save the report } @@ -209,7 +209,7 @@ void TimeBasedSchedulingService::detailReportActivitiesByID(Message& request) { report.appendUint16(static_cast<uint16_t>(matchedActivities.size())); for (auto& match : matchedActivities) { report.appendUint32(match.requestReleaseTime); // todo: Replace with the time parser - report.appendString(msgParser.composeECSS(match.request)); + report.appendString(MessageParser::composeECSS(match.request)); } storeMessage(report); // Save the report }