CORDET Framework - C2 Implementation
CrFwAppSm.c File Reference

Implementation of Application State Machine. More...

Go to the source code of this file.

Macros

#define CR_FW_APP_STATE_START_UP   1
 State identifier for state START_UP in the application State Machine.
 
#define CR_FW_APP_STATE_NORMAL   2
 State identifier for state NORMAL in the application State Machine.
 
#define CR_FW_APP_STATE_RESET   3
 State identifier for state RESET in the application State Machine.
 
#define CR_FW_APP_STATE_SHUTDOWN   4
 State identifier for state SHUTDOWN in the application State Machine.
 
#define CR_FW_APP_TR_RESET   CR_FW_APP_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+0
 Identifier for transition command "Reset" in the Application State Machine.
 
#define CR_FW_APP_TR_SHUTDOWN   CR_FW_APP_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+1
 Identifier for transition command "Shutdown" in the Application State Machine.
 

Functions

static void StartAppStartUpPr (FwSmDesc_t smDesc)
 Function which starts the Application Start-Up Procedure. More...
 
static void StartAppResetPr (FwSmDesc_t smDesc)
 Function which starts the Application Reset Procedure. More...
 
static void StartAppShutdownPr (FwSmDesc_t smDesc)
 Function which starts the Application Shutdown Procedure. More...
 
static FwSmBool_t IsStartUpPrTerminated (FwSmDesc_t smDesc)
 Function which checks whether the Application Start-Up Procedure has terminated. More...
 
static FwSmBool_t IsResetPrTerminated (FwSmDesc_t smDesc)
 Function which checks whether the Application Reset Procedure has terminated. More...
 
static FwSmBool_t IsShutdownPrTerminated (FwSmDesc_t smDesc)
 Function which checks whether the Application Shutdown Procedure has terminated. More...
 
FwSmDesc_t CrFwAppSmMake ()
 Retrieve the singleton instance of the Application State Machine. More...
 
void CrFwAppSmStart ()
 Start the Application State Machine. More...
 
void CrFwAppSmExecute ()
 Execute the Application State Machine. More...
 
void CrFwAppSmReset ()
 Reset the Application State Machine. More...
 
void CrFwAppSmShutdown ()
 Shutdown the Application State Machine. More...
 
CrFwBool_t CrFwAppSmIsStarted ()
 Return true if the Application State Machine has been started. More...
 
CrFwBool_t CrFwAppSmIsInStartUp ()
 Return true if the Application State Machine is in state START_UP. More...
 
CrFwBool_t CrFwAppSmIsInNormal ()
 Return true if the Application State Machine is in state NORMAL. More...
 
CrFwBool_t CrFwAppSmIsInReset ()
 Return true if the Application State Machine is in state RESET. More...
 
CrFwBool_t CrFwAppSmIsInShutdown ()
 Return true if the Application State Machine is in state SHUTDOWN. More...
 
FwSmDesc_t CrFwAppSmGetEsmStartUp ()
 Return the state machine embedded in state START-UP (or NULL if no state machine is embedded in START-UP). More...
 
FwSmDesc_t CrFwAppSmGetEsmNormal ()
 Return the state machine embedded in state NORMAL (or NULL if no state machine is embedded in NORMAL). More...
 
FwSmDesc_t CrFwAppSmGetEsmReset ()
 Return the state machine embedded in state RESET (or NULL if no state machine is embedded in RESET). More...
 
FwSmDesc_t CrFwAppSmGetEsmShutdown ()
 Return the state machine embedded in state SHUTDOWN (or NULL if no state machine is embedded in SHUTDOWN). More...
 

Variables

static FwSmDesc_t appSmDesc = NULL
 The singleton instance of the Application State Machine.
 

Detailed Description

Implementation of Application State Machine.

Author
Vaclav Cechticky vacla.nosp@m.v.ce.nosp@m.chtic.nosp@m.ky@p.nosp@m.np-so.nosp@m.ftwa.nosp@m.re.co.nosp@m.m
Alessandro Pasetti paset.nosp@m.ti@p.nosp@m.np-so.nosp@m.ftwa.nosp@m.re.co.nosp@m.m

This file is part of the CORDET Framework.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

For information on alternative licensing, please contact P&P Software GmbH.

Definition in file CrFwAppSm.c.

Function Documentation

◆ CrFwAppSmExecute()

void CrFwAppSmExecute ( )

Execute the Application State Machine.

This function sends command Execute to the Application State Machine.

Definition at line 144 of file CrFwAppSm.c.

◆ CrFwAppSmGetEsmNormal()

FwSmDesc_t CrFwAppSmGetEsmNormal ( )

Return the state machine embedded in state NORMAL (or NULL if no state machine is embedded in NORMAL).

Returns
the state machine embedded in state NORMAL (or NULL if no state machine is embedded in NORMAL)

Definition at line 228 of file CrFwAppSm.c.

◆ CrFwAppSmGetEsmReset()

FwSmDesc_t CrFwAppSmGetEsmReset ( )

Return the state machine embedded in state RESET (or NULL if no state machine is embedded in RESET).

Returns
the state machine embedded in state RESET (or NULL if no state machine is embedded in RESET)

Definition at line 233 of file CrFwAppSm.c.

◆ CrFwAppSmGetEsmShutdown()

FwSmDesc_t CrFwAppSmGetEsmShutdown ( )

Return the state machine embedded in state SHUTDOWN (or NULL if no state machine is embedded in SHUTDOWN).

Returns
the state machine embedded in state SHUTDOWN (or NULL if no state machine is embedded in SHUTDOWN)

Definition at line 238 of file CrFwAppSm.c.

◆ CrFwAppSmGetEsmStartUp()

FwSmDesc_t CrFwAppSmGetEsmStartUp ( )

Return the state machine embedded in state START-UP (or NULL if no state machine is embedded in START-UP).

Returns
the state machine embedded in state START-UP (or NULL if no state machine is embedded in START-UP)

Definition at line 223 of file CrFwAppSm.c.

◆ CrFwAppSmIsInNormal()

CrFwBool_t CrFwAppSmIsInNormal ( )

Return true if the Application State Machine is in state NORMAL.

Returns
1 if the Application State Machine is in state NORMAL; 0 otherwise

Definition at line 169 of file CrFwAppSm.c.

◆ CrFwAppSmIsInReset()

CrFwBool_t CrFwAppSmIsInReset ( )

Return true if the Application State Machine is in state RESET.

Returns
1 if the Application State Machine is in state RESET; 0 otherwise

Definition at line 174 of file CrFwAppSm.c.

◆ CrFwAppSmIsInShutdown()

CrFwBool_t CrFwAppSmIsInShutdown ( )

Return true if the Application State Machine is in state SHUTDOWN.

Returns
1 if the Application State Machine is in state SHUTDOWN; 0 otherwise

Definition at line 179 of file CrFwAppSm.c.

◆ CrFwAppSmIsInStartUp()

CrFwBool_t CrFwAppSmIsInStartUp ( )

Return true if the Application State Machine is in state START_UP.

Returns
1 if the Application State Machine is in state START_UP; 0 otherwise

Definition at line 164 of file CrFwAppSm.c.

◆ CrFwAppSmIsStarted()

CrFwBool_t CrFwAppSmIsStarted ( )

Return true if the Application State Machine has been started.

Returns
1 if the Application State Machine has been started; 0 otherwise

Definition at line 159 of file CrFwAppSm.c.

◆ CrFwAppSmMake()

FwSmDesc_t CrFwAppSmMake ( )

Retrieve the singleton instance of the Application State Machine.

The Application State Machine is a singleton. The first time this function is called, it creates the Application State Machine. Subsequently, it always returns the same instance.

The first time this function is called, it returns the Application State Machine before it has been started.

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

Definition at line 106 of file CrFwAppSm.c.

◆ CrFwAppSmReset()

void CrFwAppSmReset ( )

Reset the Application State Machine.

This function sends command Reset to the Application State Machine.

Definition at line 149 of file CrFwAppSm.c.

◆ CrFwAppSmShutdown()

void CrFwAppSmShutdown ( )

Shutdown the Application State Machine.

This function sends command Shutdown to the Application State Machine.

Definition at line 154 of file CrFwAppSm.c.

◆ CrFwAppSmStart()

void CrFwAppSmStart ( )

Start the Application State Machine.

This function causes the Application State Machine to make the transition from its initial pseudo-state into its initial state START_UP.

Definition at line 139 of file CrFwAppSm.c.

◆ IsResetPrTerminated()

static FwSmBool_t IsResetPrTerminated ( FwSmDesc_t  smDesc)
static

Function which checks whether the Application Reset Procedure has terminated.

This function acts as guard on the transition out of RESET.

Parameters
smDescthe state machine descriptor
Returns
1 if the Application Reset Procedure has terminated, 0 otherwise

Definition at line 211 of file CrFwAppSm.c.

◆ IsShutdownPrTerminated()

static FwSmBool_t IsShutdownPrTerminated ( FwSmDesc_t  smDesc)
static

Function which checks whether the Application Shutdown Procedure has terminated.

This function acts as guard on the transition out of SHUTDOWN.

Parameters
smDescthe state machine descriptor
Returns
1 if the Application Shutdown Procedure has terminated, 0 otherwise

Definition at line 217 of file CrFwAppSm.c.

◆ IsStartUpPrTerminated()

static FwSmBool_t IsStartUpPrTerminated ( FwSmDesc_t  smDesc)
static

Function which checks whether the Application Start-Up Procedure has terminated.

This function acts as guard on the transition out of START_UP.

Parameters
smDescthe state machine descriptor
Returns
1 if the Application Start-Up Procedure has terminated, 0 otherwise

Definition at line 205 of file CrFwAppSm.c.

◆ StartAppResetPr()

static void StartAppResetPr ( FwSmDesc_t  smDesc)
static

Function which starts the Application Reset Procedure.

This function is used as entry action for the RESET state.

Parameters
smDescthe state machine descriptor

Definition at line 191 of file CrFwAppSm.c.

◆ StartAppShutdownPr()

static void StartAppShutdownPr ( FwSmDesc_t  smDesc)
static

Function which starts the Application Shutdown Procedure.

This function is used as entry action for the SHUTDOWN state.

Parameters
smDescthe state machine descriptor

Definition at line 198 of file CrFwAppSm.c.

◆ StartAppStartUpPr()

static void StartAppStartUpPr ( FwSmDesc_t  smDesc)
static

Function which starts the Application Start-Up Procedure.

This function is used as entry action for the START_UP state.

Parameters
smDescthe state machine descriptor

Definition at line 184 of file CrFwAppSm.c.

P&P Software GmbH, Copyright 2012-2013, All Rights Reserved