27 #include "FwSmConstants.h"
28 #include "FwSmDCreate.h"
29 #include "FwSmConfig.h"
31 #include "FwPrConstants.h"
32 #include "FwPrDCreate.h"
33 #include "FwPrConfig.h"
46 static void RunCIP(FwSmDesc_t smDesc);
53 static void RunCRP(FwSmDesc_t smDesc);
60 static void StartCEP(FwSmDesc_t smDesc);
67 static void ExecCEP(FwSmDesc_t smDesc);
74 static void StopCEP(FwSmDesc_t smDesc);
78 FwSmCounterS1_t nOfStates = 3;
79 FwSmCounterS1_t nOfChoicePseudoStates = 2;
80 FwSmCounterS1_t nOfTrans = 9;
81 FwSmCounterS1_t nOfActions = 6;
82 FwSmCounterS1_t nOfGuards = 1;
83 FwSmCounterS1_t CPS_1 = 1;
84 FwSmCounterS1_t CPS_2 = 2;
90 baseCmpSmDesc = FwSmCreate(nOfStates, nOfChoicePseudoStates, nOfTrans, nOfActions, nOfGuards);
128 FwSmMakeTrans(smDesc, FW_TR_EXECUTE);
163 return FwSmIsStarted(smDesc);
CrFwInstanceId_t CrFwCmpGetInstanceId(FwSmDesc_t smDesc)
Return the instance identifier of the argument component.
CrFwBool_t CrFwCmpIsStarted(FwSmDesc_t smDesc)
Return true if the state machine of the argument component has been started.
FwPrDesc_t CrFwCmpGetResetPr(FwSmDesc_t smDesc)
Return the descriptor of the Reset Procedure of the argument component.
FwPrDesc_t CrFwCmpGetExecPr(FwSmDesc_t smDesc)
Return the descriptor of the Execution Procedure of the argument component.
void CrFwCmpInit(FwSmDesc_t smDesc)
Initialize a framework component.
CrFwBool_t CrFwCmpIsInInitialized(FwSmDesc_t smDesc)
Return true if the argument component is in state INITIALIZED.
void CrFwCmpShutdown(FwSmDesc_t smDesc)
Shutdown a framework component.
void CrFwBaseCmpDefShutdownAction(FwSmDesc_t smDesc)
Function which performs the Shutdown Action for the Base State Machine.
CrFwBool_t CrFwCmpIsInConfigured(FwSmDesc_t smDesc)
Return true if the argument component is in state CONFIGURED.
void CrFwCmpReset(FwSmDesc_t smDesc)
Reset a framework component.
CrFwBool_t CrFwCmpIsInCreated(FwSmDesc_t smDesc)
Return true if the argument component is in state CREATED.
FwPrDesc_t CrFwCmpGetInitPr(FwSmDesc_t smDesc)
Return the descriptor of the Initialization Procedure of the argument component.
static void RunCIP(FwSmDesc_t smDesc)
Function which runs the Component Initialization Procedure.
static void StartCEP(FwSmDesc_t smDesc)
Function which starts the Component Execution Procedure.
void CrFwCmpExecute(FwSmDesc_t smDesc)
Execute a framework component.
static void ExecCEP(FwSmDesc_t smDesc)
Function which executes the Component Execution Procedure.
static FwSmDesc_t baseCmpSmDesc
The singleton instance of the Base State Machine.
static void StopCEP(FwSmDesc_t smDesc)
Function which stops the Component Execution Procedure.
static void RunCRP(FwSmDesc_t smDesc)
Function which runs the Component Reset Procedure.
FwSmDesc_t CrFwBaseCmpMake()
Retrieve the singleton instance of the Base State Machine.
CrFwTypeId_t CrFwCmpGetTypeId(FwSmDesc_t smDesc)
Return the type identifier of the argument component.
Definition of Base Component.
Definition of the Framework Component Data (FCD) Type.
Header file to define all invariant publicly available constants and types for the CORDET Framework.
#define CRFW_UNUSED(x)
A macro that can be used to specify that a function parameter is not used.
#define CR_FW_BASE_TR_INIT
Identifier for transition command "Init" in the Base State Machine.
#define CR_FW_BASE_STATE_INITIALIZED
State identifier for state INITIALIZED in the Base State Machine.
#define CR_FW_BASE_STATE_CREATED
State identifier for state CREATED in the Base State Machine.
#define CR_FW_BASE_TR_RESET
Identifier for transition command "Reset" in the Base State Machine.
#define CR_FW_BASE_TR_SHUTDOWN
Identifier for transition command "Shutdown" in the Base State Machine.
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
#define CR_FW_BASE_STATE_CONFIGURED
State identifier for state CONFIGURED in the Base State Machine.
Component Initialization Procedure (CIP) for the Base Component.
Component Reset Procedure (CRP) for the Base Component.
unsigned short int CrFwTypeId_t
Type used for the identifier of a component type.
unsigned short CrFwInstanceId_t
Type used for instance identifiers.
FwSmBool_t CrFwIsSmOutcomeOne(FwSmDesc_t smDesc)
Convenience function to check whether the outcome of the last check or action is equal to 1 ("true").
Definition of the utility functions for the CORDET Framework.
Type for the Framework Component Data (FCD).
FwPrDesc_t initProc
The Component Initialization Procedure (CIP) (see CrFwInitProc.h).
CrFwInstanceId_t instanceId
The instance identifier of the framework component.
FwPrDesc_t resetProc
The Component Reset Procedure (CRP) (see CrFwResetProc.h).
FwPrDesc_t execProc
The Component Execution Procedure (CEP) (see CrFwBaseCmp.h).
CrFwTypeId_t typeId
The type identifier of the framework component.