24 HealthComponentBase(compName),
29 m_enabled(HLTH_CHK_ENABLED),
35 this->m_pingTrackerEntries[entry].enabled = HLTH_PING_DISABLED;
40 HealthComponentBase::init(queueDepth, instance);
41 this->queue_depth = queueDepth;
49 FW_ASSERT(numPingEntries <= NUM_PINGSEND_OUTPUT_PORTS);
51 this->m_numPingEntries = numPingEntries;
52 this->m_watchDogCode = watchDogCode;
56 FW_ASSERT(pingEntries[entry].warnCycles <= pingEntries[entry].fatalCycles, pingEntries[entry].warnCycles, pingEntries[entry].fatalCycles);
57 this->m_pingTrackerEntries[entry].entry = pingEntries[entry];
58 this->m_pingTrackerEntries[entry].cycleCount = 0;
59 this->m_pingTrackerEntries[entry].enabled = HLTH_PING_ENABLED;
60 this->m_pingTrackerEntries[entry].key = 0;
72 void HealthImpl::PingReturn_handler(
const NATIVE_INT_TYPE portNum, U32 key) {
74 if (key != this->m_pingTrackerEntries[portNum].key) {
76 this->log_FATAL_HLTH_PING_WRONG_KEY(_arg,key);
79 this->m_pingTrackerEntries[portNum].cycleCount = 0;
80 this->m_pingTrackerEntries[portNum].key = 0;
88 MsgDispatchStatus stat = this->doDispatch();
89 if (MSG_DISPATCH_EMPTY == stat) {
95 if (this->m_enabled) {
101 if (HLTH_PING_ENABLED == this->m_pingTrackerEntries[entry].enabled) {
103 if (0 == this->m_pingTrackerEntries[entry].cycleCount) {
105 this->m_pingTrackerEntries[entry].key = this->m_key;
107 this->PingSend_out(entry, this->m_pingTrackerEntries[entry].key);
111 this->m_pingTrackerEntries[entry].cycleCount++;
114 if (this->m_pingTrackerEntries[entry].cycleCount ==
115 this->m_pingTrackerEntries[entry].entry.warnCycles) {
117 this->log_WARNING_HI_HLTH_PING_WARN(_arg);
118 this->tlmWrite_PingLateWarnings(++this->m_warnings);
121 if (this->m_pingTrackerEntries[entry].entry.fatalCycles ==
122 this->m_pingTrackerEntries[entry].cycleCount) {
124 this->log_FATAL_HLTH_PING_LATE(_arg);
128 this->m_pingTrackerEntries[entry].cycleCount++;
139 if (this->isConnected_WdogStroke_OutputPort(0)) {
140 this->WdogStroke_out(0,this->m_watchDogCode);
148 void HealthImpl::HLTH_ENABLE_cmdHandler(
const FwOpcodeType opCode, U32 cmdSeq, HealthEnabled enable) {
149 this->m_enabled = enable;
150 HealthIsEnabled isEnabled = HEALTH_CHECK_DISABLED;
152 isEnabled = HEALTH_CHECK_ENABLED;
154 this->log_ACTIVITY_HI_HLTH_CHECK_ENABLE(isEnabled);
155 this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK);
159 void HealthImpl::HLTH_PING_ENABLE_cmdHandler(
const FwOpcodeType opCode, U32 cmdSeq,
const Fw::CmdStringArg& entry, PingEnabled enable) {
163 if (-1 == entryIndex) {
164 this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_VALIDATION_ERROR);
169 if (enable != HealthImpl::HLTH_PING_DISABLED && enable != HealthImpl::HLTH_PING_ENABLED) {
170 this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_VALIDATION_ERROR);
174 this->m_pingTrackerEntries[entryIndex].enabled = enable;
175 HealthPingIsEnabled isEnabled = HEALTH_PING_DISABLED;
177 isEnabled = HEALTH_PING_ENABLED;
181 this->log_ACTIVITY_HI_HLTH_CHECK_PING(isEnabled,arg);
182 this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK);
185 void HealthImpl::HLTH_CHNG_PING_cmdHandler(
const FwOpcodeType opCode, U32 cmdSeq,
const Fw::CmdStringArg& entry, U32 warningValue, U32 fatalValue) {
188 if (-1 == entryIndex) {
189 this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_VALIDATION_ERROR);
194 if (warningValue > fatalValue) {
197 this->log_WARNING_HI_HLTH_PING_INVALID_VALUES(arg,warningValue,fatalValue);
198 this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_VALIDATION_ERROR);
202 this->m_pingTrackerEntries[entryIndex].entry.warnCycles = warningValue;
203 this->m_pingTrackerEntries[entryIndex].entry.fatalCycles = fatalValue;
205 this->log_ACTIVITY_HI_HLTH_PING_UPDATED(arg,warningValue,fatalValue);
206 this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK);
212 for (
NATIVE_UINT_TYPE tableEntry = 0; tableEntry < NUM_PINGSEND_OUTPUT_PORTS; tableEntry++) {
213 if (entry == this->m_pingTrackerEntries[tableEntry].entry.entryName) {
218 this->log_WARNING_LO_HLTH_CHECK_LOOKUP_ERROR(arg);