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;
Type for the Framework Component Data (FCD).
#define CR_FW_INCMD_STATE_PROGRESS
State identifier for state PROGRESS in the InCommand State Machine.
CrFwOutcome_t outcome
The outcome of an action or check executed by a state machine or by one of its procedures.
static void DoTerminationAction(FwSmDesc_t smDesc)
Transition action on the transition from PROGRESS to CPS2.
FwSmDesc_t CrFwInCmdMakeBase()
Return the base InCommand from which all other InCommands are derived.
Definition of the Framework Component Data (FCD) Type.
void CrFwInCmdConfigCheck(FwPrDesc_t prDesc)
Configuration check for an InCommand.
static void DoProgressAction(FwSmDesc_t smDesc)
Entry and do action in state PROGRESS.
void CrFwInCmdSetProgressStepId(FwSmDesc_t smDesc, CrFwProgressStepId_t stepId)
Set the progress step identifier of the InCommand.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
#define CR_FW_INCMD_TR_TERMINATE
Identifier for transition command "Terminate" in the InCommand State Machine.
CrFwPckt_t CrFwPcktGetParStart(CrFwPckt_t pckt)
Return the start address of the packet's parameter area.
CrFwBool_t CrFwInCmdIsInAborted(FwSmDesc_t smDesc)
Return true if the argument InCommand is in state ABORTED.
CrFwServType_t CrFwPcktGetServType(CrFwPckt_t pckt)
Return the service type of the command or report encapsulated in a packet.
CrFwDestSrc_t CrFwPcktGetSrc(CrFwPckt_t pckt)
Return the source of the command or report encapsulated in a packet.
CrFwBool_t CrFwInCmdIsInProgress(FwSmDesc_t smDesc)
Return true if the argument InCommand is in state PROGRESS.
CrFwSeqCnt_t CrFwPcktGetSeqCnt(CrFwPckt_t pckt)
Return the sequence counter of the command or report encapsulated in a packet.
CrFwPckt_t CrFwInCmdGetPcktFromPrDesc(FwPrDesc_t prDesc)
Convenience function to extract the InCommand's packet from the descriptor of the InCommand's reset p...
Definition of the OutStream component.
Definition of the OutFactory component.
CrFwPckt_t pckt
Packet holding the InCommand.
Interface for creating and accessing a report or command packet.
#define CR_FW_INCMD_STATE_ABORTED
State identifier for state ABORTED in the InCommand State Machine.
CrFwCrc_t CrFwPcktGetCrc(CrFwPckt_t pckt)
Return the CRC of the command or report encapsulated in a packet.
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
Dummy Component Execution Procedure (CEP) for the Base Component.
unsigned char CrFwGroup_t
Type used for the destination or source group of a packet.
CrFwCrc_t CrFwPcktComputeCrc(CrFwPckt_t pckt)
Compute the CRC in the command or report encapsulated in a packet.
static FwSmDesc_t baseInCmdSmDesc
Base OutComponent from which all other InCommands are derived.
Header file to define all invariant publicly available constants and types for the CORDET Framework...
CrFwProgressStepId_t CrFwInCmdGetNOfProgressFailure(FwSmDesc_t smDesc)
Return the number of progress step failures.
unsigned short CrFwDiscriminant_t
Type used for the discriminant of a command or report.
static void DoStartAction(FwSmDesc_t smDesc)
Transition action on the transition from ACCEPTED to CPS1.
unsigned char CrFwDestSrc_t
Type used for the command or report destination and source.
CrFwInstanceId_t instanceId
The instance identifier of the framework component.
static FwSmBool_t IsTerminationSuccess(FwSmDesc_t smDesc)
Guard on the transition from CPS2 to TERMINATED.
CrFwServType_t CrFwInCmdGetServSubType(FwSmDesc_t smDesc)
Return the sub-type 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...
CrFwBool_t CrFwInCmdIsInAccepted(FwSmDesc_t smDesc)
Return true if the argument InCommand is in state ACCEPTED.
Interface for reporting an error detected by a framework component.
CrFwInCmdReadyCheck_t isReady
Function which implements the Ready Check for the InCommand.
static void ReportStartSuccess(FwSmDesc_t smDesc)
Transition action on the transition from CPS1 to PROGRESS.
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.
CrFwExecStepId_t nOfProgressFailure
Number of progress steps which failed.
CrFwBool_t CrFwInCmdDefValidityCheck(FwPrDesc_t prDesc)
Default implementation of the validity check of an InCommand.
CrFwBool_t isProgressActionCompleted
Flag indicating whether the progress action has been completed.
static void DoAbortAction(FwSmDesc_t smDesc)
Entry action in state ABORTED.
#define CR_FW_INCMD_STATE_ACCEPTED
State identifier for state ACCEPTED in the InCommand State Machine.
static FwSmBool_t IsReady(FwSmDesc_t smDesc)
Guard on the transition from ACCEPTED to CPS1.
CrFwPcktLength_t CrFwInCmdGetParLength(FwSmDesc_t smDesc)
Return the length in bytes of the parameter area of the InCommand.
CrFwDiscriminant_t CrFwPcktGetDiscriminant(CrFwPckt_t pckt)
Return the discriminant of the command or report encapsulated in a packet.
void * cmpSpecificData
Derived data which are specific to each type of framework component.
#define CR_FW_INCMD_STATE_TERMINATED
State identifier for state TERMINATED in the InCommand State Machine.
CrFwBool_t CrFwInCmdIsAcceptAck(FwSmDesc_t smDesc)
Return the acknowledge level for command acceptance for the command encapsulated in the InCommand...
CrFwSeqCnt_t CrFwInCmdGetSeqCnt(FwSmDesc_t smDesc)
Return the sequence counter of the InCommand.
Definition of the utility functions for the CORDET Framework.
static CrFwCmpData_t inCmdData[CR_FW_INFACTORY_MAX_NOF_INCMD]
The base data for the pre-allocated InCommand instances.
CrFwBool_t CrFwInCmdIsStartAck(FwSmDesc_t smDesc)
Return the acknowledge level for command start for the command encapsulated in the InCommand...
unsigned short CrFwProgressStepId_t
Type for the Progress Step Identifier of an InCommand.
CrFwBool_t CrFwInCmdIsInTerminated(FwSmDesc_t smDesc)
Return true if the argument InCommand is in state TERMINATED.
FwSmDesc_t CrFwBaseCmpMake()
Retrieve the singleton instance of the Base State Machine.
CrFwProgressStepId_t progressStepId
The progress step identifier.
CrFwBool_t CrFwInCmdIsProgressAck(FwSmDesc_t smDesc)
Return the acknowledge level for command progress for the command encapsulated in the InCommand...
CrFwServSubType_t CrFwPcktGetServSubType(CrFwPckt_t pckt)
Return the service sub-type of the command or report encapsulated in a packet.
Interface for reporting the outcome of the processing of an InCommand.
CrFwInCmdAbortAction_t abortAction
Function which implements the Abort Action for the InCommand.
void CrFwInCmdTerminate(FwSmDesc_t smDesc)
Send command Terminate to the argument InCommand.
CrFwBool_t CrFwPcktIsProgressAck(CrFwPckt_t pckt)
Return the acknowledge level for command progress for the command encapsulated in the packet...
CrFwInCmdValidityCheck_t isValid
Function which implements the Configuration Check for the InCommand.
Definition of Base Component.
CrFwDiscriminant_t CrFwInCmdGetDiscriminant(FwSmDesc_t smDesc)
Return the discriminant of the InCommand.
CrFwBool_t CrFwPcktIsStartAck(CrFwPckt_t pckt)
Return the acknowledge level for command start for the command encapsulated in the packet...
static void ReportStartFailed(FwSmDesc_t smDesc)
Transition action on the transition from CPS1 to ABORTED which reports the failure of the Start Actio...
static void ReportTerminationSuccess(FwSmDesc_t smDesc)
Transition action on the transition from CPS2 to TERMINATED.
Component Initialization Procedure (CIP) for the Base Component.
CrFwGroup_t CrFwPcktGetGroup(CrFwPckt_t pckt)
Return the group of the command/report encapsulated in a packet.
CrFwInCmdStartAction_t startAction
Function which implements the Start Action for the InCommand.
CrFwProgressStepId_t CrFwInCmdGetProgressStepId(FwSmDesc_t smDesc)
Return the progress step identifier of the InCommand.
unsigned short int CrFwPcktLength_t
Type for the packet length.
Definition of the OutComponent Component of the framework.
CrFwPcktLength_t CrFwPcktGetParLength(CrFwPckt_t pckt)
Return the length in bytes of the packet's parameter area.
CrFwBool_t CrFwPcktIsTermAck(CrFwPckt_t pckt)
Return the acknowledge level for command termination for the command encapsulated in the packet...
CrFwPckt_t CrFwInCmdGetPckt(FwSmDesc_t smDesc)
Return the pointer to the packet which holds the InCommand.
#define CR_FW_BASE_STATE_CONFIGURED
State identifier for state CONFIGURED in the Base State Machine.
Type for the data describing an InCommand.
CrFwGroup_t CrFwInCmdGetGroup(FwSmDesc_t smDesc)
Return the group of the InCommand.
CrFwInCmdProgressAction_t progressAction
Function which implements the Progress Action for the InCommand.
CrFwDestSrc_t CrFwInCmdGetSrc(FwSmDesc_t smDesc)
Return the source of the InCommand.
CrFwBool_t CrFwInCmdIsTermAck(FwSmDesc_t smDesc)
Return the acknowledge level for command termination for the command encapsulated in the InCommand...
CrFwInCmdTerminationAction_t terminationAction
Function which implements the Termination Action for the InCommand.
CrFwServType_t CrFwInCmdGetServType(FwSmDesc_t smDesc)
Return the type of the InCommand.
unsigned char CrFwServType_t
Type used for the service type of a command or report.
unsigned int CrFwSeqCnt_t
Type used for the sequence counter of commands or reports.
FwSmBool_t CrFwIsSmOutcomeOne(FwSmDesc_t smDesc)
Convenience function to check whether the outcome of the last check or action is equal to 1 ("true")...
CrFwBool_t CrFwInCmdIsProgressActionCompleted(FwSmDesc_t smDesc)
Return the Completion Outcome of the progress action.
Component Reset Procedure (CRP) for the Base Component.
CrFwPckt_t CrFwInCmdGetParStart(FwSmDesc_t smDesc)
Return the start address of the parameter area of the InCommand.
CrFwBool_t CrFwPcktIsAcceptAck(CrFwPckt_t pckt)
Return the acknowledge level for command acceptance for the command encapsulated in the packet...
void CrFwInCmdSetProgressActionCompleted(FwSmDesc_t smDesc, CrFwBool_t progressActionCompleted)
Set the Completion Outcome of the progress action.