diff --git a/pus/servicepackets/Service201Packets.h b/pus/servicepackets/Service201Packets.h new file mode 100644 index 000000000..aed821f98 --- /dev/null +++ b/pus/servicepackets/Service201Packets.h @@ -0,0 +1,48 @@ +#ifndef FSFW_PUS_SERVICEPACKETS_SERVICE201PACKETS_H_ +#define FSFW_PUS_SERVICEPACKETS_SERVICE201PACKETS_H_ + +#include "../../serialize/SerialLinkedListAdapter.h" +#include "../../serialize/SerializeIF.h" +#include "../../health/HasHealthIF.h" + +class HealthSetCommand: public SerialLinkedListAdapter { //!< [EXPORT] : [SUBSERVICE] 1 +public: + + HealthSetCommand() { + setLinks(); + } + + HasHealthIF::HealthState getHealth() { + return static_cast(health.entry); + } +private: + void setLinks() { + setStart(&objectId); + objectId.setNext(&health); + } + SerializeElement objectId; //!< [EXPORT] : [COMMENT] Target object Id + SerializeElement health; //!< [EXPORT] : [COMMENT] Health to set +}; + + +class HealthSetReply: public SerialLinkedListAdapter { //!< [EXPORT] : [SUBSERVICE] 2 +public: + HealthSetReply(uint8_t health_, uint8_t oldHealth_): + health(health_), oldHealth(oldHealth_) + { + setLinks(); + } + +private: + HealthSetReply(const HealthSetReply &reply); + void setLinks() { + setStart(&objectId); + objectId.setNext(&health); + health.setNext(&oldHealth); + } + SerializeElement objectId; //!< [EXPORT] : [COMMENT] Source object ID + SerializeElement health; //!< [EXPORT] : [COMMENT] New Health + SerializeElement oldHealth; //!< [EXPORT] : [COMMENT] Old Health +}; + +#endif /* FSFW_PUS_SERVICEPACKETS_SERVICE201PACKETS_H_ */