fsfw/src/fsfw/pus/Service17Test.cpp

45 lines
1.6 KiB
C++
Raw Normal View History

2021-07-13 20:58:45 +02:00
#include "fsfw/pus/Service17Test.h"
2020-09-16 19:05:25 +02:00
2022-02-02 10:29:30 +01:00
#include "fsfw/FSFW.h"
2021-07-13 20:58:45 +02:00
#include "fsfw/objectmanager/SystemObject.h"
2022-02-02 10:29:30 +01:00
#include "fsfw/serviceinterface/ServiceInterface.h"
2021-07-13 20:58:45 +02:00
#include "fsfw/tmtcpacket/pus/tm/TmPacketStored.h"
2020-09-16 19:05:25 +02:00
2022-07-20 11:43:16 +02:00
Service17Test::Service17Test(object_id_t objectId, uint16_t apid, uint8_t serviceId,
StorageManagerIF* tmStore, StorageManagerIF* ipcStore,
InternalErrorReporterIF* errReporter)
: PusServiceBase(objectId, apid, serviceId, ipcStore),
helper(tmStore, MessageQueueIF::NO_QUEUE, MessageQueueIF::NO_QUEUE, errReporter),
packetSubCounter(0) {}
2020-09-16 19:05:25 +02:00
2022-07-20 11:43:16 +02:00
Service17Test::~Service17Test() = default;
2020-09-16 19:05:25 +02:00
ReturnValue_t Service17Test::handleRequest(uint8_t subservice) {
2022-02-02 10:29:30 +01:00
switch (subservice) {
case Subservice::CONNECTION_TEST: {
2022-07-20 11:43:16 +02:00
helper.preparePacket(apid, serviceId, Subservice::CONNECTION_TEST_REPORT, packetSubCounter);
helper.sendPacket();
2022-02-02 10:29:30 +01:00
return HasReturnvaluesIF::RETURN_OK;
}
2020-09-16 19:05:25 +02:00
case Subservice::EVENT_TRIGGER_TEST: {
2022-07-20 11:43:16 +02:00
helper.preparePacket(apid, serviceId, Subservice::CONNECTION_TEST_REPORT, packetSubCounter++);
helper.sendPacket();
2022-02-02 10:29:30 +01:00
triggerEvent(TEST, 1234, 5678);
return RETURN_OK;
2020-09-16 19:05:25 +02:00
}
2022-02-02 10:29:30 +01:00
default:
return AcceptsTelecommandsIF::INVALID_SUBSERVICE;
}
2020-09-16 19:05:25 +02:00
}
2022-02-02 10:29:30 +01:00
ReturnValue_t Service17Test::performService() { return HasReturnvaluesIF::RETURN_OK; }
2022-07-20 11:43:16 +02:00
ReturnValue_t Service17Test::initialize() {
ReturnValue_t result = PusServiceBase::initialize();
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
helper.setMsgDestination(requestQueue->getDefaultDestination());
helper.setMsgSource(requestQueue->getId());
if (tm) }