Skip to content
Snippets Groups Projects
Commit 65c36107 authored by thodkatz's avatar thodkatz
Browse files

Implement code review comments

parent c49c5e08
No related branches found
No related tags found
No related merge requests found
#ifndef ECSS_SERVICES_REQUSTVERIFICATIONSERVICE_HPP
#define ECSS_SERVICES_REQUSTVERIFICATIONSERVICE_HPP
#ifndef ECSS_SERVICES_REQEUSTVERIFICATIONSERVICE_HPP
#define ECSS_SERVICES_REQUESTVERIFICATIONSERVICE_HPP
#include "Service.hpp"
......@@ -18,39 +18,39 @@ public:
* TM[1,1] successful acceptance verification report
*/
void successAcceptanceVerification(uint8_t packetType, bool secondaryHeaderFlag,
uint16_t APID, uint8_t seqFlag, uint16_t packetSeqCount);
uint16_t apid, uint8_t seqFlag, uint16_t packetSeqCount);
/**
* TM[1,2] failed acceptance verification report
*/
void failAcceptanceVerification(uint8_t packetType, bool secondaryHeaderFlag,
uint16_t APID, uint8_t seqFlag, uint16_t packetSeqCount,
uint16_t code);
uint16_t apid, uint8_t seqFlag, uint16_t packetSeqCount,
uint16_t errorCode);
/**
* TM[1,7] successful completion of execution verification report
*/
void successExecutionVerification(uint8_t packetType, bool secondaryHeaderFlag,
uint16_t APID, uint8_t seqFlag, uint16_t packetSeqCount);
uint16_t apid, uint8_t seqFlag, uint16_t packetSeqCount);
/**
* TM[1,8] failed completion of execution verification report
*/
void failExecutionVerification(uint8_t packetType,
bool secondaryHeaderFlag,
uint16_t APID, uint8_t seqFlag, uint16_t packetSeqCount,
uint16_t code);
uint16_t apid, uint8_t seqFlag, uint16_t packetSeqCount,
uint16_t errorCode);
/**
* TM[1,10] failed routing verification report
*/
void failRoutingVerification(uint8_t packetType,
bool secondaryHeaderFlag,
uint16_t APID, uint8_t seqFlag, uint16_t packetSeqCount,
uint16_t code);
uint16_t apid, uint8_t seqFlag, uint16_t packetSeqCount,
uint16_t errorCode);
};
#endif //ECSS_SERVICES_REQUSTVERIFICATIONSERVICE_HPP
#endif //ECSS_SERVICES_REQUESTVERIFICATIONSERVICE_HPP
......@@ -2,20 +2,20 @@
void RequestVerificationService::successAcceptanceVerification(uint8_t packetType,
bool secondaryHeaderFlag,
uint16_t APID, uint8_t seqFlag,
uint16_t apid, uint8_t seqFlag,
uint16_t packetSeqCount) {
// TM[1,1] successful acceptance verification report
assert(packetType <= 1);
assert(APID <= 1024);
assert(seqFlag <= 2);
assert(packetSeqCount <= 8192);
assert(packetType < 2);
assert(apid < 2048);
assert(seqFlag < 4);
assert(packetSeqCount < 16384);
Message report = createTM(1);
report.appendBits(3, ECSS_PUS_VERSION); //packet version number
report.appendBits(3, ECSS_PUS_VERSION); // packet version number
report.appendBits(1, packetType);
report.appendBits(1, static_cast<uint16_t >(secondaryHeaderFlag));
report.appendBits(11, APID);
report.appendBits(11, apid);
report.appendBits(2, seqFlag);
report.appendBits(14, packetSeqCount);
......@@ -25,45 +25,45 @@ void RequestVerificationService::successAcceptanceVerification(uint8_t packetTyp
void
RequestVerificationService::failAcceptanceVerification(uint8_t packetType,
bool secondaryHeaderFlag,
uint16_t APID, uint8_t seqFlag,
uint16_t apid, uint8_t seqFlag,
uint16_t packetSeqCount,
uint16_t code) {
uint16_t errorCode) {
// TM[1,2] failed acceptance verification report
assert(packetType <= 1);
assert(APID <= 1024);
assert(seqFlag <= 2);
assert(packetSeqCount <= 8192);
assert(packetType < 2);
assert(apid < 2048);
assert(seqFlag < 4);
assert(packetSeqCount < 16384);
Message report = createTM(2);
report.appendBits(3, ECSS_PUS_VERSION); //packet version number
report.appendBits(3, ECSS_PUS_VERSION); // packet version number
report.appendBits(1, packetType);
report.appendBits(1, static_cast<uint16_t >(secondaryHeaderFlag));
report.appendBits(11, APID);
report.appendBits(11, apid);
report.appendBits(2, seqFlag);
report.appendBits(14, packetSeqCount);
report.appendUint16(code);
report.appendUint16(errorCode);
storeMessage(report);
}
void RequestVerificationService::successExecutionVerification(uint8_t packetType,
bool secondaryHeaderFlag,
uint16_t APID, uint8_t seqFlag,
uint16_t apid, uint8_t seqFlag,
uint16_t packetSeqCount) {
// TM[1,7] successful completion of execution verification report
assert(packetType <= 1);
assert(APID <= 1024);
assert(seqFlag <= 2);
assert(packetSeqCount <= 8192);
assert(packetType < 2);
assert(apid < 2048);
assert(seqFlag < 4);
assert(packetSeqCount < 16384);
Message report = createTM(7);
report.appendBits(3, ECSS_PUS_VERSION); //packet version number
report.appendBits(3, ECSS_PUS_VERSION); // packet version number
report.appendBits(1, packetType);
report.appendBits(1, static_cast<uint16_t >(secondaryHeaderFlag));
report.appendBits(11, APID);
report.appendBits(11, apid);
report.appendBits(2, seqFlag);
report.appendBits(14, packetSeqCount);
......@@ -73,25 +73,25 @@ void RequestVerificationService::successExecutionVerification(uint8_t packetType
void
RequestVerificationService::failExecutionVerification(uint8_t packetType,
bool secondaryHeaderFlag,
uint16_t APID, uint8_t seqFlag,
uint16_t apid, uint8_t seqFlag,
uint16_t packetSeqCount,
uint16_t code) {
uint16_t errorCode) {
// TM[1,8] failed completion of execution verification report
assert(packetType <= 1);
assert(APID <= 1024);
assert(seqFlag <= 2);
assert(packetSeqCount <= 8192);
assert(packetType < 2);
assert(apid < 2048);
assert(seqFlag < 4);
assert(packetSeqCount < 16384);
Message report = createTM(8);
report.appendBits(3, ECSS_PUS_VERSION); //packet version number
report.appendBits(3, ECSS_PUS_VERSION); // packet version number
report.appendBits(1, packetType);
report.appendBits(1, static_cast<uint16_t >(secondaryHeaderFlag));
report.appendBits(11, APID);
report.appendBits(11, apid);
report.appendBits(2, seqFlag);
report.appendBits(14, packetSeqCount);
report.appendUint16(code);
report.appendUint16(errorCode);
storeMessage(report);
}
......@@ -99,25 +99,25 @@ RequestVerificationService::failExecutionVerification(uint8_t packetType,
void
RequestVerificationService::failRoutingVerification(uint8_t packetType,
bool secondaryHeaderFlag,
uint16_t APID, uint8_t seqFlag,
uint16_t apid, uint8_t seqFlag,
uint16_t packetSeqCount,
uint16_t code) {
uint16_t errorCode) {
// TM[1,10] failed routing verification report
assert(packetType <= 1);
assert(APID <= 1024);
assert(seqFlag <= 2);
assert(packetSeqCount <= 8192);
assert(packetType < 2);
assert(apid < 2048);
assert(seqFlag < 4);
assert(packetSeqCount < 16384);
Message report = createTM(10);
report.appendBits(3, ECSS_PUS_VERSION); //packet version number
report.appendBits(3, ECSS_PUS_VERSION); // packet version number
report.appendBits(1, packetType);
report.appendBits(1, static_cast<uint16_t >(secondaryHeaderFlag));
report.appendBits(11, APID);
report.appendBits(11, apid);
report.appendBits(2, seqFlag);
report.appendBits(14, packetSeqCount);
report.appendUint16(code);
report.appendUint16(errorCode);
storeMessage(report);
}
......@@ -20,7 +20,7 @@ int main() {
std::cout << "Word: " << string << " " << packet.readBits(15) << packet.readBits(1)
<< std::endl;
std::cout << packet.readFloat() << " " << std::dec << packet.readSint32() << std::endl;
/*
// ST[17] test
TestService testService;
Message receivedPacket = Message(17, 1, Message::TC, 1);
......@@ -28,7 +28,6 @@ int main() {
receivedPacket = Message(17, 3, Message::TC, 1);
receivedPacket.appendUint16(7);
testService.onBoardConnection(receivedPacket);
*/
// ST[01] test
// parameters take random values and works as expected
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment