FW Profile - C1 Implementation
FwPrCore.c File Reference

Implements Core Functions of the FW Procedure. More...

Go to the source code of this file.

Functions

FwPrBool_t PrDummyGuard (FwPrDesc_t prDesc)
 Dummy guard which always returns true. More...
 
void FwPrStart (FwPrDesc_t prDesc)
 Start a procedure. More...
 
void FwPrStop (FwPrDesc_t prDesc)
 Stop a procedure. More...
 
void FwPrExecute (FwPrDesc_t prDesc)
 Execute a procedure. More...
 
void FwPrRun (FwPrDesc_t prDesc)
 Run a procedure. More...
 
FwPrCounterS1_t FwPrGetCurNode (FwPrDesc_t prDesc)
 Return the identifier of the current action node in a procedure. More...
 
FwPrBool_t FwPrIsStarted (FwPrDesc_t prDesc)
 Check whether the procedure is started. More...
 
FwPrErrCode_t FwPrGetErrCode (FwPrDesc_t prDesc)
 Return the error code of the argument procedure. More...
 
FwPrCounterU3_t FwPrGetExecCnt (FwPrDesc_t prDesc)
 Return the Procedure Execution Counter. More...
 
FwPrCounterU3_t FwPrGetNodeExecCnt (FwPrDesc_t prDesc)
 Return the Node Execution Counter. More...
 

Detailed Description

Implements Core Functions of the FW Procedure.

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 FW Profile.

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 FwPrCore.c.

Function Documentation

void FwPrExecute ( FwPrDesc_t  prDesc)

Execute a procedure.

The semantics of this function is defined by the following activity diagram (this is taken from figure 3.3-2 in the "FW Profile Definition Document"):

PR_Execution.png

If the execution of the procedure passes through a decision node and there are two or more control flows out of that node which have guards which evaluate to true, the control flow to be taken is the one which was added first to the procedure.

The FW Profile stipulates that at least one of the control flows out of a decision node must have a guard evaluating to true. This constraint is not enforced by this function. However, if the constraint is violated, the error code is set to prFlowErr. The procedure, however, remains in a consistent state.

Parameters
prDescthe descriptor of the procedure where the transition is triggered.

Definition at line 43 of file FwPrCore.c.

FwPrCounterS1_t FwPrGetCurNode ( FwPrDesc_t  prDesc)

Return the identifier of the current action node in a procedure.

The following convention is used:

  • If the procedure is in the STOPPED state, this function returns 0.
  • If the procedure is in the STARTED state but has not yet executed any action (either because the procedure has not yet been executed or because it has been executed but the guard from the initial node is false), this function returns -1.
  • If the procedure is in the STARTED state and has already left the initial node, the procedure returns the identifier of the current node (a positive integer).
Parameters
prDescthe descriptor of the procedure.
Returns
the identifier of the current action node of the procedure (or 0 if the procedure is at the initial node, or -1 if the procedure is in the STOPPED state).

Definition at line 117 of file FwPrCore.c.

FwPrErrCode_t FwPrGetErrCode ( FwPrDesc_t  prDesc)

Return the error code of the argument procedure.

The error code of a procedure holds either prSuccess if the procedure never encountered an error or else it holds the code of the last error encountered by the procedure. If the error code is different from prSuccess, the behaviour of the procedure is undefined.

Parameters
prDescthe descriptor of the procedure.
Returns
either prSuccess or the code of the last error encountered by the procedure.

Definition at line 131 of file FwPrCore.c.

FwPrCounterU3_t FwPrGetExecCnt ( FwPrDesc_t  prDesc)

Return the Procedure Execution Counter.

The Procedure Execution Counter holds the number of execution cycles since the procedure was started. Note that the Procedure Execution Counter is not reset when the procedure is stopped (it is only reset when the procedure is started).

Parameters
prDescthe descriptor of the procedure.
Returns
the value of the Procedure Execution Counter.

Definition at line 136 of file FwPrCore.c.

FwPrCounterU3_t FwPrGetNodeExecCnt ( FwPrDesc_t  prDesc)

Return the Node Execution Counter.

The Node Execution Counter holds the number of execution cycles since the current node was entered. Note that the Node Execution Counter is not reset when the procedure is stopped (it is only reset when the procedure is started).

Parameters
prDescthe descriptor of the procedure.
Returns
the value of the Node Execution Counter.

Definition at line 141 of file FwPrCore.c.

FwPrBool_t FwPrIsStarted ( FwPrDesc_t  prDesc)

Check whether the procedure is started.

Parameters
prDescthe descriptor of the procedure.
Returns
1 if the procedure is STARTED or 0 if it is STOPPED.

Definition at line 122 of file FwPrCore.c.

void FwPrRun ( FwPrDesc_t  prDesc)

Run a procedure.

When a procedure is run, the procedure is first started, then it is executed once, and then it is stopped.

Parameters
prDescthe descriptor of the procedure where the transition is triggered.

Definition at line 109 of file FwPrCore.c.

void FwPrStart ( FwPrDesc_t  prDesc)

Start a procedure.

The semantics of this operation is defined by the activity diagram of the following figure (this is figure 3.3-1 in the "FW Profile Definition Document"):

PR_StartStop.png
Parameters
prDescthe descriptor of the procedure to be started.

Definition at line 29 of file FwPrCore.c.

void FwPrStop ( FwPrDesc_t  prDesc)

Stop a procedure.

The semantics of this operation is defined by the activity diagram of the following figure (this is figure 3.3-1 in the "FW Profile Definition Document"):

SM_StartStop.png
Parameters
prDescthe descriptor of the procedure to be started.

Definition at line 38 of file FwPrCore.c.

FwPrBool_t PrDummyGuard ( FwPrDesc_t  prDesc)

Dummy guard which always returns true.

This guard is used where no control flow guard is specified.

Parameters
prDescprocedure descriptor. This parameter is unused in this dummy guard. The parameter is retained for compatibility with the FwPrGuard_t type.
Returns
always return 1 (to signify that the guard is true).

Definition at line 23 of file FwPrCore.c.

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