36 #include "FwPrConfig.h"
37 #include "FwPrDCreate.h"
38 #include "FwSmConfig.h"
39 #include "FwSmDCreate.h"
106 FwSmCounterS1_t nOfStates = 4;
107 FwSmCounterS1_t nOfChoicePseudoStates = 1;
108 FwSmCounterS1_t nOfTrans = 6;
109 FwSmCounterS1_t nOfActions = 3;
110 FwSmCounterS1_t nOfGuards = 3;
111 FwSmCounterS1_t CPS_1 = 1;
122 esm = FwSmCreate(nOfStates, nOfChoicePseudoStates, nOfTrans, nOfActions, nOfGuards);
127 FwSmAddChoicePseudoState(esm, CPS_1, 2);
178 pckt = cmpSpecificData->
pckt;
316 FwSmDesc_t outStream;
318 isReady = cmpSpecificData->
isReady(smDesc);
320 cmpSpecificData->
update(smDesc);
323 if (outStream == NULL) {
330 isRepeat = cmpSpecificData->
isRepeat(smDesc);
344 FwSmDesc_t outStream;
349 isReady = cmpSpecificData->
isReady(smDesc);
350 isEnabled = cmpSpecificData->
isEnabled(smDesc);
354 cmpSpecificData->
update(smDesc);
357 if (outStream == NULL) {
364 isRepeat = cmpSpecificData->
isRepeat(smDesc);
372 if (isEnabled == 0) {
405 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_OUTCMP_STATE_LOADED
State identifier for state LOADED in the OutComponent State Machine.
#define CR_FW_OUTCMP_STATE_TERMINATED
State identifier for state TERMINATED the OutComponent State Machine.
#define CR_FW_OUTCMP_STATE_PENDING
State identifier for state PENDING in the OutComponent State Machine.
#define CR_FW_OUTCMP_TR_TERMINATE
Identifier for transition command "Terminate" in the OutComponent 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_OUTCMP_STATE_ABORTED
State identifier for state ABORTED in the OutComponent State Machine.
#define CR_FW_BASE_STATE_CONFIGURED
State identifier for state CONFIGURED in the Base State Machine.
Dummy Component Execution Procedure (CEP) for the Base Component.
static CrFwDestSrc_t dest
Destination.
Component Initialization Procedure (CIP) for the Base Component.
void CrFwOutCmpSetDiscriminant(FwSmDesc_t smDesc, CrFwDiscriminant_t discriminant)
Set the discriminant of the OutComponent.
CrFwTimeStamp_t CrFwOutCmpGetTimeStamp(FwSmDesc_t smDesc)
Return the time stamp attribute of the OutComponent.
CrFwDestSrc_t CrFwOutCmpGetSrc(FwSmDesc_t smDesc)
Return the source of the OutComponent.
FwSmDesc_t CrFwOutCmpMakeBase()
Return the base OutComponent from which all other OutComponents are derived.
CrFwBool_t CrFwOutCmpDefEnableCheck(FwSmDesc_t smDesc)
Default implementation of the Enable Check Operation for an OutComponent.
void PendingEntryAction(FwSmDesc_t smDesc)
Entry action of the SENDING state (including behaviour of Send Packet Procedure).
void LoadedToCpsTransAction(FwSmDesc_t smDesc)
Transition action on the transition out of the LOADED state.
CrFwPckt_t CrFwOutCmpGetParStart(FwSmDesc_t smDesc)
Return the start address of the parameter area of the OutComponent.
CrFwDestSrc_t CrFwOutCmpGetDest(FwSmDesc_t smDesc)
Return the destination of the OutComponent.
CrFwBool_t CrFwOutCmpIsStartAck(FwSmDesc_t smDesc)
Return the acknowledge level for command start for the command encapsulated in the OutComponent.
CrFwBool_t CrFwOutCmpIsInPending(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state PENDING.
void CrFwOutCmpSetDest(FwSmDesc_t smDesc, CrFwDestSrc_t dest)
Set the destination of the OutComponent.
CrFwBool_t CrFwOutCmpIsTermAck(FwSmDesc_t smDesc)
Return the acknowledge level for command termination for the command encapsulated in the OutComponent...
CrFwBool_t CrFwOutCmpIsInLoaded(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state LOADED.
void CrFwOutCmpSetGroup(FwSmDesc_t smDesc, CrFwGroup_t group)
Set the group of the OutComponent.
CrFwServType_t CrFwOutCmpGetServType(FwSmDesc_t smDesc)
Return the type of the OutComponent.
CrFwBool_t CrFwOutCmpIsAcceptAck(FwSmDesc_t smDesc)
Return the acknowledge level for command acceptance for the command encapsulated in the OutComponent.
CrFwGroup_t CrFwOutCmpGetGroup(FwSmDesc_t smDesc)
Return the group of the OutComponent.
CrFwDiscriminant_t CrFwOutCmpGetDiscriminant(FwSmDesc_t smDesc)
Return the discriminant of the OutComponent.
CrFwPckt_t CrFwOutCmpGetPckt(FwSmDesc_t smDesc)
Return the pointer to the packet which holds the OutComponent.
void CrFwOutCmpDefSerialize(FwSmDesc_t smDesc)
Default implementation of the Serialize Operation for an OutComponent.
CrFwPcktLength_t CrFwOutCmpGetLength(FwSmDesc_t smDesc)
Return the length in bytes of the packet to which the OutComponent is serialized.
static FwSmDesc_t baseOutCmpSmDesc
Base OutComponent from which all other OutComponents are derived.
void CrFwOutCmpSetAckLevel(FwSmDesc_t smDesc, CrFwBool_t accept, CrFwBool_t start, CrFwBool_t progress, CrFwBool_t term)
Set the acknowledge level for the command encapsulated in the OutComponent.
CrFwBool_t CrFwOutCmpIsInAborted(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state ABORTED.
CrFwServType_t CrFwOutCmpGetServSubType(FwSmDesc_t smDesc)
Return the sub-type of the OutComponent.
void CrFwOutCmpSetTimeStamp(FwSmDesc_t smDesc, CrFwTimeStamp_t timeStamp)
Set the time stamp attribute of the OutComponent.
void PendingDoAction(FwSmDesc_t smDesc)
Do action of the PENDING state (including behaviour of Send Packet Procedure).
CrFwBool_t CrFwOutCmpIsInTerminated(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state TERMINATED.
void CrFwOutCmpTerminate(FwSmDesc_t smDesc)
Send command Terminate to the argument OutComponent.
CrFwPcktLength_t CrFwOutCmpGetParLength(FwSmDesc_t smDesc)
Return the length in bytes of the parameter area of the OutComponent.
CrFwBool_t CrFwOutCmpIsProgressAck(FwSmDesc_t smDesc)
Return the acknowledge level for command progress for the command encapsulated in the OutComponent.
Definition of the OutComponent Component of the framework.
Definition of the OutFactory component.
CrFwBool_t CrFwOutRegistryIsEnabled(FwSmDesc_t outCmp)
Query the enable status of an out-going command or report.
FwSmDesc_t CrFwOutStreamGet(CrFwDestSrc_t dest)
Getter function for the OutStream corresponding to the argument destination.
void CrFwOutStreamSend(FwSmDesc_t smDesc, CrFwPckt_t pckt)
Send a packet to the OutStream.
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.
void CrFwPcktSetCmdRepId(CrFwPckt_t pckt, CrFwInstanceId_t id)
Set the command or report identifier in 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.
void CrFwPcktSetDiscriminant(CrFwPckt_t pckt, CrFwDiscriminant_t discriminant)
Set the discriminant of the command or report encapsulated in a packet.
void CrFwPcktSetTimeStamp(CrFwPckt_t pckt, CrFwTimeStamp_t timeStamp)
Set the time stamp of 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.
CrFwDestSrc_t CrFwPcktGetDest(CrFwPckt_t pckt)
Return the destination 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.
CrFwTimeStamp_t CrFwPcktGetTimeStamp(CrFwPckt_t pckt)
Return the time stamp of the command or report encapsulated in a packet.
void CrFwPcktSetAckLevel(CrFwPckt_t pckt, CrFwBool_t accept, CrFwBool_t start, CrFwBool_t progress, CrFwBool_t term)
Set the acknowledge level for the command encapsulated in a packet.
CrFwGroup_t CrFwPcktGetGroup(CrFwPckt_t pckt)
Return the group of the command/report encapsulated in a packet.
CrFwPcktLength_t CrFwPcktGetLength(CrFwPckt_t pckt)
Return the length (in number of bytes) of a packet.
CrFwBool_t CrFwPcktIsStartAck(CrFwPckt_t pckt)
Return the acknowledge level for command start for the command encapsulated in the packet.
void CrFwPcktSetDest(CrFwPckt_t pckt, CrFwDestSrc_t dest)
Set the destination of the command or report encapsulated in a packet.
void CrFwPcktSetGroup(CrFwPckt_t pckt, CrFwGroup_t group)
Set the group of the command/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.
void CrFwRepErrDestSrc(CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, CrFwDestSrc_t destSrc)
Report an error which has one single parameter attached to it representing a command or report destin...
Component Reset Procedure (CRP) for the Base Component.
Interface through which framework components access the current time.
CrFwTimeStamp_t CrFwGetCurrentTimeStamp()
Return the current time in the format used for the command and report time-stamp.
unsigned char CrFwOutcome_t
Type used for the outcome of a check (see CrFwCmpData).
unsigned int CrFwTimeStamp_t
Type used for the time stamp of a command or report.
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.
@ crOutCmpSendPcktInvDest
An OutComponent has an invalid destination (see CrFwOutCmp.h)
FwSmBool_t CrFwIsSmOutcomeZero(FwSmDesc_t smDesc)
Convenience function to check whether the outcome of the last check or action is equal to 0 ("false")...
FwSmBool_t CrFwIsSmOutcomeOne(FwSmDesc_t smDesc)
Convenience function to check whether the outcome of the last check or action is equal to 1 ("true").
FwSmBool_t CrFwIsSmOutcomeTwo(FwSmDesc_t smDesc)
Convenience function to check whether the outcome of the last check or action is equal to 2.
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.
CrFwTypeId_t typeId
The type identifier of the framework component.
Type for the data describing an OutComponent.
CrFwPckt_t pckt
Packet to which the out-going command or report is serialized.
CrFwOutCmpSerialize_t serialize
Function which implements the Serialization Operation for the out-going command or report.
CrFwOutCmpRepeatCheck_t isRepeat
Function which implements the Repeat Check for the out-going command or report.
CrFwOutCmpUpdate_t update
Function which implements the Update Operation for the out-going command or report.
CrFwOutCmpReadyCheck_t isReady
Function which implements the Ready Check for the out-going command or report.
CrFwOutCmpEnableCheck_t isEnabled
Function which implements the Enable Check for the out-going command or report.