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;
CrFwTimeStamp_t CrFwPcktGetTimeStamp(CrFwPckt_t pckt)
Return the time stamp of the command or report encapsulated in a packet.
CrFwOutCmpSerialize_t serialize
Function which implements the Serialization Operation for the out-going command or report...
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.
CrFwBool_t CrFwOutCmpIsProgressAck(FwSmDesc_t smDesc)
Return the acknowledge level for command progress for the command encapsulated in the OutComponent...
Type for the Framework Component Data (FCD).
void PendingEntryAction(FwSmDesc_t smDesc)
Entry action of the SENDING state (including behaviour of Send Packet Procedure). ...
Interface through which framework components access the current time.
#define CR_FW_OUTCMP_STATE_PENDING
State identifier for state PENDING in the OutComponent State Machine.
void CrFwOutStreamSend(FwSmDesc_t smDesc, CrFwPckt_t pckt)
Send a packet to the OutStream.
CrFwOutcome_t outcome
The outcome of an action or check executed by a state machine or by one of its procedures.
void CrFwPcktSetGroup(CrFwPckt_t pckt, CrFwGroup_t group)
Set the group of the command/report encapsulated in a packet.
Definition of the Framework Component Data (FCD) Type.
CrFwDestSrc_t CrFwOutCmpGetDest(FwSmDesc_t smDesc)
Return the destination of the OutComponent.
An OutComponent has an invalid destination (see CrFwOutCmp.h)
CrFwPcktLength_t CrFwOutCmpGetParLength(FwSmDesc_t smDesc)
Return the length in bytes of the parameter area of the OutComponent.
FwSmDesc_t CrFwOutCmpMakeBase()
Return the base OutComponent from which all other OutComponents are derived.
void CrFwOutCmpTerminate(FwSmDesc_t smDesc)
Send command Terminate to the argument OutComponent.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
CrFwPckt_t CrFwPcktGetParStart(CrFwPckt_t pckt)
Return the start address of the packet's parameter area.
CrFwPcktLength_t CrFwOutCmpGetLength(FwSmDesc_t smDesc)
Return the length in bytes of the packet to which the OutComponent is serialized. ...
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 CrFwOutCmpIsStartAck(FwSmDesc_t smDesc)
Return the acknowledge level for command start for the command encapsulated in the OutComponent...
CrFwBool_t CrFwOutCmpIsInTerminated(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state TERMINATED.
#define CR_FW_OUTCMP_TR_TERMINATE
Identifier for transition command "Terminate" in the OutComponent State Machine.
Definition of the OutStream component.
Definition of the OutFactory component.
Type for the data describing an OutComponent.
void CrFwOutCmpSetTimeStamp(FwSmDesc_t smDesc, CrFwTimeStamp_t timeStamp)
Set the time stamp attribute of the OutComponent.
CrFwPckt_t CrFwOutCmpGetParStart(FwSmDesc_t smDesc)
Return the start address of the parameter area of the OutComponent.
CrFwDestSrc_t CrFwPcktGetDest(CrFwPckt_t pckt)
Return the destination of the command or report encapsulated in a packet.
CrFwPckt_t pckt
Packet to which the out-going command or report is serialized.
Interface for creating and accessing a report or command packet.
CrFwOutCmpEnableCheck_t isEnabled
Function which implements the Enable Check for the out-going command or report.
void CrFwOutCmpSetGroup(FwSmDesc_t smDesc, CrFwGroup_t group)
Set the group of the OutComponent.
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.
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...
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
CrFwServType_t CrFwOutCmpGetServType(FwSmDesc_t smDesc)
Return the type of the OutComponent.
Dummy Component Execution Procedure (CEP) for the Base Component.
void CrFwPcktSetDest(CrFwPckt_t pckt, CrFwDestSrc_t dest)
Set the destination of the command or report encapsulated in a packet.
void CrFwPcktSetCmdRepId(CrFwPckt_t pckt, CrFwInstanceId_t id)
Set the command or report identifier in the command or report encapsulated in a packet.
unsigned char CrFwGroup_t
Type used for the destination or source group of a packet.
unsigned char CrFwOutcome_t
Type used for the outcome of a check (see CrFwCmpData).
Header file to define all invariant publicly available constants and types for the CORDET Framework...
unsigned short CrFwDiscriminant_t
Type used for the discriminant of a command or report.
CrFwBool_t CrFwOutCmpIsTermAck(FwSmDesc_t smDesc)
Return the acknowledge level for command termination for the command encapsulated in the OutComponent...
unsigned char CrFwDestSrc_t
Type used for the command or report destination and source.
CrFwInstanceId_t instanceId
The instance identifier of the framework component.
FwSmBool_t CrFwIsSmOutcomeZero(FwSmDesc_t smDesc)
Convenience function to check whether the outcome of the last check or action is equal to 0 ("false")...
CrFwPckt_t CrFwOutCmpGetPckt(FwSmDesc_t smDesc)
Return the pointer to the packet which holds the OutComponent.
CrFwBool_t CrFwOutCmpIsInAborted(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state ABORTED.
Interface for reporting an error detected by a framework component.
CrFwOutCmpRepeatCheck_t isRepeat
Function which implements the Repeat Check for the out-going command or report.
CrFwBool_t CrFwOutCmpIsAcceptAck(FwSmDesc_t smDesc)
Return the acknowledge level for command acceptance for the command encapsulated in the OutComponent...
#define CR_FW_OUTCMP_STATE_ABORTED
State identifier for state ABORTED in the OutComponent State Machine.
CrFwDestSrc_t CrFwOutCmpGetSrc(FwSmDesc_t smDesc)
Return the source of the OutComponent.
#define CR_FW_OUTCMP_STATE_TERMINATED
State identifier for state TERMINATED the OutComponent State Machine.
CrFwTimeStamp_t CrFwOutCmpGetTimeStamp(FwSmDesc_t smDesc)
Return the time stamp attribute of the OutComponent.
#define CR_FW_OUTCMP_STATE_LOADED
State identifier for state LOADED in the OutComponent State Machine.
CrFwServType_t CrFwOutCmpGetServSubType(FwSmDesc_t smDesc)
Return the sub-type of the OutComponent.
CrFwBool_t CrFwOutRegistryIsEnabled(FwSmDesc_t outCmp)
Query the enable status of an out-going command or report.
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.
CrFwTimeStamp_t CrFwGetCurrentTimeStamp()
Return the current time in the format used for the command and report time-stamp. ...
void PendingDoAction(FwSmDesc_t smDesc)
Do action of the PENDING state (including behaviour of Send Packet Procedure).
Definition of the utility functions for the CORDET Framework.
FwSmDesc_t CrFwOutStreamGet(CrFwDestSrc_t dest)
Getter function for the OutStream corresponding to the argument destination.
CrFwBool_t CrFwOutCmpIsInLoaded(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state LOADED.
FwSmDesc_t CrFwBaseCmpMake()
Retrieve the singleton instance of the Base State Machine.
void CrFwOutCmpDefSerialize(FwSmDesc_t smDesc)
Default implementation of the Serialize Operation for an OutComponent.
CrFwServSubType_t CrFwPcktGetServSubType(CrFwPckt_t pckt)
Return the service sub-type of the command or report encapsulated in a packet.
CrFwDiscriminant_t CrFwOutCmpGetDiscriminant(FwSmDesc_t smDesc)
Return the discriminant of the OutComponent.
static FwSmDesc_t baseOutCmpSmDesc
Base OutComponent from which all other OutComponents are derived.
CrFwBool_t CrFwPcktIsProgressAck(CrFwPckt_t pckt)
Return the acknowledge level for command progress for the command encapsulated in the packet...
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 Base Component.
unsigned int CrFwTimeStamp_t
Type used for the time stamp of a command or report.
CrFwOutCmpReadyCheck_t isReady
Function which implements the Ready Check for the out-going command or report.
static CrFwDestSrc_t dest
Destination.
CrFwGroup_t CrFwOutCmpGetGroup(FwSmDesc_t smDesc)
Return the group of the OutComponent.
CrFwBool_t CrFwPcktIsStartAck(CrFwPckt_t pckt)
Return the acknowledge level for command start for the command encapsulated in the packet...
CrFwPcktLength_t CrFwPcktGetLength(CrFwPckt_t pckt)
Return the length (in number of bytes) of a packet.
void LoadedToCpsTransAction(FwSmDesc_t smDesc)
Transition action on the transition out of the LOADED state.
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.
unsigned short int CrFwPcktLength_t
Type for the packet length.
Definition of the OutComponent Component of the framework.
void CrFwOutCmpSetDiscriminant(FwSmDesc_t smDesc, CrFwDiscriminant_t discriminant)
Set the discriminant of the OutComponent.
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...
void CrFwOutCmpSetDest(FwSmDesc_t smDesc, CrFwDestSrc_t dest)
Set the destination of the OutComponent.
CrFwTypeId_t typeId
The type identifier of the framework component.
void CrFwPcktSetTimeStamp(CrFwPckt_t pckt, CrFwTimeStamp_t timeStamp)
Set the time stamp of the command or report encapsulated in a packet.
#define CR_FW_BASE_STATE_CONFIGURED
State identifier for state CONFIGURED in the Base State Machine.
CrFwOutCmpUpdate_t update
Function which implements the Update Operation for the out-going command or report.
CrFwBool_t CrFwOutCmpDefEnableCheck(FwSmDesc_t smDesc)
Default implementation of the Enable Check Operation for an OutComponent.
void CrFwPcktSetDiscriminant(CrFwPckt_t pckt, CrFwDiscriminant_t discriminant)
Set the discriminant of the command or report encapsulated in a packet.
unsigned char CrFwServType_t
Type used for the service type of a command or report.
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.
CrFwBool_t CrFwOutCmpIsInPending(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state PENDING.
CrFwBool_t CrFwPcktIsAcceptAck(CrFwPckt_t pckt)
Return the acknowledge level for command acceptance for the command encapsulated in the packet...