2020-09-16 19:11:50 +02:00
|
|
|
#ifndef FSFW_PUS_SERVICE9TIMEMANAGEMENT_H_
|
|
|
|
#define FSFW_PUS_SERVICE9TIMEMANAGEMENT_H_
|
|
|
|
|
2021-07-13 20:58:45 +02:00
|
|
|
#include "fsfw/tmtcservices/PusServiceBase.h"
|
2020-09-16 19:11:50 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
class Service9TimeManagement : public PusServiceBase {
|
|
|
|
public:
|
|
|
|
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PUS_SERVICE_9;
|
2023-02-01 18:10:07 +01:00
|
|
|
|
|
|
|
//!< Clock has been set. P1: old timeval seconds. P2: new timeval seconds.
|
|
|
|
static constexpr Event CLOCK_SET = MAKE_EVENT(0, severity::INFO);
|
|
|
|
//!< Clock dump event. P1: timeval seconds P2: timeval milliseconds.
|
|
|
|
static constexpr Event CLOCK_DUMP = MAKE_EVENT(1, severity::INFO);
|
|
|
|
//!< Clock could not be set. P1: Returncode.
|
|
|
|
static constexpr Event CLOCK_SET_FAILURE = MAKE_EVENT(2, severity::LOW);
|
2020-09-16 19:11:50 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
static constexpr uint8_t CLASS_ID = CLASS_ID::PUS_SERVICE_9;
|
2020-09-16 19:11:50 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
/**
|
|
|
|
* @brief This service provides the capability to set the on-board time.
|
|
|
|
*/
|
2022-07-26 16:49:46 +02:00
|
|
|
explicit Service9TimeManagement(PsbParams params);
|
2020-09-16 19:11:50 +02:00
|
|
|
|
2022-07-26 16:49:46 +02:00
|
|
|
~Service9TimeManagement() override;
|
2020-09-16 19:11:50 +02:00
|
|
|
|
2022-07-26 16:49:46 +02:00
|
|
|
ReturnValue_t performService() override;
|
2020-09-16 19:11:50 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
/**
|
|
|
|
* @brief Sets the onboard-time by retrieving the time to set from TC[9,128].
|
|
|
|
*/
|
2022-07-26 16:49:46 +02:00
|
|
|
ReturnValue_t handleRequest(uint8_t subservice) override;
|
2020-09-16 19:11:50 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
virtual ReturnValue_t setTime();
|
2020-09-16 19:11:50 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
private:
|
2023-02-01 18:10:07 +01:00
|
|
|
enum Subservice {
|
|
|
|
SET_TIME = 128, //!< [EXPORT] : [COMMAND] Time command in ASCII, CUC or CDS format
|
|
|
|
DUMP_TIME = 129,
|
2022-02-02 10:29:30 +01:00
|
|
|
};
|
2020-09-16 19:11:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* FSFW_PUS_SERVICE9TIMEMANAGEMENT_H_ */
|