42 this->queue_depth = queueDepth;
52 this->m_numPingEntries = numPingEntries;
53 this->m_watchDogCode = watchDogCode;
56 for (
FwIndexType entry = 0; entry < numPingEntries; entry++) {
58 pingEntries[entry].warnCycles <= pingEntries[entry].fatalCycles,
59 static_cast<FwAssertArgType>(pingEntries[entry].warnCycles),
60 static_cast<FwAssertArgType>(pingEntries[entry].fatalCycles));
61 this->m_pingTrackerEntries[entry].entry = pingEntries[entry];
62 this->m_pingTrackerEntries[entry].cycleCount = 0;
64 this->m_pingTrackerEntries[entry].key = 0;
76 void HealthImpl::PingReturn_handler(
const FwIndexType portNum, U32 key) {
78 if (key != this->m_pingTrackerEntries[portNum].key) {
83 this->m_pingTrackerEntries[portNum].cycleCount = 0;
84 this->m_pingTrackerEntries[portNum].key = 0;
89 void HealthImpl::Run_handler(
const FwIndexType portNum, U32 context) {
91 for (
FwSizeType i = 0; i < this->queue_depth; i++) {
104 for (
FwIndexType entry = 0; entry < this->m_numPingEntries; entry++) {
107 if (0 == this->m_pingTrackerEntries[entry].cycleCount) {
109 this->m_pingTrackerEntries[entry].key = this->m_key;
111 this->
PingSend_out(static_cast<FwIndexType>(entry), this->m_pingTrackerEntries[entry].key);
115 this->m_pingTrackerEntries[entry].cycleCount++;
118 if (this->m_pingTrackerEntries[entry].cycleCount ==
119 this->m_pingTrackerEntries[entry].entry.warnCycles) {
125 if (this->m_pingTrackerEntries[entry].entry.fatalCycles ==
126 this->m_pingTrackerEntries[entry].cycleCount) {
132 this->m_pingTrackerEntries[entry].cycleCount++;
153 this->m_enabled = enable;
167 if (-1 == entryIndex) {
172 this->m_pingTrackerEntries[entryIndex].enabled = enable.
e;
183 void HealthImpl::HLTH_CHNG_PING_cmdHandler(
const FwOpcodeType opCode, U32 cmdSeq,
const Fw::CmdStringArg& entry, U32 warningValue, U32 fatalValue) {
186 if (-1 == entryIndex) {
192 if (warningValue > fatalValue) {
200 this->m_pingTrackerEntries[entryIndex].entry.warnCycles = warningValue;
201 this->m_pingTrackerEntries[entryIndex].entry.fatalCycles = fatalValue;
208 static_assert(std::numeric_limits<FwIndexType>::is_signed,
"FwIndexType must be signed to return -1 for error");
211 if (entry == this->m_pingTrackerEntries[tableEntry].entry.entryName) {
Auto-generated base for Health component.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
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.
U32 FwOpcodeType
The type of a command opcode.
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.
Enabled and disabled state.
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