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;
137 FwPrSetData(inManagerData[i].initProc, &inManagerData[i]);
138 FwPrSetData(inManagerData[i].resetProc, &inManagerData[i]);
139 FwPrSetData(inManagerData[i].execProc, &inManagerData[i]);
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);
unsigned char CrFwCounterU1_t
Type used for unsigned integers with a "short" range.
static void InManagerShutdownAction(FwSmDesc_t smDesc)
Shutdown action for InManager.
Type for the Framework Component Data (FCD).
#define CR_FW_INMANAGER_PCRLSIZE
The sizes of the Pending Command/Report List (PCRL) of the InManager components.
Interface through which framework components access the current time.
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.
FwPrDesc_t CrFwCmpGetResetProc()
Retrieve the singleton instance of the CRP.
Definition of the Framework Component Data (FCD) Type.
static void InManagerInitAction(FwPrDesc_t initPr)
Initialization action for InManagers.
static FwSmDesc_t inManagerDesc[CR_FW_NOF_INMANAGER]
The descriptors of the InManager State Machines.
void CrFwSetAppErrCode(CrFwAppErrCode_t errCode)
Set the value of the application error code (see CrFwGetAppErrCode).
static void InManagerExecAction(FwPrDesc_t execPr)
Implement the logic of the Execution Procedure (see figure below).
#define CR_FW_INREPORT_TYPE
Type identifier for the InReport component.
The Pending Command/Report List (PCRL) of an InManager is full (see CrFwInManager.h)
CrFwBool_t CrFwInCmdIsInAborted(FwSmDesc_t smDesc)
Return true if the argument InCommand is in state ABORTED.
CrFwCounterU1_t CrFwInManagerGetPCRLSize(FwSmDesc_t smDesc)
Return the size of the PCRL of an InManager.
FwSmDesc_t * pcrl
Pending Command/Report List (PCRL) for the InManager.
Interface for creating and accessing a report or command packet.
static CrFwCounterU2_t inManagerPcrlSize[CR_FW_NOF_INMANAGER]
The sizes of the PCRL in the InManager components.
static CrFwInManagerData_t inManagerCmpSpecificData[CR_FW_NOF_INMANAGER]
The component-specific data for the InManager instances.
void CrFwBaseCmpDefShutdownAction(FwSmDesc_t smDesc)
Function which performs the Shutdown Action for the Base State Machine.
static CrFwCmpData_t inManagerData[CR_FW_NOF_INMANAGER]
The data structures for the InManager State Machines and their Procedures.
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).
#define CR_FW_INMANAGER_TYPE
Type identifier for the InManager component.
Dummy Component Execution Procedure (CEP) for the Base Component.
#define CR_FW_NOF_INMANAGER
The number of InManager components in the application.
Type for the data describing an InManager.
Header file to define all invariant publicly available constants and types for the CORDET Framework...
CrFwInRegistryCmdRepState_t
Enumerated type for the state of a command or report tracked by the InRegistry.
Definition of the InRegistry Component.
void CrFwInRegistryStartTracking(FwSmDesc_t inCmp)
Ask the InRegistry to start tracking an incoming command or report.
CrFwCounterU1_t nOfInCmpInPcrl
Number of InReports and InCommands currently in PCRL.
CrFwInstanceId_t instanceId
The instance identifier of the framework component.
void CrFwBaseCmpDefInitAction(FwPrDesc_t prDesc)
Function which performs the default Initialization Action of the CIP.
Incoming command has been aborted.
Interface for reporting an error detected by a framework component.
unsigned short CrFwCounterU2_t
Type used for unsigned integers with a "medium" range.
Definition and management of packet queues.
A framework function has been called with an illegal InManager identifier.
FwSmDesc_t CrFwInManagerMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th InManager State Machine instance.
void * cmpSpecificData
Derived data which are specific to each type of framework component.
void CrFwBaseCmpDefConfigAction(FwPrDesc_t prDesc)
Function which performs the default Configuration Action of the CRP.
Definition of the InFactory component.
Definition of the utility functions for the CORDET Framework.
FwPrDesc_t execProc
The Component Execution Procedure (CEP) (see CrFwBaseCmp.h).
CrFwBool_t CrFwInCmdIsInTerminated(FwSmDesc_t smDesc)
Return true if the argument InCommand is in state TERMINATED.
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.
void CrFwInRegistryUpdateState(FwSmDesc_t inCmp, CrFwInRegistryCmdRepState_t newState)
Ask the InRegistry to update the state of an incoming command or report.
FwPrDesc_t CrFwBaseCmpGetDummyExecProc()
Retrieve the singleton instance of the Dummy CEP.
void CrFwInCmdTerminate(FwSmDesc_t smDesc)
Send command Terminate to the argument InCommand.
void CrFwInFactoryReleaseInRep(FwSmDesc_t inRepInstance)
Release function for an InReport.
Definition of Base Component.
User-modifiable parameters for the InManager components (see CrFwInManager.h).
Definition of the InManager component.
void CrFwInFactoryReleaseInCmd(FwSmDesc_t inCmdInstance)
Release function for an InCommand.
void CrFwRepErr(CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId)
Report an error which has no parameters attached to it.
Component Initialization Procedure (CIP) for the Base Component.
static void InManagerConfigAction(FwPrDesc_t initPr)
Configuration action for InManagers.
CrFwCounterU2_t nOfLoadedInCmp
Number of successfully loaded InReports and InCommands.
CrFwCounterU2_t CrFwInManagerGetNOfLoadedInCmp(FwSmDesc_t smDesc)
Return the number of InReport or InCommands successfully loaded since the InManager was last reset...
CrFwTypeId_t typeId
The type identifier of the framework component.
FwPrDesc_t CrFwCmpGetInitProc()
Retrieve the singleton instance of the CIP.
CrFwCounterU1_t CrFwInManagerGetNOfPendingInCmp(FwSmDesc_t smDesc)
Return the number of InReport or InCommands currently in the PCRL of an InManager.
Incoming command or report is pending (waiting to be sent)
Component Reset Procedure (CRP) for the Base Component.
FwPrDesc_t initProc
The Component Initialization Procedure (CIP) (see CrFwInitProc.h).
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.
Incoming command or report has completed execution.
CrFwCounterU1_t nextFreePcrlPos
Next free position in the PCRL.