1
0
forked from fsfw/fsfw

health update

This commit is contained in:
2020-10-29 17:52:28 +01:00
parent 096643971b
commit 3098f34eb0
8 changed files with 112 additions and 99 deletions

View File

@ -1,5 +1,5 @@
#ifndef HASHEALTHIF_H_
#define HASHEALTHIF_H_
#ifndef FSFW_HEALTH_HASHEALTHIF_H_
#define FSFW_HEALTH_HASHEALTHIF_H_
#include "../events/Event.h"
#include "../returnvalues/HasReturnvaluesIF.h"
@ -8,9 +8,13 @@
class HasHealthIF {
public:
typedef enum {
HEALTHY = 1, FAULTY = 0, EXTERNAL_CONTROL = 2, NEEDS_RECOVERY = 3, PERMANENT_FAULTY = 4
} HealthState;
enum HealthState: uint8_t {
HEALTHY = 1,
FAULTY = 0,
EXTERNAL_CONTROL = 2,
NEEDS_RECOVERY = 3,
PERMANENT_FAULTY = 4
};
static const uint8_t INTERFACE_ID = CLASS_ID::HAS_HEALTH_IF;
static const ReturnValue_t OBJECT_NOT_HEALTHY = MAKE_RETURN_CODE(1);
@ -31,20 +35,17 @@ public:
virtual MessageQueueId_t getCommandQueue() const = 0;
/**
* set the Health State
*
* @brief Set the Health State
* The parent will be informed, if the Health changes
*
* @param health
*/
virtual ReturnValue_t setHealth(HealthState health) = 0;
/**
* get Health State
*
* @return Health State of the object
* @brief Get Health State
* @return Health State of the object
*/
virtual HasHealthIF::HealthState getHealth() = 0;
};
#endif /* HASHEALTHIF_H_ */
#endif /* FSFW_HEALTH_HASHEALTHIF_H_ */