diff --git a/inc/Services/RequestVerificationService.hpp b/inc/Services/RequestVerificationService.hpp index 8e6d2635be5546ca2394299cb7c2cbbd84a01b21..a664e1147414260a3ca07118670f58d0869dc28b 100644 --- a/inc/Services/RequestVerificationService.hpp +++ b/inc/Services/RequestVerificationService.hpp @@ -28,7 +28,7 @@ public: * of the telecommand packet that accepted successfully * */ - void successAcceptanceVerification(Message &request); + void successAcceptanceVerification(const Message &request); /** * TM[1,2] failed acceptance verification report @@ -37,7 +37,7 @@ public: * The data is actually some data members of Message that contain the basic * info of the telecommand packet that failed to be accepted */ - void failAcceptanceVerification(Message &request); + void failAcceptanceVerification(const Message &request); /** @@ -48,7 +48,7 @@ public: * telecommand packet that executed successfully * */ - void successExecutionVerification(Message &request); + void successExecutionVerification(const Message &request); /** * TM[1,8] failed completion of execution verification report @@ -58,7 +58,7 @@ public: * telecommand packet that failed to be executed * */ - void failExecutionVerification(Message &request); + void failExecutionVerification(const Message &request); /** * TM[1,10] failed routing verification report @@ -68,7 +68,7 @@ public: * telecommand packet that failed the routing * */ - void failRoutingVerification(Message &request); + void failRoutingVerification(const Message &request); /** * It is responsible to call the suitable function that execute the proper subservice. The @@ -79,7 +79,7 @@ public: * * @todo Error handling for the switch() in the implementation of this execute function */ - void execute(Message &message); + void execute(const Message &message); /** * The purpose of this instance is to access the execute function of this service when a diff --git a/lib/Catch2 b/lib/Catch2 index 62460fafe6b54c3173bc5cbc46d05a5f071017ff..77f29c2f1cde8bd2e17f06cc04092b990d2acc2c 160000 --- a/lib/Catch2 +++ b/lib/Catch2 @@ -1 +1 @@ -Subproject commit 62460fafe6b54c3173bc5cbc46d05a5f071017ff +Subproject commit 77f29c2f1cde8bd2e17f06cc04092b990d2acc2c diff --git a/src/ErrorHandler.cpp b/src/ErrorHandler.cpp index d278b1edcd06e67b2c24faea34c6b9f45f0975df..d689ab1a1835c08c4a2908c6822cd1513b3ac422 100644 --- a/src/ErrorHandler.cpp +++ b/src/ErrorHandler.cpp @@ -9,42 +9,21 @@ static RequestVerificationService requestVerificationService; template<> void ErrorHandler::reportError(const Message &message, AcceptanceErrorType errorCode) { - requestVerificationService.failAcceptanceVerification( - message.packetType, - true, - message.applicationId, - ECSS_SEQUENCE_FLAGS, - message.packetSequenceCount, - static_cast<uint16_t>(errorCode) - ); + requestVerificationService.failAcceptanceVerification(message); logError(message, errorCode); } template<> void ErrorHandler::reportError(const Message &message, ExecutionErrorType errorCode) { - requestVerificationService.failExecutionVerification( - message.packetType, - true, - message.applicationId, - ECSS_SEQUENCE_FLAGS, - message.packetSequenceCount, - static_cast<uint16_t>(errorCode) - ); + requestVerificationService.failExecutionVerification(message); logError(message, errorCode); } template<> void ErrorHandler::reportError(const Message &message, RoutingErrorType errorCode) { - requestVerificationService.failRoutingVerification( - message.packetType, - true, - message.applicationId, - ECSS_SEQUENCE_FLAGS, - message.packetSequenceCount, - static_cast<uint16_t>(errorCode) - ); + requestVerificationService.failRoutingVerification(message); logError(message, errorCode); } diff --git a/src/Services/RequestVerificationService.cpp b/src/Services/RequestVerificationService.cpp index f3029fcd5b655f97d89f8693be4d686571537aab..0e08b3e71ab47f462a306a8c7c2bde193a68a9dc 100644 --- a/src/Services/RequestVerificationService.cpp +++ b/src/Services/RequestVerificationService.cpp @@ -1,7 +1,7 @@ #include "Services/RequestVerificationService.hpp" #include "Message.hpp" -void RequestVerificationService::successAcceptanceVerification(Message &request) { +void RequestVerificationService::successAcceptanceVerification(const Message &request) { // TM[1,1] successful acceptance verification report Message report = createTM(1); @@ -17,7 +17,7 @@ void RequestVerificationService::successAcceptanceVerification(Message &request) } void -RequestVerificationService::failAcceptanceVerification(Message &request) { +RequestVerificationService::failAcceptanceVerification(const Message &request) { // TM[1,2] failed acceptance verification report Message report = createTM(2); @@ -33,7 +33,7 @@ RequestVerificationService::failAcceptanceVerification(Message &request) { storeMessage(report); } -void RequestVerificationService::successExecutionVerification(Message &request) { +void RequestVerificationService::successExecutionVerification(const Message &request) { // TM[1,7] successful completion of execution verification report Message report = createTM(7); @@ -49,7 +49,7 @@ void RequestVerificationService::successExecutionVerification(Message &request) } void -RequestVerificationService::failExecutionVerification(Message &request) { +RequestVerificationService::failExecutionVerification(const Message &request) { // TM[1,8] failed completion of execution verification report Message report = createTM(8); @@ -66,7 +66,7 @@ RequestVerificationService::failExecutionVerification(Message &request) { } void -RequestVerificationService::failRoutingVerification(Message &request) { +RequestVerificationService::failRoutingVerification(const Message &request) { // TM[1,10] failed routing verification report Message report = createTM(10); @@ -82,7 +82,7 @@ RequestVerificationService::failRoutingVerification(Message &request) { storeMessage(report); } -void RequestVerificationService::execute(Message &message) { +void RequestVerificationService::execute(const Message &message) { switch (message.messageType) { case 1: successAcceptanceVerification(message);