Skip to content
Snippets Groups Projects
Commit 1f147c93 authored by kongr45gpen's avatar kongr45gpen
Browse files

Add response for TC[17,3]

parent df07ef0b
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,14 @@ public:
/**
* TC[17,1] perform an are-you-alive connection test
*/
void areYouAlive(const Message & message);
void areYouAlive(const Message & request);
/**
* TC[17,3] perform an on-board connection test
*
* @todo Only respond if we have the correct APID
*/
void onBoardConnection(const Message & request);
};
......
#include <Services/TestService.hpp>
#include "Services/TestService.hpp"
void TestService::areYouAlive(const Message &message) {
void TestService::areYouAlive(const Message &request) {
// TM[17,2] are-you-alive connection test report
Message report = createTM(2);
storeMessage(report);
}
void TestService::onBoardConnection(const Message &request) {
// TM[17,4] on-board connection test report
Message report = createTM(4);
// TODO: This is not the correct way to do this! Fetching functions will be added later
report.appendInteger(request.data[1]);
storeMessage(report);
}
......@@ -18,6 +18,9 @@ int main() {
TestService testService;
Message receivedPacket = Message(17, 1, Message::TC, 1);
testService.areYouAlive(receivedPacket);
receivedPacket = Message(17, 3, Message::TC, 1);
receivedPacket.appendInteger(static_cast<uint16_t>(7));
testService.onBoardConnection(receivedPacket);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment