2020-09-16 19:05:25 +02:00
|
|
|
#include "Service17Test.h"
|
2021-04-13 00:19:09 +02:00
|
|
|
#include <FSFWConfig.h>
|
2020-09-16 19:05:25 +02:00
|
|
|
|
2021-04-13 00:19:09 +02:00
|
|
|
#include "../serviceinterface/ServiceInterface.h"
|
2020-09-16 19:05:25 +02:00
|
|
|
#include "../objectmanager/SystemObject.h"
|
2021-06-14 10:19:01 +02:00
|
|
|
#include "../tmtcpacket/pus/tm/TmPacketStored.h"
|
2020-09-16 19:05:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
Service17Test::Service17Test(object_id_t objectId,
|
|
|
|
uint16_t apid, uint8_t serviceId):
|
|
|
|
PusServiceBase(objectId, apid, serviceId),
|
|
|
|
packetSubCounter(0) {
|
|
|
|
}
|
|
|
|
|
|
|
|
Service17Test::~Service17Test() {
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t Service17Test::handleRequest(uint8_t subservice) {
|
2021-01-29 17:16:34 +01:00
|
|
|
switch(subservice) {
|
2020-09-16 19:05:25 +02:00
|
|
|
case Subservice::CONNECTION_TEST: {
|
2021-04-13 00:19:09 +02:00
|
|
|
#if FSFW_USE_PUS_C_TELEMETRY == 0
|
2021-04-12 21:53:08 +02:00
|
|
|
TmPacketStoredPusA connectionPacket(apid, serviceId,
|
2020-09-16 19:05:25 +02:00
|
|
|
Subservice::CONNECTION_TEST_REPORT, packetSubCounter++);
|
2021-04-13 00:19:09 +02:00
|
|
|
#else
|
|
|
|
TmPacketStoredPusC connectionPacket(apid, serviceId,
|
|
|
|
Subservice::CONNECTION_TEST_REPORT, packetSubCounter++);
|
|
|
|
#endif
|
2020-09-16 19:05:25 +02:00
|
|
|
connectionPacket.sendPacket(requestQueue->getDefaultDestination(),
|
|
|
|
requestQueue->getId());
|
|
|
|
return HasReturnvaluesIF::RETURN_OK;
|
|
|
|
}
|
|
|
|
case Subservice::EVENT_TRIGGER_TEST: {
|
2021-04-13 00:19:09 +02:00
|
|
|
#if FSFW_USE_PUS_C_TELEMETRY == 0
|
2021-04-12 21:53:08 +02:00
|
|
|
TmPacketStoredPusA connectionPacket(apid, serviceId,
|
2020-09-16 19:05:25 +02:00
|
|
|
Subservice::CONNECTION_TEST_REPORT, packetSubCounter++);
|
2021-04-13 00:19:09 +02:00
|
|
|
#else
|
|
|
|
TmPacketStoredPusC connectionPacket(apid, serviceId,
|
|
|
|
Subservice::CONNECTION_TEST_REPORT, packetSubCounter++);
|
|
|
|
#endif
|
2020-09-16 19:05:25 +02:00
|
|
|
connectionPacket.sendPacket(requestQueue->getDefaultDestination(),
|
|
|
|
requestQueue->getId());
|
|
|
|
triggerEvent(TEST, 1234, 5678);
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
return AcceptsTelecommandsIF::INVALID_SUBSERVICE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t Service17Test::performService() {
|
|
|
|
return HasReturnvaluesIF::RETURN_OK;
|
|
|
|
}
|