diff --git a/inc/Services/TestService.hpp b/inc/Services/TestService.hpp index 35c276bc74d8e6394fa9cfdf232981880e14bde1..47062a9db38f2e97e5e643430f3c70f705190f70 100644 --- a/inc/Services/TestService.hpp +++ b/inc/Services/TestService.hpp @@ -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); }; diff --git a/src/Services/TestService.cpp b/src/Services/TestService.cpp index aff053f67a2c7aeaf44e74edca39d59063ca1300..6335e3adf3b24b2cafab1c0e3232976155c5109f 100644 --- a/src/Services/TestService.cpp +++ b/src/Services/TestService.cpp @@ -1,8 +1,21 @@ + +#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); +} diff --git a/src/main.cpp b/src/main.cpp index 05c564c53f3ffe92b59f91c643bfd9ce4f5bfaa6..31ecd04fb4fde76903d1eee668475f8eaa074a85 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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; }