38 #include "FwPrConfig.h"
39 #include "FwPrDCreate.h"
40 #include "FwSmConfig.h"
42 #include "FwSmDCreate.h"
152 FwPrDesc_t resetPr, execPr, initPr;
246 return (
inCmd[freePos]);
252 return (
inCmd[freePos]);
299 return (
inRep[freePos]);
305 return (
inRep[freePos]);
374 FwPrDesc_t inCmdInitPr, inCmdResetPr, inCmdExecPr;
375 FwPrDesc_t inRepInitPr, inRepResetPr, inRepExecPr;
502 FwSmReleaseDer(
inCmd[i]);
519 FwSmReleaseDer(
inRep[i]);
void CrFwCmpInit(FwSmDesc_t smDesc)
Initialize a framework component.
void CrFwBaseCmpDefShutdownAction(FwSmDesc_t smDesc)
Function which performs the Shutdown Action for the Base State Machine.
void CrFwCmpReset(FwSmDesc_t smDesc)
Reset a framework component.
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 CRFW_UNUSED(x)
A macro that can be used to specify that a function parameter is not used.
#define CR_FW_INREPORT_TYPE
Type identifier for the InReport component.
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_INFACTORY_TYPE
Type identifier for the InFactory component.
#define CR_FW_BASE_STATE_CONFIGURED
State identifier for state CONFIGURED in the Base State Machine.
#define CR_FW_INCOMMAND_TYPE
Type identifier for the InCommand component.
FwPrDesc_t CrFwBaseCmpGetDummyExecProc()
Retrieve the singleton instance of the Dummy CEP.
Dummy Component Execution Procedure (CEP) for the Base Component.
void CrFwInCmdConfigCheck(FwPrDesc_t prDesc)
Configuration check for an InCommand.
FwSmDesc_t CrFwInCmdMakeBase()
Return the base InCommand from which all other InCommands are derived.
Definition of the InCommand Component of the framework.
CrFwInFactoryPoolIndex_t CrFwInFactoryGetNOfAllocatedInCmd()
Return the number of InCommands which are currently allocated.
static CrFwCmpData_t inFactoryData
The data for the InFactory singleton.
FwSmDesc_t CrFwInFactoryMakeInCmd(CrFwPckt_t pckt)
Make function for a component encapsulating an incoming command (InCommand).
static CrFwCmpData_t inCmdData[CR_FW_INFACTORY_MAX_NOF_INCMD]
The base data for the pre-allocated InCommand instances.
static CrFwInCmdKindDesc_t inCmdKindDesc[CR_FW_INCMD_NKINDS]
Array of InCommand service descriptors.
static CrFwInFactoryPoolIndex_t nOfAllocatedInRep
The number of currently allocated InReports.
static CrFwInRepKindDesc_t inRepKindDesc[CR_FW_INREP_NKINDS]
Array of InReport service descriptors.
CrFwInFactoryPoolIndex_t CrFwInFactoryGetMaxNOfInCmd()
Return the maximum number of InCommands which may be allocated at any one time.
static void InFactoryInitAction(FwPrDesc_t initPr)
Initialization action for InFactory.
static CrFwInstanceId_t nOfAllocatedInCmdSinceReset
The total number of InCommands or InCommand allocated since the InFactory was reset.
static FwSmDesc_t inCmd[CR_FW_INFACTORY_MAX_NOF_INCMD]
The pre-allocated InCommand instances.
static CrFwBool_t inCmdInUse[CR_FW_INFACTORY_MAX_NOF_INCMD]
The in-use status of each pre-allocated InCommand instance.
CrFwInFactoryPoolIndex_t CrFwInFactoryGetMaxNOfInRep()
Return the maximum number of InReports which may be allocated at any one time.
static CrFwCmpData_t inRepData[CR_FW_INFACTORY_MAX_NOF_INREP]
The base data for the pre-allocated InReport instances.
static CrFwInCmdData_t inCmdCmpSpecificData[CR_FW_INFACTORY_MAX_NOF_INCMD]
The component-specific data for the pre-allocated InCommand instances.
CrFwInFactoryPoolIndex_t CrFwInFactoryGetNOfAllocatedInRep()
Return the number of InReports which are currently allocated.
static FwSmDesc_t inRep[CR_FW_INFACTORY_MAX_NOF_INREP]
The pre-allocated InReport instances.
static void InFactoryShutdownAction(FwSmDesc_t smDesc)
Shutdown action for InFactory.
static CrFwInFactoryPoolIndex_t nextInRepFreePos
The index of the next free position in the pool of pre-allocated InReports instances (a value of CR_F...
void CrFwInFactoryReleaseInCmd(FwSmDesc_t inCmdInstance)
Release function for an InCommand.
static void InFactoryConfigAction(FwPrDesc_t initPr)
Configuration action for InFactory.
static CrFwCmdRepKindKey_t inRepKindKey[CR_FW_INREP_NKINDS]
Array holding the keys of the InReport kinds.
static CrFwInRepData_t inRepCmpSpecificData[CR_FW_INFACTORY_MAX_NOF_INREP]
The component-specific data for the pre-allocated InReport instances.
static CrFwCmdRepKindKey_t inCmdKindKey[CR_FW_INCMD_NKINDS]
Array holding the keys of the InCommand kinds.
static CrFwInFactoryPoolIndex_t nextInCmdFreePos
The index of the next free position in the pool of pre-allocated InCommands instances (a value of CR_...
void CrFwInFactoryReleaseInRep(FwSmDesc_t inRepInstance)
Release function for an InReport.
FwSmDesc_t CrFwInFactoryMakeInRep(CrFwPckt_t pckt)
Make function for a component encapsulating an incoming report (InReport).
static CrFwInstanceId_t nOfAllocatedInRepSinceReset
The total number of InReports or InCommand allocated since the InFactory was reset.
FwSmDesc_t CrFwInFactoryMake()
Factory function for the singleton instance of the InFactory.
static CrFwBool_t inRepInUse[CR_FW_INFACTORY_MAX_NOF_INREP]
The in-use status of each pre-allocated InReport instance.
static CrFwInFactoryPoolIndex_t nOfAllocatedInCmd
The number of currently allocated InCommands.
static FwSmDesc_t inFactory
The singleton instance of the InFactory.
Definition of the InFactory component.
User-modifiable parameters for the InFactory component (see CrFwInFactory.h).
#define CR_FW_INREP_INIT_KIND_DESC
Definition of the incoming report kinds supported by an application.
#define CR_FW_INFACTORY_MAX_NOF_INCMD
The maximum number of components representing an incoming command which may be allocated at any one t...
#define CR_FW_INFACTORY_MAX_NOF_INREP
The maximum number of InReports which may be allocated at any one time.
#define CR_FW_INREP_NKINDS
The total number of kinds of incoming reports supported by the application.
#define CR_FW_INCMD_INIT_KIND_DESC
Definition of the incoming command kinds supported by an application.
#define CR_FW_INCMD_NKINDS
The total number of kinds of incoming commands supported by the application.
Definition of the InRegistry Component.
void CrFwInRepConfigCheck(FwPrDesc_t prDesc)
Configuration check for an InReport.
Definition of the InReport Component of the framework.
FwPrDesc_t CrFwInRepExecProcMake()
Create a new instance of the InReport Execution Procedure.
Execution Procedure for the InReport Component.
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.
Definition of the OutComponent Component of the framework.
Interface for creating and accessing a report or command packet.
CrFwServSubType_t CrFwPcktGetServSubType(CrFwPckt_t pckt)
Return the service sub-type of the command or report encapsulated in a packet.
CrFwInstanceId_t CrFwPcktGetCmdRepId(CrFwPckt_t pckt)
Return the command or report identifier of the command or report encapsulated in a packet.
void CrFwPcktRelease(CrFwPckt_t pckt)
Release function for command or report packets.
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.
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.
void CrFwBaseCmpDefConfigCheck(FwPrDesc_t prDesc)
Function which performs the default Configuration Check of the CRP.
Component Reset Procedure (CRP) for the Base Component.
#define CR_FW_MAX_SERV_SUBTYPE
Maximum value of the service sub-type attribute of InReports and InCommands.
unsigned char CrFwServType_t
Type used for the service type of a command or report.
unsigned char CrFwInFactoryPoolIndex_t
Type for the index in the pool of pre-allocated incoming components in the InFactory (see CrFwInFacto...
unsigned short CrFwCounterU2_t
Type used for unsigned integers with a "medium" range.
unsigned short CrFwDiscriminant_t
Type used for the discriminant of a command or report.
unsigned short CrFwCmdRepKindIndex_t
Type for the index of a command or report kind.
#define CR_FW_MAX_DISCRIMINANT
Maximum value of the discriminant attribute of InReports and InCommands.
@ crIllInRepKind
A framework function was called with an illegal type/sub-type/discriminant triplet for an InReport.
@ crInCmdAllocationFail
Allocation request for a packet for an InCommand has failed (see CrFwInFactoryMakeInCmd).
@ crInRepAllocationFail
Allocation request for an InReport has failed (see CrFwInFactoryMakeInRep).
@ crIllInCmdKind
A framework function was called with an illegal type/sub-type/discriminant triplet for an InCommand.
@ crInRepRelErr
An InReport release request has encountered an error (see CrFwInFactoryReleaseInRep).
@ crInCmdRelErr
An InCommand release request has encountered an error (see CrFwInFactoryReleaseInCmd).
unsigned short CrFwInstanceId_t
Type used for instance identifiers.
unsigned char CrFwServSubType_t
Type used for the command or report sub-type.
unsigned int CrFwCmdRepKindKey_t
Type for the component kind key in CrFwInFactory.c and CrFwOutFactory.c.
void CrFwSetAppErrCode(CrFwAppErrCode_t errCode)
Set the value of the application error code (see CrFwGetAppErrCode).
CrFwCounterU2_t CrFwFindKeyIndex(CrFwCounterU3_t *keyValArray, CrFwCounterU2_t length, CrFwCounterU3_t targetKey)
Convenience function to retrieve the index of an array where a certain target value is located.
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.
InCommand kind descriptor type.
CrFwInCmdValidityCheck_t isValid
The pointer to the function implementing the Validity Check Operation.
CrFwDiscriminant_t discriminant
The discriminant value (or zero if no discriminant for this type/sub-type)
CrFwInCmdTerminationAction_t terminationAction
The pointer to the function implementing the Termination Action Operation.
CrFwInCmdAbortAction_t abortAction
The pointer to the function implementing the Abort Action Operation.
CrFwInCmdProgressAction_t progressAction
The pointer to the function implementing the Progress Action Operation.
CrFwInCmdReadyCheck_t isReady
The pointer to the function implementing the Ready Check Operation.
CrFwServType_t servType
The service type.
CrFwInCmdStartAction_t startAction
The pointer to the function implementing the Start Action Operation.
CrFwServSubType_t servSubType
The service sub-type.
InReport kind descriptor type.
CrFwDiscriminant_t discriminant
The discriminant value (or zero if no discriminant for this type/sub-type)
CrFwInRepUpdateAction_t updateAction
The pointer to the function implementing the Update Action Operation.
CrFwServType_t servType
The service type.
CrFwInRepValidityCheck_t isValid
The pointer to the function implementing the Validity Check Operation.
CrFwServSubType_t servSubType
The service sub-type.
Type for the data describing an InCommand.
CrFwInCmdValidityCheck_t isValid
Function which implements the Configuration Check for the InCommand.
CrFwProgressStepId_t progressStepId
The progress step identifier.
CrFwPckt_t pckt
Packet holding the InCommand.
CrFwExecStepId_t nOfProgressFailure
Number of progress steps which failed.
CrFwInFactoryPoolIndex_t factoryPoolIndex
Index of the position in the pool of pre-allocated InCommands in the InFactory to which the InCompone...
CrFwInCmdTerminationAction_t terminationAction
Function which implements the Termination Action for the InCommand.
CrFwInCmdAbortAction_t abortAction
Function which implements the Abort Action for the InCommand.
CrFwInCmdProgressAction_t progressAction
Function which implements the Progress Action for the InCommand.
CrFwInCmdReadyCheck_t isReady
Function which implements the Ready Check for the InCommand.
CrFwBool_t isProgressActionCompleted
Flag indicating whether the progress action has been completed.
CrFwInCmdStartAction_t startAction
Function which implements the Start Action for the InCommand.
Type for the data describing an InReport.
CrFwPckt_t pckt
Packet holding the InReport.
CrFwInFactoryPoolIndex_t factoryPoolIndex
Index of the position in the pool of pre-allocated InReports in the InFactory to which the InComponen...
CrFwInRepUpdateAction_t updateAction
Function which implements the Update Action for the InReport.
CrFwInRepValidityCheck_t isValid
Function which implements the Validity Check for the InReport.