FW Profile - C1 Implementation
FwDaFDCheck.h File Reference

Definition of the Failure Detection (FD) Check State Machine. More...

Go to the source code of this file.

Data Structures

struct  FDCheckData
 Type for the data of an FD Check State Machine. More...
 

Macros

#define FD_CHECK_DISABLED   1
 Name of the DISABLED state in the FD Check State Machine.
 
#define FD_CHECK_ENABLED   2
 Name of the ENABLED state in the FD Check State Machine.
 
#define FD_CHECK_HEALTHY   1
 Name of the HEALTHY sub-state in the FD Check State Machine.
 
#define FD_CHECK_SUSPECTED   2
 Name of the SUSPECTED state in the FD Check State Machine.
 
#define FD_CHECK_FAILED   3
 Name of the FAILED state in the FD Check State Machine.
 
#define TR_FD_CHECK_ENABLE   1
 Name of the transition to enable a FD Check.
 
#define TR_FD_CHECK_DISABLE   2
 Name of the transition to disable a FD Check.
 
#define TR_FD_CHECK_RESET   3
 Name of the transition to reset a FD Check.
 

Typedefs

typedef struct FDCheckData FDCheckData_t
 Type for the data of an FD Check State Machine. More...
 

Enumerations

Functions

FDCheckData_tGetFDCheckData (FwSmDesc_t smDesc)
 Get the pointer to the state machine data of an FD Check State Machine. More...
 
FwSmDesc_t GetFailDetCheckSm ()
 Retrieve the descriptor of the FD Check State Machine. More...
 
void DefAnomalyDetCheck (FwSmDesc_t smDesc)
 Default implementation of the Anomaly Detection Check. More...
 
void DefRecoveryAction (FwSmDesc_t smDesc)
 Default implementation of the Recovery Action. More...
 

Detailed Description

Definition of the Failure Detection (FD) Check State Machine.

A FD Check State Machine is a state machine which encapsulates a Failure Detection (FD) Check for the Hardware Device. A Failure Detection Check is a check which is performed periodically to monitor the health of the Hardware Device. The FD Check State Machine defines the generic behaviour which is shared by all FD Checks. A specific FD Check is encapsulated in a state machine which is obtained by extending the FD Check State Machine.

An FD Check can be in one of two states: ENABLED or DISABLED. When an FD Check is in state DISABLED, it does not perform any monitoring action. When an FD Check is in state ENABLED, it performs the Anomaly Detection Check. The Anomaly Detection Check is a function which monitors a certain aspect of the health of the Hardware Device and which, every time it is called, can return one of two outcomes: anomaly detected or no anomaly detected.

State ENABLED is sub-divided into three sub-states: HEALTHY, SUSPECTED, and FAILED. State HEALTHY indicates a situation where no anomalies have been detected in the Hardware Device. State SUSPECTED indicates a situation where anomalies have been detected but the number of consecutive anomalies is less than cntLimit. State FAILED indicates a situation where more than cntLimit consecutive anomalies have been detected and where the Hardware Device has consequently been declared to have failed.

When state FAILED is entered, the Recovery Action is executed. This action is intended to remove the failure which has been detected by the FD Check.

The FD Check State Machine is shown in the figure below. The stereotype "AP" designate actions which can be overridden when the state machine is extended. Specific FD Checks specialize the generic behaviour shown in the figure by providing their own Anomaly Detection Check and their own Recovery Action. The default implementation provided by the FD Check State Machine for these two actions is:

  • The default Anomaly Detection Check always returns: "no anomaly detected".
  • The default Recovery Action returns without doing anything.
FailDetCheck.png
Author
Vaclav Cechticky, Alessandro Pasetti

Definition in file FwDaFDCheck.h.

Typedef Documentation

typedef struct FDCheckData FDCheckData_t

Type for the data of an FD Check State Machine.

The fields in this structure represent data which are used by a generic FD Check State Machine. An instance of this data structure is stored in the state machine descriptor of each FD Check State Machine and is consequently available to all functions implementing actions and guards of an FD Check State Machine.

Enumeration Type Documentation

Type for the identifiers of the FD Checks.

Enumerator
curFDCheckId 

Identifier of the Current FD Check (see FwDaCurCheck.h)

tempFDCheckId 

Identifier of the Temperature FD Check (see FwDaTempCheck.h)

deltaFDCheckId 

Identifier of the Delta FD Check (see FwDaDeltaCheck.h)

Definition at line 82 of file FwDaFDCheck.h.

Type for the outcome of the Anomaly Detection Check.

Enumerator
noAnomalyDetected 

Outcome generated when the Anomaly Detection Check detects no anomaly.

anomalyDetected 

Outcome generated when the Anomaly Detection Check detects an anomaly.

Definition at line 92 of file FwDaFDCheck.h.

Function Documentation

void DefAnomalyDetCheck ( FwSmDesc_t  smDesc)

Default implementation of the Anomaly Detection Check.

This default implementation always returns: "no anomaly detected".

Parameters
smDescthe state machine descriptor

Definition at line 164 of file FwDaFDCheck.c.

void DefRecoveryAction ( FwSmDesc_t  smDesc)

Default implementation of the Recovery Action.

This default implementation returns without doing anything.

Parameters
smDescthe state machine descriptor

Definition at line 171 of file FwDaFDCheck.c.

FwSmDesc_t GetFailDetCheckSm ( )

Retrieve the descriptor of the FD Check State Machine.

The FD Check State Machine is a singleton. The first time this function is called, it creates and configures the state machine descriptor. Subsequently, it always returns the same descriptor.

Returns
the descriptor of the FD Check State Machine or NULL if the state machine could not be created.

Definition at line 176 of file FwDaFDCheck.c.

FDCheckData_t* GetFDCheckData ( FwSmDesc_t  smDesc)

Get the pointer to the state machine data of an FD Check State Machine.

This function is a wrapper for the FwSmGetData function. Function FwSmGetData is defined at the level of the State Machine Module and returns the pointer to the state machine data as a pointer to void. This function cast this pointer to point to FDCheckData_t.

Parameters
smDescthe state machine descriptor
Returns
pointer to the state machine data

Definition at line 159 of file FwDaFDCheck.c.

P&P Software GmbH, Copyright 2011, All Rights Reserved