fsfw/src/fsfw/pus/Service1TelecommandVerifica...

105 lines
3.8 KiB
C
Raw Normal View History

2020-11-09 21:33:09 +01:00
#ifndef FSFW_PUS_SERVICE1TELECOMMANDVERIFICATION_H_
#define FSFW_PUS_SERVICE1TELECOMMANDVERIFICATION_H_
2020-07-10 14:16:55 +02:00
2022-02-02 10:29:30 +01:00
#include "fsfw/ipc/MessageQueueIF.h"
2021-07-13 20:58:45 +02:00
#include "fsfw/objectmanager/SystemObject.h"
2022-08-16 12:48:22 +02:00
#include "fsfw/returnvalues/returnvalue.h"
2021-07-13 20:58:45 +02:00
#include "fsfw/tasks/ExecutableObjectIF.h"
#include "fsfw/tmtcservices/AcceptsVerifyMessageIF.h"
#include "fsfw/tmtcservices/PusVerificationReport.h"
2022-07-20 22:21:15 +02:00
#include "fsfw/tmtcservices/TmSendHelper.h"
#include "fsfw/tmtcservices/TmStoreAndSendHelper.h"
#include "fsfw/tmtcservices/TmStoreHelper.h"
2020-07-10 14:16:55 +02:00
/**
* @brief Verify TC acceptance, start, progress and execution.
*
* Full Documentation: ECSS-E70-41A p.51
*
* The telecommand verification service provides the capability for
* explicit verification of each distinct stage of execution of a telecommand
* packet, from on-board acceptance through to completion of execution.
*
* Minimum capabilities of this service:
*
* - TM[1,1]: Telecommand Acceptance Report - Success.
* - TM[1,2]: Telecommand Acceptance Report - Failure.
*
* Additional capabilities of this service:
*
* - TM[1,3]: Telecommand Execution Started Report - Success (Req. 4).
* - TM[1,4]: Telecommand Execution Started Report - Failure (Req. 3).
* - TM[1,5]: Telecommand Execution Progress Report - Success (Req. 6).
* - TM[1,6]: Telecommand Execution Progress Report - Failure (Req. 5).
* - TM[1,7]: Telecommand Execution Completed Report - Success (Req. 8).
* - TM[1,8]: Telecommand Execution Completed Report - Failure (Req. 7).
*
* This Service is not inherited from PUSServiceBase unlike other PUS Services
* because all services implementing PUSServiceBase use this service to
* generate verification reports.
* @ingroup pus_services
*/
2022-02-02 10:29:30 +01:00
class Service1TelecommandVerification : public AcceptsVerifyMessageIF,
public SystemObject,
2022-08-16 01:08:26 +02:00
public ExecutableObjectIF {
2022-02-02 10:29:30 +01:00
public:
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PUS_SERVICE_1;
Service1TelecommandVerification(object_id_t objectId, uint16_t apid, uint8_t serviceId,
2022-07-27 17:48:59 +02:00
object_id_t targetDestination, uint16_t messageQueueDepth,
2022-09-05 14:44:35 +02:00
TimeWriterIF* timeStamper = nullptr);
2022-07-20 22:21:15 +02:00
~Service1TelecommandVerification() override;
2020-07-10 14:16:55 +02:00
2022-02-02 10:29:30 +01:00
/**
*
* @return ID of Verification Queue
*/
2022-07-20 22:21:15 +02:00
MessageQueueId_t getVerificationQueue() override;
2020-07-10 14:16:55 +02:00
2022-02-02 10:29:30 +01:00
/**
* Performs the service periodically as specified in init_mission().
* Triggers the handlePacket function to send TC verification messages
* @param operationCode
* @return
*/
2022-07-20 22:21:15 +02:00
ReturnValue_t performOperation(uint8_t operationCode) override;
2020-07-10 14:16:55 +02:00
2022-02-02 10:29:30 +01:00
/**
* Initializes the destination for TC verification messages and initializes
* Service 1 as a system object
* @return
*/
ReturnValue_t initialize() override;
2020-07-10 14:16:55 +02:00
2022-02-02 10:29:30 +01:00
private:
uint16_t apid = 0;
uint8_t serviceId = 0;
2020-07-10 14:16:55 +02:00
2022-02-02 10:29:30 +01:00
object_id_t targetDestination = objects::NO_OBJECT;
2020-07-10 14:16:55 +02:00
2022-02-02 10:29:30 +01:00
ReturnValue_t sendVerificationReport(PusVerificationMessage* message);
ReturnValue_t generateFailureReport(PusVerificationMessage* message);
ReturnValue_t generateSuccessReport(PusVerificationMessage* message);
2020-07-10 14:16:55 +02:00
2022-02-02 10:29:30 +01:00
uint16_t packetSubCounter = 0;
2020-07-10 14:16:55 +02:00
2022-07-20 22:21:15 +02:00
TmSendHelper sendHelper;
TmStoreHelper storeHelper;
TmStoreAndSendWrapper tmHelper;
2022-07-27 17:00:43 +02:00
InternalErrorReporterIF* errReporter = nullptr;
2022-09-05 14:44:35 +02:00
TimeWriterIF* timeStamper = nullptr;
2022-07-20 22:21:15 +02:00
StorageManagerIF* tmStore = nullptr;
2022-02-02 10:29:30 +01:00
MessageQueueIF* tmQueue = nullptr;
2020-07-10 14:16:55 +02:00
2022-02-02 10:29:30 +01:00
enum class Subservice : uint8_t {
VERIFY_ACCEPTANCE_SUCCESS = 1, //!< [EXPORT] : [TM]
VERIFY_ACCEPTANCE_FAILED = 2, //!< [EXPORT] : [TM]
VERIFY_START_SUCCESS = 3, //!< [EXPORT] : [TM]
VERIFY_START_FAILED = 4, //!< [EXPORT] : [TM]
VERIFY_STEP_SUCCESS = 5, //!< [EXPORT] : [TM]
VERIFY_STEP_FAILED = 6 //!< [EXPORT] : [TM]
};
2020-07-10 14:16:55 +02:00
};
2020-11-09 21:33:09 +01:00
#endif /* FSFW_PUS_SERVICE1TELECOMMANDVERIFICATION_H_ */