41 this->queue_depth = queueDepth;
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;
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) {
79 this->m_pingTrackerEntries[portNum].cycleCount = 0;
80 this->m_pingTrackerEntries[portNum].key = 0;
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) {
121 if (this->m_pingTrackerEntries[entry].entry.fatalCycles ==
122 this->m_pingTrackerEntries[entry].cycleCount) {
128 this->m_pingTrackerEntries[entry].cycleCount++;
149 this->m_enabled = enable;
163 if (-1 == entryIndex) {
168 this->m_pingTrackerEntries[entryIndex].enabled = enable.
e;
179 void HealthImpl::HLTH_CHNG_PING_cmdHandler(
const FwOpcodeType opCode, U32 cmdSeq,
const Fw::CmdStringArg& entry, U32 warningValue, U32 fatalValue) {
182 if (-1 == entryIndex) {
188 if (warningValue > fatalValue) {
196 this->m_pingTrackerEntries[entryIndex].entry.
warnCycles = warningValue;
197 this->m_pingTrackerEntries[entryIndex].entry.
fatalCycles = fatalValue;
207 if (entry == this->m_pingTrackerEntries[tableEntry].entry.entryName) {
PlatformIntType NATIVE_INT_TYPE
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
PlatformUIntType NATIVE_UINT_TYPE
C++-compatible configuration header for fprime configuration.
@ VALIDATION_ERROR
Command failed validation.
@ OK
Command successfully executed.
Enabled and disabled states.
@ DISABLED
Disabled state.
void init()
Object initializer.
@ MSG_DISPATCH_EMPTY
No more messages in the queue.
@ MSG_DISPATCH_OK
Dispatch was normal.
Enabled and disabled state.
Auto-generated base for Health component.
void tlmWrite_PingLateWarnings(U32 arg, Fw::Time _tlmTime=Fw::Time())
void log_ACTIVITY_HI_HLTH_CHECK_PING(Fw::Enabled enabled, const Fw::LogStringArg &entry)
virtual MsgDispatchStatus doDispatch()
Called in the message loop to dispatch a message from the queue.
void log_FATAL_HLTH_PING_WRONG_KEY(const Fw::LogStringArg &entry, U32 badKey)
bool isConnected_WdogStroke_OutputPort(NATIVE_INT_TYPE portNum)
void log_FATAL_HLTH_PING_LATE(const Fw::LogStringArg &entry)
void log_WARNING_LO_HLTH_CHECK_LOOKUP_ERROR(const Fw::LogStringArg &entry)
void log_WARNING_HI_HLTH_PING_WARN(const Fw::LogStringArg &entry)
void log_ACTIVITY_HI_HLTH_CHECK_ENABLE(Fw::Enabled enabled)
void PingSend_out(NATIVE_INT_TYPE portNum, U32 key)
Invoke output port PingSend.
void log_WARNING_HI_HLTH_PING_INVALID_VALUES(const Fw::LogStringArg &entry, U32 warn, U32 fatal)
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
@ NUM_PINGSEND_OUTPUT_PORTS
void log_ACTIVITY_HI_HLTH_PING_UPDATED(const Fw::LogStringArg &entry, U32 warn, U32 fatal)
void WdogStroke_out(NATIVE_INT_TYPE portNum, U32 code)
Invoke output port WdogStroke.
virtual void doOtherChecks()
additional checks function
~HealthImpl()
Component destructor.
void setPingEntries(PingEntry *pingEntries, NATIVE_INT_TYPE numPingEntries, U32 watchDogCode)
Set ping entry tables.
HealthImpl(const char *const compName)
HealthImpl constructor.
Fw::String entryName
the name of the entry
NATIVE_UINT_TYPE warnCycles
number of cycles before WARNING
NATIVE_UINT_TYPE fatalCycles
number of cycles before FATAL