43 #include "FwSmConstants.h" 44 #include "FwSmDCreate.h" 45 #include "FwSmConfig.h" 47 #include "FwPrConstants.h" 48 #include "FwPrDCreate.h" 49 #include "FwPrConfig.h" 87 FwPrDesc_t resetPr, execPr, initPr;
116 FwSmSetData(
inLoader, &inLoaderData);
117 FwPrSetData(inLoaderData.
initProc, &inLoaderData);
118 FwPrSetData(inLoaderData.
resetProc, &inLoaderData);
119 FwPrSetData(inLoaderData.
execProc, &inLoaderData);
129 inLoaderCmpSpecificData.
inStream = inStream;
136 FwSmDesc_t outStream;
153 if (reroutingDest == 0) {
196 inCmpData = FwSmGetData(inCmp);
209 inManagerInstanceId =
getInManager(servType, servSubType, disc, cmdRepFlag);
213 if (inManagerLoadOutcome == 0) {
Type for the Framework Component Data (FCD).
Interface through which framework components access the current time.
CrFwInstanceId_t CrFwInLoaderDefGetInManager(CrFwServType_t servType, CrFwServSubType_t servSubType, CrFwDiscriminant_t discriminant, CrFwCmdRepType_t cmdRepFlag)
Default implementation of the function which selects the InManager to which an incoming InReport or I...
void CrFwOutStreamSend(FwSmDesc_t smDesc, CrFwPckt_t pckt)
Send a packet to the OutStream.
unsigned short CrFwInstanceId_t
Type used for instance identifiers.
CrFwOutcome_t outcome
The outcome of an action or check executed by a state machine or by one of its procedures.
Definition of the InLoader component.
An InReport has failed its validity check.
FwPrDesc_t CrFwCmpGetResetProc()
Retrieve the singleton instance of the CRP.
Definition of the Framework Component Data (FCD) Type.
User-modifiable parameters for the InLoader components (see CrFwInLoader.h).
CrFwInstanceId_t(* CrFwInLoaderGetInManager_t)(CrFwServType_t, CrFwServSubType_t, CrFwDiscriminant_t, CrFwCmdRepType_t)
Type for a pointer to the function which selects the InManager where the InCommand or InReport must b...
#define CRFW_UNUSED(x)
A macro that can be used to specify that a function parameter is not used.
#define CR_FW_HOST_APP_ID
The identifier of the host application.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
CrFwServType_t CrFwPcktGetServType(CrFwPckt_t pckt)
Return the service type of the command or report encapsulated in a packet.
Definition of the OutStream component.
CrFwCmdRepType_t
Enumerated type for command and reports.
CrFwDestSrc_t CrFwPcktGetDest(CrFwPckt_t pckt)
Return the destination of the command or report encapsulated in a packet.
Interface for creating and accessing a report or command packet.
Definition of the InStream component.
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
FwPrDesc_t resetProc
The Component Reset Procedure (CRP) (see CrFwResetProc.h).
static CrFwServSubType_t servSubType
Service sub-type.
CrFwDestSrc_t CrFwInLoaderDefNoRerouting(CrFwDestSrc_t pcktDest)
Default implementation of the function which checks the legality of a destination and returns the re-...
Dummy Component Execution Procedure (CEP) for the Base Component.
static void InLoaderExecAction(FwPrDesc_t execPr)
Implement the logic of the InLoader Execution Procedure (see figure below).
Header file to define all invariant publicly available constants and types for the CORDET Framework...
void CrFwPcktRelease(CrFwPckt_t pckt)
Release function for command or report packets.
Definition of the InRegistry Component.
unsigned short CrFwDiscriminant_t
Type used for the discriminant of a command or report.
FwSmDesc_t inStream
InStream from which packets are to be retrieved in the next execution cycle.
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 CrFwInLoaderGetInManager_t getInManager
Pointer to function which selects the InManager.
Type for the data describing an InLoader.
Interface for reporting an error detected by a framework component.
static CrFwDestSrc_t reroutingDest
Return value of function CrFwInLoaderDefGetReroutingDestination.
static CrFwDiscriminant_t disc
Discriminant.
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.
#define CR_FW_INLOADER_DET_REROUTING_DEST
The function which determines the re-routing destination of a packet.
Definition and management of packet queues.
FwSmDesc_t CrFwInLoaderMake()
Factory function to retrieve the state machine implementing the InLoader singleton component...
FwSmDesc_t CrFwInManagerMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th InManager State Machine instance.
CrFwCmdRepType_t CrFwPcktGetCmdRepType(CrFwPckt_t pckt)
Return the type of a packet (either a command packet or a report packet).
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.
void CrFwRepErrPckt(CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, CrFwPckt_t pckt)
Report an error which has one parameter attached to it representing a command or report packet...
Definition of the InFactory component.
CrFwBool_t CrFwInCmdIsAcceptAck(FwSmDesc_t smDesc)
Return the acknowledge level for command acceptance for the command encapsulated in the InCommand...
void CrFwRepInCmdOutcomeCreFail(CrFwRepInCmdOutcome_t outcome, CrFwOutcome_t failCode, CrFwPckt_t pckt)
Report the a "creation failure" outcome for the processing of a packet carrying an InCommand...
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.
static FwSmDesc_t inLoader
The InLoader singleton.
#define CR_FW_INLOADER_SEL_INMANAGER
The function which determines the InManager into which an InReport or InCommand must be loaded...
FwPrDesc_t execProc
The Component Execution Procedure (CEP) (see CrFwBaseCmp.h).
CrFwBool_t CrFwInManagerLoad(FwSmDesc_t smDesc, FwSmDesc_t inCmp)
Load a new InReport or InCommand into the InManager.
FwSmDesc_t CrFwBaseCmpMake()
Retrieve the singleton instance of the Base State Machine.
FwPrDesc_t CrFwBaseCmpGetDummyExecProc()
Retrieve the singleton instance of the Dummy CEP.
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.
An InReport could not be loaded in its InManager.
An InReport could not be created due to insufficient resources or illegal type/sub-type/discriminant...
void CrFwInFactoryReleaseInRep(FwSmDesc_t inRepInstance)
Release function for an InReport.
The InLoader has retrieved a packet with an invalid destination (see CrFwInLoader.h)
Definition of Base Component.
static CrFwServType_t servType
The InCommand type as computed in the Validity Check.
static CrFwCmpData_t inLoaderData
The data structure for the InLoader.
void CrFwInLoaderSetInStream(FwSmDesc_t inStream)
Set the InStream from which the packets will be retrieved the next time the InLoader is executed...
Definition of the InManager component.
void CrFwInFactoryReleaseInCmd(FwSmDesc_t inCmdInstance)
Release function for an InCommand.
CrFwInstanceId_t CrFwPcktGetCmdRepId(CrFwPckt_t pckt)
Return the command or report identifier of the command or report encapsulated in a packet...
Component Initialization Procedure (CIP) for the Base Component.
#define CR_FW_INLOADER_TYPE
Type identifier for the InLoader component.
FwSmDesc_t CrFwInFactoryMakeInRep(CrFwPckt_t pckt)
Make function for a component encapsulating an incoming report (InReport).
CrFwTypeId_t typeId
The type identifier of the framework component.
CrFwDestSrc_t CrFwInLoaderDefGetReroutingDestination(CrFwDestSrc_t pcktDest)
Default implementation of the function which checks the legality of a destination and returns the re-...
#define CR_FW_BASE_STATE_CONFIGURED
State identifier for state CONFIGURED in the Base State Machine.
CrFwPckt_t CrFwInStreamGetPckt(FwSmDesc_t smDesc)
Retrieve a packet from the InStream.
void CrFwRepErrInstanceIdAndDest(CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, CrFwInstanceId_t secondaryInstanceId, CrFwDestSrc_t dest, CrFwPckt_t pckt)
Report an error which has three parameters attached to it representing the instance identifier of a c...
void CrFwRepErrRep(CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, FwSmDesc_t rep)
Report an error which has one parameter attached to it representing an report component.
static CrFwInLoaderData_t inLoaderCmpSpecificData
The component-specific data for the InLoader.
CrFwDestSrc_t(* CrFwInLoaderGetReroutingDest_t)(CrFwDestSrc_t)
Type for a pointer to the function which determines the re-routing destination of a packet...
FwPrDesc_t CrFwCmpGetInitProc()
Retrieve the singleton instance of the CIP.
unsigned char CrFwServType_t
Type used for the service type of a command or report.
FwSmDesc_t CrFwInFactoryMakeInCmd(CrFwPckt_t pckt)
Make function for a component encapsulating an incoming command (InCommand).
Component Reset Procedure (CRP) for the Base Component.
FwPrDesc_t initProc
The Component Initialization Procedure (CIP) (see CrFwInitProc.h).
unsigned char CrFwServSubType_t
Type used for the command or report sub-type.
void CwFwBaseCmpDummyExecAction(FwPrDesc_t prDesc)
Dummy action executed in the single node of the Dummy Execution Procedure.
Definition of the InCommand Component of the framework.
static CrFwInLoaderGetReroutingDest_t getReroutingDest
Pointer to function which checks the legality of the packet destination.
static void InLoaderLoadCmdRep(CrFwPckt_t pckt)
Load the command or report encapsulated in the argument packet into an InManager. ...