39 #include "FwSmConstants.h"
40 #include "FwSmDCreate.h"
41 #include "FwSmConfig.h"
43 #include "FwPrConstants.h"
44 #include "FwPrDCreate.h"
45 #include "FwPrConfig.h"
97 FwPrDesc_t resetPr, execPr, initPr;
159 inCmp = inManagerCSData->
pcrl[i];
177 inManagerCSData->
pcrl[i] = NULL;
210 for (i=0; i<size; i++)
211 if (inManagerCSData->
pcrl[i] == NULL) {
217 inManagerCSData->
pcrl[freePos] = inCmp;
225 for (i=freePos+1; i<size; i++)
226 if (inManagerCSData->
pcrl[i] == NULL) {
242 inManagerCSData->
pcrl[i] = NULL;
244 inManagerDataLocal->
outcome = 1;
256 if (inManagerCSData->
pcrl[i] != NULL) {
262 inManagerCSData->
pcrl[i] = NULL;
268 inManagerDataLocal->
outcome = 1;
280 if (inManagerCSData->
pcrl[i] != NULL) {
286 inManagerCSData->
pcrl[i] = NULL;
289 free(inManagerCSData->
pcrl);
void CrFwBaseCmpDefShutdownAction(FwSmDesc_t smDesc)
Function which performs the Shutdown Action for the Base State Machine.
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_INREPORT_TYPE
Type identifier for the InReport component.
#define CR_FW_INMANAGER_TYPE
Type identifier for the InManager component.
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
FwPrDesc_t CrFwBaseCmpGetDummyExecProc()
Retrieve the singleton instance of the Dummy CEP.
void CwFwBaseCmpDummyExecAction(FwPrDesc_t prDesc)
Dummy action executed in the single node of the Dummy Execution Procedure.
Dummy Component Execution Procedure (CEP) for the Base Component.
void CrFwInCmdTerminate(FwSmDesc_t smDesc)
Send command Terminate to the argument InCommand.
CrFwBool_t CrFwInCmdIsInAborted(FwSmDesc_t smDesc)
Return true if the argument InCommand is in state ABORTED.
CrFwBool_t CrFwInCmdIsInTerminated(FwSmDesc_t smDesc)
Return true if the argument InCommand is in state TERMINATED.
Definition of the InCommand Component of the framework.
void CrFwInFactoryReleaseInCmd(FwSmDesc_t inCmdInstance)
Release function for an InCommand.
void CrFwInFactoryReleaseInRep(FwSmDesc_t inRepInstance)
Release function for an InReport.
Definition of the InFactory component.
static void InManagerInitAction(FwPrDesc_t initPr)
Initialization action for InManagers.
CrFwBool_t CrFwInManagerLoad(FwSmDesc_t smDesc, FwSmDesc_t inCmp)
Load a new InReport or InCommand into the InManager.
static void InManagerShutdownAction(FwSmDesc_t smDesc)
Shutdown action for InManager.
static FwSmDesc_t inManagerDesc[CR_FW_NOF_INMANAGER]
The descriptors of the InManager State Machines.
static void InManagerConfigAction(FwPrDesc_t initPr)
Configuration action for InManagers.
static CrFwCounterU2_t inManagerPcrlSize[CR_FW_NOF_INMANAGER]
The sizes of the PCRL in the InManager components.
static void InManagerExecAction(FwPrDesc_t execPr)
Implement the logic of the Execution Procedure (see figure below).
CrFwCounterU2_t CrFwInManagerGetNOfLoadedInCmp(FwSmDesc_t smDesc)
Return the number of InReport or InCommands successfully loaded since the InManager was last reset.
CrFwCounterU1_t CrFwInManagerGetNOfPendingInCmp(FwSmDesc_t smDesc)
Return the number of InReport or InCommands currently in the PCRL of an InManager.
static CrFwCmpData_t inManagerData[CR_FW_NOF_INMANAGER]
The data structures for the InManager State Machines and their Procedures.
FwSmDesc_t CrFwInManagerMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th InManager State Machine instance.
static CrFwInManagerData_t inManagerCmpSpecificData[CR_FW_NOF_INMANAGER]
The component-specific data for the InManager instances.
CrFwCounterU1_t CrFwInManagerGetPCRLSize(FwSmDesc_t smDesc)
Return the size of the PCRL of an InManager.
Definition of the InManager component.
User-modifiable parameters for the InManager components (see CrFwInManager.h).
#define CR_FW_NOF_INMANAGER
The number of InManager components in the application.
#define CR_FW_INMANAGER_PCRLSIZE
The sizes of the Pending Command/Report List (PCRL) of the InManager components.
void CrFwInRegistryUpdateState(FwSmDesc_t inCmp, CrFwInRegistryCmdRepState_t newState)
Ask the InRegistry to update the state of an incoming command or report.
void CrFwInRegistryStartTracking(FwSmDesc_t inCmp)
Ask the InRegistry to start tracking an incoming command or report.
Definition of the InRegistry Component.
CrFwInRegistryCmdRepState_t
Enumerated type for the state of a command or report tracked by the InRegistry.
@ crInRegistryAborted
Incoming command has been aborted.
@ crInRegistryTerminated
Incoming command or report has completed execution.
@ crInRegistryPending
Incoming command or report is pending (waiting to be sent)
FwPrDesc_t CrFwCmpGetInitProc()
Retrieve the singleton instance of the CIP.
void CrFwBaseCmpDefInitAction(FwPrDesc_t prDesc)
Function which performs the default Initialization Action of the CIP.
Component Initialization Procedure (CIP) for the Base Component.
Interface for creating and accessing a report or command packet.
Definition and management of packet queues.
Interface for reporting an error detected by a framework component.
void CrFwRepErr(CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId)
Report an error which has no parameters attached to it.
FwPrDesc_t CrFwCmpGetResetProc()
Retrieve the singleton instance of the CRP.
void CrFwBaseCmpDefConfigAction(FwPrDesc_t prDesc)
Function which performs the default Configuration Action of the CRP.
Component Reset Procedure (CRP) for the Base Component.
Interface through which framework components access the current time.
unsigned short CrFwCounterU2_t
Type used for unsigned integers with a "medium" range.
unsigned char CrFwCounterU1_t
Type used for unsigned integers with a "short" range.
@ crInManagerPcrlFull
The Pending Command/Report List (PCRL) of an InManager is full (see CrFwInManager....
@ crInManagerIllId
A framework function has been called with an illegal InManager identifier.
unsigned short CrFwInstanceId_t
Type used for instance identifiers.
void CrFwSetAppErrCode(CrFwAppErrCode_t errCode)
Set the value of the application error code (see CrFwGetAppErrCode).
Definition of the utility functions for the CORDET Framework.
Type for the Framework Component Data (FCD).
FwPrDesc_t initProc
The Component Initialization Procedure (CIP) (see CrFwInitProc.h).
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.
FwPrDesc_t resetProc
The Component Reset Procedure (CRP) (see CrFwResetProc.h).
FwPrDesc_t execProc
The Component Execution Procedure (CEP) (see CrFwBaseCmp.h).
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 InManager.
CrFwCounterU1_t nextFreePcrlPos
Next free position in the PCRL.
CrFwCounterU2_t nOfLoadedInCmp
Number of successfully loaded InReports and InCommands
CrFwCounterU1_t nOfInCmpInPcrl
Number of InReports and InCommands currently in PCRL.
FwSmDesc_t * pcrl
Pending Command/Report List (PCRL) for the InManager.