F´ Flight Software - C/C++ Documentation  NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Svc::HealthImpl Class Reference

Health component implementation class. More...

#include <Svc/Health/HealthComponentImpl.hpp>

Inheritance diagram for Svc::HealthImpl:
Svc::HealthComponentBase Fw::QueuedComponentBase Fw::PassiveComponentBase Fw::ObjBase

Classes

struct  PingEntry
 struct for ping entry More...
 
struct  PingTracker
 ping tracker struct More...
 

Public Member Functions

 HealthImpl (const char *const compName)
 HealthImpl constructor. More...
 
void init (const NATIVE_INT_TYPE queueDepth, const NATIVE_INT_TYPE instance)
 HealthImpl initialization function. More...
 
void setPingEntries (PingEntry *pingEntries, NATIVE_INT_TYPE numPingEntries, U32 watchDogCode)
 Set ping entry tables. More...
 
 ~HealthImpl (void)
 Component destructor. More...
 
void Run_handler (const NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
 run handler More...
 
void HLTH_ENABLE_cmdHandler (const FwOpcodeType opCode, U32 cmdSeq, HealthEnabled enable)
 HLTH_ENABLE handler. More...
 
void HLTH_PING_ENABLE_cmdHandler (FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &entry, PingEnabled enable)
 HLTH_PING_ENABLE handler. More...
 
void HLTH_CHNG_PING_cmdHandler (const FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &entry, U32 warningValue, U32 fatalValue)
 HLTH_CHNG_PING handler. More...
 
NATIVE_INT_TYPE findEntry (Fw::CmdStringArg entry)
 
- Public Member Functions inherited from Svc::HealthComponentBase
Svc::InputPingPortget_PingReturn_InputPort (NATIVE_INT_TYPE portNum)
 
Svc::InputSchedPortget_Run_InputPort (NATIVE_INT_TYPE portNum)
 
Fw::InputCmdPortget_CmdDisp_InputPort (NATIVE_INT_TYPE portNum)
 
void set_PingSend_OutputPort (NATIVE_INT_TYPE portNum, Svc::InputPingPort *port)
 
void set_WdogStroke_OutputPort (NATIVE_INT_TYPE portNum, Svc::InputWatchDogPort *port)
 
void set_CmdStatus_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputCmdResponsePort *port)
 
void set_CmdReg_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputCmdRegPort *port)
 
void set_Tlm_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
 
void set_Time_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
 
void set_Log_OutputPort (NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
 
void regCommands (void)
 Register commands with the Command Dispatcher. More...
 
void init (NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instance=0)
 
virtual ~HealthComponentBase (void)
 
void Run_handlerBase (NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
 
void WdogStroke_out (NATIVE_INT_TYPE portNum, U32 code)
 
NATIVE_INT_TYPE getNum_Run_InputPorts (void)
 
NATIVE_INT_TYPE getNum_CmdDisp_InputPorts (void)
 
NATIVE_INT_TYPE getNum_WdogStroke_OutputPorts (void)
 
NATIVE_INT_TYPE getNum_CmdStatus_OutputPorts (void)
 
NATIVE_INT_TYPE getNum_CmdReg_OutputPorts (void)
 
NATIVE_INT_TYPE getNum_Tlm_OutputPorts (void)
 
NATIVE_INT_TYPE getNum_Time_OutputPorts (void)
 
NATIVE_INT_TYPE getNum_Log_OutputPorts (void)
 
bool isConnected_WdogStroke_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_CmdStatus_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_CmdReg_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_Tlm_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_Time_OutputPort (NATIVE_INT_TYPE portNum)
 
bool isConnected_Log_OutputPort (NATIVE_INT_TYPE portNum)
 
virtual void HLTH_PING_ENABLE_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 
virtual void HLTH_CHNG_PING_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 
void HLTH_PING_ENABLE_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
void HLTH_CHNG_PING_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
void log_FATAL_HLTH_PING_LATE (Fw::LogStringArg &entry)
 
void log_FATAL_HLTH_PING_WRONG_KEY (Fw::LogStringArg &entry, U32 badKey)
 
void log_ACTIVITY_HI_HLTH_CHECK_ENABLE (HealthIsEnabled enabled)
 
void log_ACTIVITY_HI_HLTH_CHECK_PING (HealthPingIsEnabled enabled, Fw::LogStringArg &entry)
 
void log_WARNING_LO_HLTH_CHECK_LOOKUP_ERROR (Fw::LogStringArg &entry)
 
void log_ACTIVITY_HI_HLTH_PING_UPDATED (Fw::LogStringArg &entry, U32 warn, U32 fatal)
 
void log_WARNING_HI_HLTH_PING_INVALID_VALUES (Fw::LogStringArg &entry, U32 warn, U32 fatal)
 
- Public Member Functions inherited from Fw::QueuedComponentBase
virtual ~QueuedComponentBase ()
 Destructor. More...
 
void init (NATIVE_INT_TYPE instance)
 initialization function More...
 
Os::Queue::QueueStatus createQueue (NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize)
 
virtual MsgDispatchStatus doDispatch (void)=0
 method to dispatch a single message in the queue. More...
 
NATIVE_INT_TYPE getNumMsgsDropped (void)
 return number of messages dropped More...
 
void incNumMsgDropped (void)
 increment the number of messages dropped More...
 
- Public Member Functions inherited from Fw::PassiveComponentBase
void setIdBase (const U32)
 Set the ID base. More...
 
U32 getIdBase (void) const
 
virtual ~PassiveComponentBase ()
 Destructor. More...
 
void init (NATIVE_INT_TYPE instance)
 Initialization function. More...
 
NATIVE_INT_TYPE getInstance (void) const
 

Public Attributes

PROTECTED __pad0__: virtual void doOtherChecks(void)
 
PRIVATE __pad1__: void PingReturn_handler(const NATIVE_INT_TYPE portNum
 
PRIVATE U32 key
 
struct Svc::HealthImpl::PingTracker m_pingTrackerEntries [NUM_PINGSEND_OUTPUT_PORTS]
 
U32 m_numPingEntries
 Private member data. More...
 
U32 m_key
 current key value. Just increments for each ping entry. More...
 
U32 m_watchDogCode
 stores code used for watchdog stroking More...
 
U32 m_warnings
 number of slip warnings issued More...
 
HealthEnabled m_enabled
 if the pinger is enabled More...
 
U32 queue_depth
 queue depth passed by user More...
 
- Public Attributes inherited from Svc::HealthComponentBase
PROTECTED __pad0__: HealthComponentBase(void)
 
PROTECTED __pad1__: virtual void PingReturn_handler( NATIVE_INT_TYPE portNum
 
PROTECTED U32 key = 0
 
PROTECTED __pad2__: void PingReturn_handlerBase( NATIVE_INT_TYPE portNum
 
PROTECTED __pad3__: virtual void PingReturn_preMsgHook( NATIVE_INT_TYPE portNum
 
PROTECTED __pad4__: void PingSend_out( NATIVE_INT_TYPE portNum
 
PROTECTED __pad5__: NATIVE_INT_TYPE getNum_PingReturn_InputPorts(void)
 
PROTECTED __pad6__: NATIVE_INT_TYPE getNum_PingSend_OutputPorts(void)
 
PROTECTED __pad7__: bool isConnected_PingSend_OutputPort( NATIVE_INT_TYPE portNum )
 
PROTECTED __pad8__: virtual MsgDispatchStatus doDispatch(void)
 
PROTECTED __pad9__: typedef enum { HLTH_CHK_DISABLED
 
PROTECTED HLTH_CHK_ENABLED
 
PROTECTED HealthEnabled_MAX HealthEnabled
 
PROTECTED __pad10__: enum { OPCODE_HLTH_ENABLE = 0x0
 
PROTECTED OPCODE_HLTH_PING_ENABLE = 0x1
 
PROTECTED OPCODE_HLTH_CHNG_PING = 0x2
 
PROTECTED PROTECTED: virtual void HLTH_ENABLE_cmdHandler( FwOpcodeType opCode
 
PROTECTED U32 cmdSeq
 
PROTECTED U32 HealthEnabled enable = 0
 
PROTECTED __pad11__: virtual void HLTH_ENABLE_preMsgHook( FwOpcodeType opCode
 
PROTECTED __pad12__: void HLTH_ENABLE_cmdHandlerBase( FwOpcodeType opCode
 
PROTECTED U32 Fw::CmdArgBufferargs
 
PROTECTED __pad13__: void cmdResponse_out( FwOpcodeType opCode
 
PROTECTED U32 Fw::CommandResponse response
 
PROTECTED __pad14__: enum { EVENTID_HLTH_PING_WARN = 0x0
 
PROTECTED EVENTID_HLTH_PING_LATE = 0x1
 
PROTECTED EVENTID_HLTH_PING_WRONG_KEY = 0x2
 
PROTECTED EVENTID_HLTH_CHECK_ENABLE = 0x3
 
PROTECTED EVENTID_HLTH_CHECK_PING = 0x4
 
PROTECTED EVENTID_HLTH_CHECK_LOOKUP_ERROR = 0x5
 
PROTECTED EVENTID_HLTH_PING_UPDATED = 0x6
 
PROTECTED EVENTID_HLTH_PING_INVALID_VALUES = 0x7
 
PROTECTED HEALTH_CHECK_ENABLED
 
PROTECTED HealthIsEnabled_MAX HealthIsEnabled
 
PROTECTED __pad15__: void log_WARNING_HI_HLTH_PING_WARN( Fw::LogStringArg& entry )
 
PROTECTED __pad16__: enum { CHANNELID_PINGLATEWARNINGS = 0x0
 Channel ID for PingLateWarnings. More...
 
PROTECTED __pad17__: Fw::Time getTime(void)
 
PRIVATE __pad18__: Svc::InputPingPort m_PingReturn_InputPort[NUM_PINGRETURN_INPUT_PORTS]
 
Svc::InputSchedPort m_Run_InputPort [NUM_RUN_INPUT_PORTS]
 
Fw::InputCmdPort m_CmdDisp_InputPort [NUM_CMDDISP_INPUT_PORTS]
 
PRIVATE __pad19__: Svc::OutputPingPort m_PingSend_OutputPort[NUM_PINGSEND_OUTPUT_PORTS]
 
Svc::OutputWatchDogPort m_WdogStroke_OutputPort [NUM_WDOGSTROKE_OUTPUT_PORTS]
 
Fw::OutputCmdResponsePort m_CmdStatus_OutputPort [NUM_CMDSTATUS_OUTPUT_PORTS]
 
Fw::OutputCmdRegPort m_CmdReg_OutputPort [NUM_CMDREG_OUTPUT_PORTS]
 
Fw::OutputTlmPort m_Tlm_OutputPort [NUM_TLM_OUTPUT_PORTS]
 
Fw::OutputTimePort m_Time_OutputPort [NUM_TIME_OUTPUT_PORTS]
 
Fw::OutputLogPort m_Log_OutputPort [NUM_LOG_OUTPUT_PORTS]
 
PRIVATE __pad20__: static void m_p_PingReturn_in( Fw::PassiveComponentBase* callComp
 
PRIVATE NATIVE_INT_TYPE portNum
 
PRIVATE NATIVE_INT_TYPE U32 key
 
- Public Attributes inherited from Fw::QueuedComponentBase
PROTECTED __pad0__: QueuedComponentBase(const char* name)
 Constructor. More...
 
Os::Queue m_queue
 queue object for active component More...
 
PRIVATE __pad1__: NATIVE_INT_TYPE m_msgsDropped
 number of messages dropped from full queue More...
 
- Public Attributes inherited from Fw::PassiveComponentBase
PROTECTED __pad0__: PassiveComponentBase(const char* name)
 Named constructor. More...
 
PRIVATE __pad1__: U32 m_idBase
 ID base for opcodes etc. More...
 
NATIVE_INT_TYPE m_instance
 instance of component object More...
 

Additional Inherited Members

- Public Types inherited from Svc::HealthComponentBase
enum  { NUM_PINGRETURN_INPUT_PORTS = 25, NUM_RUN_INPUT_PORTS = 1, NUM_CMDDISP_INPUT_PORTS = 1 }
 
enum  {
  NUM_PINGSEND_OUTPUT_PORTS = 25, NUM_WDOGSTROKE_OUTPUT_PORTS = 1, NUM_CMDSTATUS_OUTPUT_PORTS = 1, NUM_CMDREG_OUTPUT_PORTS = 1,
  NUM_TLM_OUTPUT_PORTS = 1, NUM_TIME_OUTPUT_PORTS = 1, NUM_LOG_OUTPUT_PORTS = 1, NUM_LOGTEXT_OUTPUT_PORTS = 1
}
 
enum  PingEnabled { HLTH_PING_DISABLED, HLTH_PING_ENABLED, PingEnabled_MAX }
 
enum  HealthPingIsEnabled { HEALTH_PING_DISABLED, HEALTH_PING_ENABLED, HealthPingIsEnabled_MAX }
 
- Public Types inherited from Fw::QueuedComponentBase
enum  MsgDispatchStatus { MSG_DISPATCH_OK, MSG_DISPATCH_EMPTY, MSG_DISPATCH_ERROR, MSG_DISPATCH_EXIT }
 
- Static Public Member Functions inherited from Svc::HealthComponentBase
static void m_p_Run_in (Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
 
static void m_p_CmdDisp_in (Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
- Protected Member Functions inherited from Fw::ObjBase
 ObjBase (const char *name)
 ObjBase constructor. More...
 
virtual ~ObjBase ()
 Destructor. More...
 
void init (void)
 Object initializer. More...
 

Detailed Description

Health component implementation class.

The health component iterates through each entry in its table and checks its status. If an ping entry tracker is enabled, it will ping its corresponding port with a provided key. If a ping return is outstanding, a counter is decremented, and its value is checked against warning and fault thresholds. A watchdog is always stroked in the run handler.

Definition at line 32 of file HealthComponentImpl.hpp.

Constructor & Destructor Documentation

◆ HealthImpl()

Svc::HealthImpl::HealthImpl ( const char *const  compName)

HealthImpl constructor.

The constructor for Health

Parameters
compNamecomponent name

Definition at line 23 of file HealthComponentImpl.cpp.

◆ ~HealthImpl()

Svc::HealthImpl::~HealthImpl ( void  )

Component destructor.

The destructor for HealthImpl is empty

Definition at line 64 of file HealthComponentImpl.cpp.

Member Function Documentation

◆ findEntry()

NATIVE_INT_TYPE Svc::HealthImpl::findEntry ( Fw::CmdStringArg  entry)

Definition at line 209 of file HealthComponentImpl.cpp.

◆ HLTH_CHNG_PING_cmdHandler()

void Svc::HealthImpl::HLTH_CHNG_PING_cmdHandler ( const FwOpcodeType  opCode,
U32  cmdSeq,
const Fw::CmdStringArg entry,
U32  warningValue,
U32  fatalValue 
)
virtual

HLTH_CHNG_PING handler.

Implementation for HLTH_CHNG_PING command handler

Parameters
opCodeCommand opcode
cmdSeqCommand sequence
entryPing entry number
warningValueWarning threshold value
fatalValueFatal threshold value

Implements Svc::HealthComponentBase.

Definition at line 185 of file HealthComponentImpl.cpp.

◆ HLTH_ENABLE_cmdHandler()

void Svc::HealthImpl::HLTH_ENABLE_cmdHandler ( const FwOpcodeType  opCode,
U32  cmdSeq,
HealthEnabled  enable 
)

HLTH_ENABLE handler.

Implementation for HLTH_ENABLE command handler

Parameters
opCodeCommand opcode
cmdSeqCommand sequence
enableEnum for enabling/disabling tracker

Definition at line 148 of file HealthComponentImpl.cpp.

◆ HLTH_PING_ENABLE_cmdHandler()

void Svc::HealthImpl::HLTH_PING_ENABLE_cmdHandler ( FwOpcodeType  opCode,
U32  cmdSeq,
const Fw::CmdStringArg entry,
PingEnabled  enable 
)
virtual

HLTH_PING_ENABLE handler.

Handler for command HLTH_PING_ENABLE

Parameters
opCodeCommand opcode
cmdSeqCommand sequence
entryPing entry number
enableEnum for enabling/disabling tracker

Implements Svc::HealthComponentBase.

Definition at line 159 of file HealthComponentImpl.cpp.

◆ init()

void Svc::HealthImpl::init ( const NATIVE_INT_TYPE  queueDepth,
const NATIVE_INT_TYPE  instance 
)

HealthImpl initialization function.

Initializes the autocoded base class, ping table, and data members

Parameters
queueDepthDepth of queue
instanceThe instance number

Definition at line 39 of file HealthComponentImpl.cpp.

◆ Run_handler()

void Svc::HealthImpl::Run_handler ( const NATIVE_INT_TYPE  portNum,
NATIVE_UINT_TYPE  context 
)
virtual

run handler

Handler implementation for run

Parameters
portNumPort number
contextPort Context

Implements Svc::HealthComponentBase.

Definition at line 85 of file HealthComponentImpl.cpp.

◆ setPingEntries()

void Svc::HealthImpl::setPingEntries ( PingEntry pingEntries,
NATIVE_INT_TYPE  numPingEntries,
U32  watchDogCode 
)

Set ping entry tables.

Provides a table of ping entries

Parameters
pingEntriesPointer to provided ping table entries
numPingEntriesNumber of ping entries in table
watchDogCodeValue that is sent to watchdog

Definition at line 45 of file HealthComponentImpl.cpp.

Member Data Documentation

◆ __pad0__

PROTECTED Svc::HealthImpl::__pad0__

Definition at line 80 of file HealthComponentImpl.hpp.

◆ __pad1__

PRIVATE Svc::HealthImpl::__pad1__

Definition at line 87 of file HealthComponentImpl.hpp.

◆ key

PRIVATE U32 Svc::HealthImpl::key

Definition at line 95 of file HealthComponentImpl.hpp.

◆ m_enabled

HealthEnabled Svc::HealthImpl::m_enabled

if the pinger is enabled

Definition at line 152 of file HealthComponentImpl.hpp.

◆ m_key

U32 Svc::HealthImpl::m_key

current key value. Just increments for each ping entry.

Definition at line 149 of file HealthComponentImpl.hpp.

◆ m_numPingEntries

U32 Svc::HealthImpl::m_numPingEntries

Private member data.

stores number of entries passed to constructor

Definition at line 148 of file HealthComponentImpl.hpp.

◆ m_pingTrackerEntries

struct Svc::HealthImpl::PingTracker Svc::HealthImpl::m_pingTrackerEntries[NUM_PINGSEND_OUTPUT_PORTS]

◆ m_warnings

U32 Svc::HealthImpl::m_warnings

number of slip warnings issued

Definition at line 151 of file HealthComponentImpl.hpp.

◆ m_watchDogCode

U32 Svc::HealthImpl::m_watchDogCode

stores code used for watchdog stroking

Definition at line 150 of file HealthComponentImpl.hpp.

◆ queue_depth

U32 Svc::HealthImpl::queue_depth

queue depth passed by user

Definition at line 153 of file HealthComponentImpl.hpp.


The documentation for this class was generated from the following files: