diff --git a/inc/Services/RequestVerificationService.hpp b/inc/Services/RequestVerificationService.hpp index d3677810ff479b2991e049bf95c5220c5d6068f7..f1d2bf9210a97e69bd6f2f6e2938bb1bd4ddb7e9 100644 --- a/inc/Services/RequestVerificationService.hpp +++ b/inc/Services/RequestVerificationService.hpp @@ -7,7 +7,8 @@ * Implementation of the ST[01] request verification service * * @todo All telemetry packets shall have a telemetry packet secondary header - * @todo See if it would be more efficient to use Messages as arguments instead of individual parameters + * @todo See if it would be more efficient to use Messages as arguments instead of individual + * parameters */ class RequestVerificationService : public Service { public: @@ -17,12 +18,28 @@ public: /** * TM[1,1] successful acceptance verification report + * Send report when the Cubesat accepts successfully commands + * + * Note:The parameters are the necessary information, defined from the standard, that the report + * should contain + * + * @param apid Application process ID + * @param seqFlag Sequence flags + * @param packetSeqCount Packet sequence count */ void successAcceptanceVerification(Message::PacketType packetType, bool secondaryHeaderFlag, uint16_t apid, uint8_t seqFlag, uint16_t packetSeqCount); /** * TM[1,2] failed acceptance verification report + *Send report when the Cubesat don't accept commands + * + * Note:The parameters are the necessary information, defined from the standard, that the report + * should contain + * + * @param apid Application process ID + * @param seqFlag Sequence flags + * @param packetSeqCount Packet sequence count */ void failAcceptanceVerification(Message::PacketType packetType, bool secondaryHeaderFlag, uint16_t apid, uint8_t seqFlag, uint16_t packetSeqCount, @@ -31,12 +48,28 @@ public: /** * TM[1,7] successful completion of execution verification report + * Send report when the Cubesat completes an execution + * + * Note:The parameters are the necessary information, defined from the standard, that the report + * should contain + * + * @param apid Application process ID + * @param seqFlag Sequence flags + * @param packetSeqCount Packet sequence count */ void successExecutionVerification(Message::PacketType packetType, bool secondaryHeaderFlag, uint16_t apid, uint8_t seqFlag, uint16_t packetSeqCount); /** * TM[1,8] failed completion of execution verification report + * Send report when the Cubesat don't complete an execution + * + * Note:The parameters are the necessary information, defined from the standard, that the report + * should contain + * + * @param apid Application process ID + * @param seqFlag Sequence flags + * @param packetSeqCount Packet sequence count */ void failExecutionVerification(Message::PacketType packetType, bool secondaryHeaderFlag, @@ -45,6 +78,14 @@ public: /** * TM[1,10] failed routing verification report + * Send report when the routing of a request has failed + * + * Note:The parameters are the necessary information, defined from the standard, that the report + * should contain + * + * @param apid Application process ID + * @param seqFlag Sequence flags + * @param packetSeqCount Packet sequence count */ void failRoutingVerification(Message::PacketType packetType, bool secondaryHeaderFlag, diff --git a/src/Services/RequestVerificationService.cpp b/src/Services/RequestVerificationService.cpp index c2750a3f01d956965bad933a8204079f4e7d714b..142eca7e41b7a5e718d15e241a3958e24f9ca2fd 100644 --- a/src/Services/RequestVerificationService.cpp +++ b/src/Services/RequestVerificationService.cpp @@ -6,6 +6,8 @@ void RequestVerificationService::successAcceptanceVerification(Message::PacketTy uint16_t apid, uint8_t seqFlag, uint16_t packetSeqCount) { // TM[1,1] successful acceptance verification report + + //parameters have max values defined from standard assert(apid < 2048); assert(seqFlag < 4); assert(packetSeqCount < 16384); @@ -29,6 +31,8 @@ RequestVerificationService::failAcceptanceVerification(Message::PacketType packe uint16_t packetSeqCount, uint16_t errorCode) { // TM[1,2] failed acceptance verification report + + //parameters have max values defined from standard assert(apid < 2048); assert(seqFlag < 4); assert(packetSeqCount < 16384); @@ -41,7 +45,7 @@ RequestVerificationService::failAcceptanceVerification(Message::PacketType packe report.appendEnumerated(11, apid); report.appendEnumerated(2, seqFlag); report.appendBits(14, packetSeqCount); - report.appendUint16(errorCode); + report.appendEnum16(errorCode); storeMessage(report); } @@ -51,6 +55,8 @@ void RequestVerificationService::successExecutionVerification(Message::PacketTyp uint16_t apid, uint8_t seqFlag, uint16_t packetSeqCount) { // TM[1,7] successful completion of execution verification report + + //parameters have max values defined from standard assert(apid < 2048); assert(seqFlag < 4); assert(packetSeqCount < 16384); @@ -74,6 +80,8 @@ RequestVerificationService::failExecutionVerification(Message::PacketType packet uint16_t packetSeqCount, uint16_t errorCode) { // TM[1,8] failed completion of execution verification report + + //parameters have max values defined from standard assert(apid < 2048); assert(seqFlag < 4); assert(packetSeqCount < 16384); @@ -86,7 +94,7 @@ RequestVerificationService::failExecutionVerification(Message::PacketType packet report.appendEnumerated(11, apid); report.appendEnumerated(2, seqFlag); report.appendBits(14, packetSeqCount); - report.appendUint16(errorCode); + report.appendEnum16(errorCode); storeMessage(report); } @@ -98,6 +106,8 @@ RequestVerificationService::failRoutingVerification(Message::PacketType packetTy uint16_t packetSeqCount, uint16_t errorCode) { // TM[1,10] failed routing verification report + + //parameters have max values defined from standard assert(apid < 2048); assert(seqFlag < 4); assert(packetSeqCount < 16384); @@ -110,7 +120,7 @@ RequestVerificationService::failRoutingVerification(Message::PacketType packetTy report.appendEnumerated(11, apid); report.appendEnumerated(2, seqFlag); report.appendBits(14, packetSeqCount); - report.appendUint16(errorCode); + report.appendEnum16(errorCode); storeMessage(report); } diff --git a/test/Services/RequestVerificationService.cpp b/test/Services/RequestVerificationService.cpp index 4301ce79c91bddf89e6ccc1e8c53f840545e7414..6c9e3c8ccda90deb72c48e62f585f6dd9394a7ba 100644 --- a/test/Services/RequestVerificationService.cpp +++ b/test/Services/RequestVerificationService.cpp @@ -9,13 +9,13 @@ TEST_CASE("TM[1,1]", "[service][st01]") { REQUIRE(ServiceTests::hasOneMessage()); Message response = ServiceTests::get(0); - // Checks for the class-members of the object response + // Checks for the data-members of the object response CHECK(response.serviceType == 1); CHECK(response.messageType == 1); CHECK(response.packetType == 0); // packet type(TM = 0, TC = 1) CHECK(response.applicationId == 0); REQUIRE(response.dataSize == 4); // dataSize is the number of bytes of data array - // Check for the value that is stored in data array(member-class of object response) + // Check for the value that is stored in <<data>> array(data-member of object response) CHECK(response.readEnumerated(3) == 2); // packet version number CHECK(response.readEnumerated(1) == 1); // packet type CHECK(response.readBits(1) == true); // secondary header flag @@ -30,13 +30,13 @@ TEST_CASE("TM[1,2]", "[service][st01]") { REQUIRE(ServiceTests::hasOneMessage()); Message response = ServiceTests::get(0); - // Checks for the class-members of the object response + // Checks for the data-members of the object response CHECK(response.serviceType == 1); CHECK(response.messageType == 2); CHECK(response.packetType == 0); // packet type(TM = 0, TC = 1) CHECK(response.applicationId == 0); REQUIRE(response.dataSize == 6); // dataSize is the number of bytes of data array - // Check for the value that is stored in data array(member-class of object response) + // Check for the value that is stored in <<data>> array(data-member of object response) CHECK(response.readEnumerated(3) == 2); // packet version number CHECK(response.readEnumerated(1) == 1); // packet type CHECK(response.readBits(1) == true); // secondary header flag @@ -52,13 +52,13 @@ TEST_CASE("TM[1,7]", "[service][st01]") { REQUIRE(ServiceTests::hasOneMessage()); Message response = ServiceTests::get(0); - // Checks for the class-members of the object response + // Checks for the data-members of the object response CHECK(response.serviceType == 1); CHECK(response.messageType == 7); CHECK(response.packetType == 0); // packet type(TM = 0, TC = 1) CHECK(response.applicationId == 0); REQUIRE(response.dataSize == 4); // dataSize is the number of bytes of data array - // Check for the value that is stored in data array(member-class of object response) + // Check for the value that is stored in <<data>> array(data-member of object response) CHECK(response.readEnumerated(3) == 2); // packet version number CHECK(response.readEnumerated(1) == 1); // packet type CHECK(response.readBits(1) == true); // secondary header flag @@ -73,13 +73,13 @@ TEST_CASE("TM[1,8]", "[service][st01]") { REQUIRE(ServiceTests::hasOneMessage()); Message response = ServiceTests::get(0); - // Checks for the class-members of the object response + // Checks for the data-members of the object response CHECK(response.serviceType == 1); CHECK(response.messageType == 8); CHECK(response.packetType == 0); // packet type(TM = 0, TC = 1) CHECK(response.applicationId == 0); REQUIRE(response.dataSize == 6); // dataSize is the number of bytes of data array - // Check for the value that is stored in data array(member-class of object response) + // Check for the value that is stored in <<data>> array(data-member of object response) CHECK(response.readEnumerated(3) == 2); // packet version number CHECK(response.readEnumerated(1) == 1); // packet type CHECK(response.readBits(1) == true); // secondary header flag @@ -95,13 +95,13 @@ TEST_CASE("TM[1,10]", "[service][st01]") { REQUIRE(ServiceTests::hasOneMessage()); Message response = ServiceTests::get(0); - // Checks for the class-members of the object response + // Checks for the data-members of the object response CHECK(response.serviceType == 1); CHECK(response.messageType == 10); CHECK(response.packetType == 0); // packet type(TM = 0, TC = 1) CHECK(response.applicationId == 0); REQUIRE(response.dataSize == 6); // dataSize is the number of bytes of data array - // Check for the value that is stored in data array(member-class of object response) + // Check for the value that is stored in <<data>> array(data-member of object response) CHECK(response.readEnumerated(3) == 2); // packet version number CHECK(response.readEnumerated(1) == 1); // packet type CHECK(response.readBits(1) == true); // secondary header flag