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);
#define CR_FW_BASE_TR_RESET
Identifier for transition command "Reset" in the Base State Machine.
Type for the Framework Component Data (FCD).
static void StopCEP(FwSmDesc_t smDesc)
Function which stops the Component Execution Procedure.
unsigned short CrFwInstanceId_t
Type used for instance identifiers.
CrFwTypeId_t CrFwCmpGetTypeId(FwSmDesc_t smDesc)
Return the type identifier of the argument component.
void CrFwCmpInit(FwSmDesc_t smDesc)
Initialize a framework component.
Definition of the Framework Component Data (FCD) Type.
FwPrDesc_t CrFwCmpGetExecPr(FwSmDesc_t smDesc)
Return the descriptor of the Execution Procedure of the argument component.
#define CRFW_UNUSED(x)
A macro that can be used to specify that a function parameter is not used.
CrFwBool_t CrFwCmpIsInConfigured(FwSmDesc_t smDesc)
Return true if the argument component is in state CONFIGURED.
CrFwBool_t CrFwCmpIsInCreated(FwSmDesc_t smDesc)
Return true if the argument component is in state CREATED.
CrFwInstanceId_t CrFwCmpGetInstanceId(FwSmDesc_t smDesc)
Return the instance identifier of the argument component.
void CrFwBaseCmpDefShutdownAction(FwSmDesc_t smDesc)
Function which performs the Shutdown Action for the Base State Machine.
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
#define CR_FW_BASE_STATE_CREATED
State identifier for state CREATED in the Base State Machine.
FwPrDesc_t resetProc
The Component Reset Procedure (CRP) (see CrFwResetProc.h).
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.
Header file to define all invariant publicly available constants and types for the CORDET Framework...
CrFwBool_t CrFwCmpIsInInitialized(FwSmDesc_t smDesc)
Return true if the argument component is in state INITIALIZED.
CrFwInstanceId_t instanceId
The instance identifier of the framework component.
#define CR_FW_BASE_TR_SHUTDOWN
Identifier for transition command "Shutdown" in the Base State Machine.
static void StartCEP(FwSmDesc_t smDesc)
Function which starts the Component Execution Procedure.
Definition of the utility functions for the CORDET Framework.
FwPrDesc_t CrFwCmpGetInitPr(FwSmDesc_t smDesc)
Return the descriptor of the Initialization Procedure of the argument component.
FwPrDesc_t execProc
The Component Execution Procedure (CEP) (see CrFwBaseCmp.h).
FwPrDesc_t CrFwCmpGetResetPr(FwSmDesc_t smDesc)
Return the descriptor of the Reset Procedure of the argument component.
FwSmDesc_t CrFwBaseCmpMake()
Retrieve the singleton instance of the Base State Machine.
void CrFwCmpReset(FwSmDesc_t smDesc)
Reset a framework component.
static void RunCRP(FwSmDesc_t smDesc)
Function which runs the Component Reset Procedure.
#define CR_FW_BASE_TR_INIT
Identifier for transition command "Init" in the Base State Machine.
void CrFwCmpExecute(FwSmDesc_t smDesc)
Execute a framework component.
Definition of Base Component.
CrFwBool_t CrFwCmpIsStarted(FwSmDesc_t smDesc)
Return true if the state machine of the argument component has been started.
unsigned short int CrFwTypeId_t
Type used for the identifier of a component type.
Component Initialization Procedure (CIP) for the Base Component.
CrFwTypeId_t typeId
The type identifier of the framework component.
#define CR_FW_BASE_STATE_CONFIGURED
State identifier for state CONFIGURED in the Base State Machine.
#define CR_FW_BASE_STATE_INITIALIZED
State identifier for state INITIALIZED in the Base State Machine.
void CrFwCmpShutdown(FwSmDesc_t smDesc)
Shutdown a framework component.
static void RunCIP(FwSmDesc_t smDesc)
Function which runs the Component Initialization Procedure.
FwSmBool_t CrFwIsSmOutcomeOne(FwSmDesc_t smDesc)
Convenience function to check whether the outcome of the last check or action is equal to 1 ("true")...
Component Reset Procedure (CRP) for the Base Component.
FwPrDesc_t initProc
The Component Initialization Procedure (CIP) (see CrFwInitProc.h).