36 #include "FwPrConfig.h"
37 #include "FwPrDCreate.h"
38 #include "FwSmConfig.h"
39 #include "FwSmDCreate.h"
100 static FwSmBool_t
IsReady(FwSmDesc_t smDesc);
111 FwSmCounterS1_t nOfStates = 4;
112 FwSmCounterS1_t nOfChoicePseudoStates = 2;
113 FwSmCounterS1_t nOfTrans = 7;
114 FwSmCounterS1_t nOfActions = 9;
115 FwSmCounterS1_t nOfGuards = 4;
116 FwSmCounterS1_t CPS_1 = 1;
117 FwSmCounterS1_t CPS_2 = 2;
128 esm = FwSmCreate(nOfStates, nOfChoicePseudoStates, nOfTrans, nOfActions, nOfGuards);
133 FwSmAddChoicePseudoState(esm, CPS_1, 2);
134 FwSmAddChoicePseudoState(esm, CPS_2, 2);
179 if (cmpSpecificData->
isValid(prDesc) == 1)
203 return cmpSpecificData->
pckt;
218 return cmpSpecificData->
isReady(smDesc);
411 return cmpSpecificData->
pckt;
FwSmDesc_t CrFwBaseCmpMake()
Retrieve the singleton instance of the Base State Machine.
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 CR_FW_INCMD_STATE_ABORTED
State identifier for state ABORTED in the InCommand State Machine.
#define CR_FW_INCMD_TR_TERMINATE
Identifier for transition command "Terminate" in the InCommand State Machine.
#define CR_FW_INCMD_STATE_ACCEPTED
State identifier for state ACCEPTED in the InCommand State Machine.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
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.
#define CR_FW_INCMD_STATE_PROGRESS
State identifier for state PROGRESS in the InCommand State Machine.
#define CR_FW_INCMD_STATE_TERMINATED
State identifier for state TERMINATED in the InCommand State Machine.
Dummy Component Execution Procedure (CEP) for the Base Component.
CrFwBool_t CrFwInCmdIsStartAck(FwSmDesc_t smDesc)
Return the acknowledge level for command start for the command encapsulated in the InCommand.
CrFwPckt_t CrFwInCmdGetPcktFromPrDesc(FwPrDesc_t prDesc)
Convenience function to extract the InCommand's packet from the descriptor of the InCommand's reset p...
CrFwBool_t CrFwInCmdDefValidityCheck(FwPrDesc_t prDesc)
Default implementation of the validity check of an InCommand.
CrFwBool_t CrFwInCmdIsInAccepted(FwSmDesc_t smDesc)
Return true if the argument InCommand is in state ACCEPTED.
CrFwBool_t CrFwInCmdIsProgressAck(FwSmDesc_t smDesc)
Return the acknowledge level for command progress for the command encapsulated in the InCommand.
CrFwDiscriminant_t CrFwInCmdGetDiscriminant(FwSmDesc_t smDesc)
Return the discriminant of the InCommand.
static void ReportTerminationFailed(FwSmDesc_t smDesc)
Transition action on the transition from CPS2 to ABORTED which reports the failure of the Termination...
CrFwPckt_t CrFwInCmdGetParStart(FwSmDesc_t smDesc)
Return the start address of the parameter area of the InCommand.
static void DoStartAction(FwSmDesc_t smDesc)
Transition action on the transition from ACCEPTED to CPS1.
static FwSmDesc_t baseInCmdSmDesc
Base OutComponent from which all other InCommands are derived.
CrFwProgressStepId_t CrFwInCmdGetNOfProgressFailure(FwSmDesc_t smDesc)
Return the number of progress step failures.
static void ReportStartFailed(FwSmDesc_t smDesc)
Transition action on the transition from CPS1 to ABORTED which reports the failure of the Start Actio...
void CrFwInCmdTerminate(FwSmDesc_t smDesc)
Send command Terminate to the argument InCommand.
CrFwBool_t CrFwInCmdIsInProgress(FwSmDesc_t smDesc)
Return true if the argument InCommand is in state PROGRESS.
CrFwServType_t CrFwInCmdGetServType(FwSmDesc_t smDesc)
Return the type of the InCommand.
void CrFwInCmdConfigCheck(FwPrDesc_t prDesc)
Configuration check for an InCommand.
CrFwDestSrc_t CrFwInCmdGetSrc(FwSmDesc_t smDesc)
Return the source of the InCommand.
FwSmDesc_t CrFwInCmdMakeBase()
Return the base InCommand from which all other InCommands are derived.
static void DoProgressAction(FwSmDesc_t smDesc)
Entry and do action in state PROGRESS.
CrFwGroup_t CrFwInCmdGetGroup(FwSmDesc_t smDesc)
Return the group of the InCommand.
static void ReportTerminationSuccess(FwSmDesc_t smDesc)
Transition action on the transition from CPS2 to TERMINATED.
CrFwBool_t CrFwInCmdIsInAborted(FwSmDesc_t smDesc)
Return true if the argument InCommand is in state ABORTED.
static void DoTerminationAction(FwSmDesc_t smDesc)
Transition action on the transition from PROGRESS to CPS2.
CrFwBool_t CrFwInCmdIsProgressActionCompleted(FwSmDesc_t smDesc)
Return the Completion Outcome of the progress action.
CrFwBool_t CrFwInCmdIsTermAck(FwSmDesc_t smDesc)
Return the acknowledge level for command termination for the command encapsulated in the InCommand.
void CrFwInCmdSetProgressActionCompleted(FwSmDesc_t smDesc, CrFwBool_t progressActionCompleted)
Set the Completion Outcome of the progress action.
CrFwPcktLength_t CrFwInCmdGetParLength(FwSmDesc_t smDesc)
Return the length in bytes of the parameter area of the InCommand.
static FwSmBool_t IsReady(FwSmDesc_t smDesc)
Guard on the transition from ACCEPTED to CPS1.
CrFwSeqCnt_t CrFwInCmdGetSeqCnt(FwSmDesc_t smDesc)
Return the sequence counter of the InCommand.
static FwSmBool_t IsTerminationSuccess(FwSmDesc_t smDesc)
Guard on the transition from CPS2 to TERMINATED.
CrFwPckt_t CrFwInCmdGetPckt(FwSmDesc_t smDesc)
Return the pointer to the packet which holds the InCommand.
void CrFwInCmdSetProgressStepId(FwSmDesc_t smDesc, CrFwProgressStepId_t stepId)
Set the progress step identifier of the InCommand.
CrFwProgressStepId_t CrFwInCmdGetProgressStepId(FwSmDesc_t smDesc)
Return the progress step identifier of the InCommand.
static void DoAbortAction(FwSmDesc_t smDesc)
Entry action in state ABORTED.
CrFwBool_t CrFwInCmdIsAcceptAck(FwSmDesc_t smDesc)
Return the acknowledge level for command acceptance for the command encapsulated in the InCommand.
static void ReportStartSuccess(FwSmDesc_t smDesc)
Transition action on the transition from CPS1 to PROGRESS.
CrFwBool_t CrFwInCmdIsInTerminated(FwSmDesc_t smDesc)
Return true if the argument InCommand is in state TERMINATED.
CrFwServType_t CrFwInCmdGetServSubType(FwSmDesc_t smDesc)
Return the sub-type of the InCommand.
static CrFwCmpData_t inCmdData[CR_FW_INFACTORY_MAX_NOF_INCMD]
The base data for the pre-allocated InCommand instances.
Component Initialization Procedure (CIP) for the Base Component.
Definition of the OutComponent Component of the framework.
Definition of the OutFactory component.
Definition of the OutStream component.
Interface for creating and accessing a report or command packet.
CrFwPckt_t CrFwPcktGetParStart(CrFwPckt_t pckt)
Return the start address of the packet's parameter area.
CrFwSeqCnt_t CrFwPcktGetSeqCnt(CrFwPckt_t pckt)
Return the sequence counter of the command or report encapsulated in a packet.
CrFwBool_t CrFwPcktIsProgressAck(CrFwPckt_t pckt)
Return the acknowledge level for command progress for the command encapsulated in the packet.
CrFwBool_t CrFwPcktIsTermAck(CrFwPckt_t pckt)
Return the acknowledge level for command termination for the command encapsulated in the packet.
CrFwCrc_t CrFwPcktComputeCrc(CrFwPckt_t pckt)
Compute the CRC in the command or report encapsulated in a packet.
CrFwPcktLength_t CrFwPcktGetParLength(CrFwPckt_t pckt)
Return the length in bytes of the packet's parameter area.
CrFwDestSrc_t CrFwPcktGetSrc(CrFwPckt_t pckt)
Return the source of the command or report encapsulated in a packet.
CrFwServSubType_t CrFwPcktGetServSubType(CrFwPckt_t pckt)
Return the service sub-type of the command or report encapsulated in a packet.
CrFwBool_t CrFwPcktIsAcceptAck(CrFwPckt_t pckt)
Return the acknowledge level for command acceptance for the command encapsulated in the packet.
CrFwGroup_t CrFwPcktGetGroup(CrFwPckt_t pckt)
Return the group of the command/report encapsulated in a packet.
CrFwBool_t CrFwPcktIsStartAck(CrFwPckt_t pckt)
Return the acknowledge level for command start for the command encapsulated in the packet.
CrFwCrc_t CrFwPcktGetCrc(CrFwPckt_t pckt)
Return the CRC of the command or report encapsulated in a packet.
CrFwDiscriminant_t CrFwPcktGetDiscriminant(CrFwPckt_t pckt)
Return the discriminant of the command or report encapsulated in a packet.
CrFwServType_t CrFwPcktGetServType(CrFwPckt_t pckt)
Return the service type of the command or report encapsulated in a packet.
Interface for reporting an error detected by a framework component.
Interface for reporting the outcome of the processing of an InCommand.
void CrFwRepInCmdOutcome(CrFwRepInCmdOutcome_t outcome, CrFwInstanceId_t instanceId, CrFwServType_t servType, CrFwServSubType_t servSubType, CrFwDiscriminant_t disc, CrFwOutcome_t failCode, FwSmDesc_t inCmd)
Report the outcome of the processing of an InCommand.
@ crCmdAckTrmSucc
Termination success.
@ crCmdAckPrgSucc
Progress success.
@ crCmdAckTrmFail
Termination failure.
@ crCmdAckPrgFail
Progress failure.
@ crCmdAckStrSucc
Start success.
@ crCmdAckStrFail
Start failure.
Component Reset Procedure (CRP) for the Base Component.
unsigned short CrFwProgressStepId_t
Type for the Progress Step Identifier of an InCommand.
unsigned int CrFwSeqCnt_t
Type used for the sequence counter of commands or reports.
unsigned char CrFwServType_t
Type used for the service type of a command or report.
unsigned char CrFwDestSrc_t
Type used for the command or report destination and source.
unsigned short CrFwDiscriminant_t
Type used for the discriminant of a command or report.
unsigned short int CrFwPcktLength_t
Type for the packet length.
unsigned char CrFwGroup_t
Type used for the destination or source group of a packet.
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).
CrFwInstanceId_t instanceId
The instance identifier of the framework component.
CrFwOutcome_t outcome
The outcome of an action or check executed by a state machine or by one of its procedures.
void * cmpSpecificData
Derived data which are specific to each type of framework component.
Type for the data describing an InCommand.
CrFwInCmdValidityCheck_t isValid
Function which implements the Configuration Check for the InCommand.
CrFwProgressStepId_t progressStepId
The progress step identifier.
CrFwPckt_t pckt
Packet holding the InCommand.
CrFwExecStepId_t nOfProgressFailure
Number of progress steps which failed.
CrFwInCmdTerminationAction_t terminationAction
Function which implements the Termination Action for the InCommand.
CrFwInCmdAbortAction_t abortAction
Function which implements the Abort Action for the InCommand.
CrFwInCmdProgressAction_t progressAction
Function which implements the Progress Action for the InCommand.
CrFwInCmdReadyCheck_t isReady
Function which implements the Ready Check for the InCommand.
CrFwBool_t isProgressActionCompleted
Flag indicating whether the progress action has been completed.
CrFwInCmdStartAction_t startAction
Function which implements the Start Action for the InCommand.