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