add new ping with data TC

This commit is contained in:
Robin Müller 2022-11-02 19:35:22 +01:00
parent e1d4209fbe
commit 91ebf98c28
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 23 additions and 3 deletions

View File

@ -345,9 +345,15 @@ if(FSFW_BUILD_TESTS)
DEPENDENCIES ${FSFW_TEST_TGT})
else()
setup_target_for_coverage_lcov(
NAME ${FSFW_TEST_TGT}_coverage EXECUTABLE ${FSFW_TEST_TGT}
DEPENDENCIES ${FSFW_TEST_TGT}
GENHTML_ARGS --html-epilog ${CMAKE_SOURCE_DIR}/unittests/lcov_epilog.html)
NAME
${FSFW_TEST_TGT}_coverage
EXECUTABLE
${FSFW_TEST_TGT}
DEPENDENCIES
${FSFW_TEST_TGT}
GENHTML_ARGS
--html-epilog
${CMAKE_SOURCE_DIR}/unittests/lcov_epilog.html)
endif()
endif()
endif()

View File

@ -1,5 +1,7 @@
#include "fsfw/pus/Service17Test.h"
#include <fsfw/serialize/SerializeElement.h>
#include "fsfw/FSFW.h"
#include "fsfw/objectmanager/ObjectManager.h"
#include "fsfw/objectmanager/SystemObject.h"
@ -31,6 +33,15 @@ ReturnValue_t Service17Test::handleRequest(uint8_t subservice) {
}
return tmHelper.storeAndSendTmPacket();
}
case Subservice::PING_WITH_DATA: {
SerializeElement<uint32_t> receivedDataLen = currentPacket.getUserDataLen();
ReturnValue_t result =
tmHelper.prepareTmPacket(Subservice::PING_WITH_DATA_REPORT_WITH_SIZE, receivedDataLen);
if (result != returnvalue::OK) {
return result;
}
return tmHelper.storeAndSendTmPacket();
}
default:
return AcceptsTelecommandsIF::INVALID_SUBSERVICE;
}

View File

@ -32,6 +32,9 @@ class Service17Test : public PusServiceBase {
CONNECTION_TEST_REPORT = 2,
//! [EXPORT] : [COMMAND] Trigger test reply and test event
EVENT_TRIGGER_TEST = 128,
PING_WITH_DATA = 129,
//! [EXPORT] : [COMMAND] Report which reports the sent user data size
PING_WITH_DATA_REPORT_WITH_SIZE = 130
};
explicit Service17Test(PsbParams params);