33 "NUM_PINGSEND_OUTPUT_PORTS must fit in the positive range of FwIndexType");
43 this->queue_depth = queueDepth;
51 this->m_numPingEntries = numPingEntries;
52 this->m_watchDogCode = watchDogCode;
55 for (
FwIndexType entry = 0; entry < numPingEntries; entry++) {
56 FW_ASSERT(pingEntries[entry].warnCycles <= pingEntries[entry].fatalCycles,
57 static_cast<FwAssertArgType>(pingEntries[entry].warnCycles),
58 static_cast<FwAssertArgType>(pingEntries[entry].fatalCycles));
59 this->m_pingTrackerEntries[entry].entry = pingEntries[entry];
60 this->m_pingTrackerEntries[entry].cycleCount = 0;
62 this->m_pingTrackerEntries[entry].key = 0;
72 void HealthImpl::PingReturn_handler(
const FwIndexType portNum, U32 key) {
74 if (key != this->m_pingTrackerEntries[portNum].key) {
79 this->m_pingTrackerEntries[portNum].cycleCount = 0;
80 this->m_pingTrackerEntries[portNum].key = 0;
84 void HealthImpl::Run_handler(
const FwIndexType portNum, U32 context) {
86 for (
FwSizeType i = 0; i < this->queue_depth; i++) {
99 for (
FwIndexType entry = 0; entry < this->m_numPingEntries; entry++) {
102 if (0 == this->m_pingTrackerEntries[entry].cycleCount) {
104 this->m_pingTrackerEntries[entry].key = this->m_key;
106 this->
PingSend_out(static_cast<FwIndexType>(entry), this->m_pingTrackerEntries[entry].key);
110 this->m_pingTrackerEntries[entry].cycleCount++;
113 if (this->m_pingTrackerEntries[entry].cycleCount ==
114 this->m_pingTrackerEntries[entry].entry.warnCycles) {
120 if (this->m_pingTrackerEntries[entry].entry.fatalCycles ==
121 this->m_pingTrackerEntries[entry].cycleCount) {
127 this->m_pingTrackerEntries[entry].cycleCount++;
148 this->m_enabled = enable;
157 void HealthImpl::HLTH_PING_ENABLE_cmdHandler(
const FwOpcodeType opCode,
164 if (-1 == entryIndex) {
169 this->m_pingTrackerEntries[entryIndex].enabled = enable.
e;
180 void HealthImpl::HLTH_CHNG_PING_cmdHandler(
const FwOpcodeType opCode,
187 if (-1 == entryIndex) {
193 if (warningValue > fatalValue) {
201 this->m_pingTrackerEntries[entryIndex].entry.warnCycles = warningValue;
202 this->m_pingTrackerEntries[entryIndex].entry.fatalCycles = fatalValue;
209 static_assert(std::numeric_limits<FwIndexType>::is_signed,
"FwIndexType must be signed to return -1 for error");
212 if (entry == this->m_pingTrackerEntries[tableEntry].entry.entryName) {
Auto-generated base for Health component.
Enabled and disabled state.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
FwIdType FwOpcodeType
The type of a command opcode.
void tlmWrite_PingLateWarnings(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void log_FATAL_HLTH_PING_WRONG_KEY(const Fw::StringBase &entry, U32 badKey) const
PlatformSizeType FwSizeType
virtual MsgDispatchStatus doDispatch()
Called in the message loop to dispatch a message from the queue.
void log_WARNING_LO_HLTH_CHECK_LOOKUP_ERROR(const Fw::StringBase &entry) const
void log_WARNING_HI_HLTH_PING_INVALID_VALUES(const Fw::StringBase &entry, U32 warn, U32 fatal) const
void init()
Object initializer.
virtual void doOtherChecks()
additional checks function
~HealthImpl()
Component destructor.
void setPingEntries(PingEntry *pingEntries, FwIndexType numPingEntries, U32 watchDogCode)
Set ping entry tables.
void log_ACTIVITY_HI_HLTH_CHECK_PING(Fw::Enabled enabled, const Fw::StringBase &entry) const
void WdogStroke_out(FwIndexType portNum, U32 code)
Invoke output port WdogStroke.
Enabled and disabled states.
Command successfully executed.
bool isConnected_WdogStroke_OutputPort(FwIndexType portNum)
HealthImpl(const char *const compName)
HealthImpl constructor.
void log_FATAL_HLTH_PING_LATE(const Fw::StringBase &entry) const
PlatformIndexType FwIndexType
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Command failed validation.
RateGroupDivider component implementation.
void log_ACTIVITY_HI_HLTH_CHECK_ENABLE(Fw::Enabled enabled) const
No more messages in the queue.
void log_WARNING_HI_HLTH_PING_WARN(const Fw::StringBase &entry) const
void PingSend_out(FwIndexType portNum, U32 key)
Invoke output port PingSend.
void log_ACTIVITY_HI_HLTH_PING_UPDATED(const Fw::StringBase &entry, U32 warn, U32 fatal) const