36 #include "FwPrConfig.h" 37 #include "FwPrDCreate.h" 38 #include "FwSmConfig.h" 40 #include "FwSmDCreate.h" 123 FwPrDesc_t resetPr, execPr, initPr;
156 FwPrSetData(outFactoryData.
initProc, &outFactoryData);
157 FwPrSetData(outFactoryData.
resetProc, &outFactoryData);
200 outCmpSpecificData[freePos].
isReady = outCmpKindDesc[kindIndex].
isReady;
203 outCmpSpecificData[freePos].
update= outCmpKindDesc[kindIndex].
update;
214 outCmpSpecificData[freePos].
pckt = pckt;
255 outCmpSpecificData[posToBeFreed].
pckt = NULL;
282 FwPrDesc_t outCmpInitPr, outCmpResetPr, outCmpExecPr;
296 outCmpData[i].
initProc = outCmpInitPr;
300 outCmpData[i].
execProc = outCmpExecPr;
309 FwSmSetData(
outCmp[i], &outCmpData[i]);
311 FwPrSetData(outCmpData[i].initProc, &outCmpData[i]);
312 FwPrSetData(outCmpData[i].resetProc, &outCmpData[i]);
334 outCmpSpecificData[i].
pckt = NULL;
352 FwPrReleaseDer(outCmpData[i].initProc);
354 FwPrReleaseDer(outCmpData[i].resetProc);
357 FwSmReleaseDer(
outCmp[i]);
361 if (outCmpSpecificData[i].pckt != NULL)
CrFwOutCmpSerialize_t serialize
Function which implements the Serialization Operation for the out-going command or report...
CrFwPcktLength_t pcktLength
The length of the packet attached to the OutComponent.
Type for the Framework Component Data (FCD).
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.
void CrFwPcktSetSrc(CrFwPckt_t pckt, CrFwDestSrc_t src)
Set the source of the command or report encapsulated in a packet.
#define CR_FW_OUTCMP_TYPE
Type identifier for the OutComponent components.
unsigned char CrFwOutFactoryPoolIndex_t
Type for the index in the pool of pre-allocated OutComponents in the OutFactory (see CrFwOutFactory...
void CrFwPcktSetGroup(CrFwPckt_t pckt, CrFwGroup_t group)
Set the group of the command/report encapsulated in a packet.
#define CR_FW_OUTFACTORY_MAX_NOF_OUTCMP
The maximum number of OutComponents which may be allocated at any one time.
void CrFwCmpInit(FwSmDesc_t smDesc)
Initialize a framework component.
FwPrDesc_t CrFwCmpGetResetProc()
Retrieve the singleton instance of the CRP.
Definition of the Framework Component Data (FCD) Type.
A framework function was called with an illegal type/sub-type/discriminant triplet for an OutComponen...
static FwSmDesc_t outCmp[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The pre-allocated OutComponent instances.
#define CRFW_UNUSED(x)
A macro that can be used to specify that a function parameter is not used.
static void OutFactoryInitAction(FwPrDesc_t initPr)
Initialization action for OutFactory.
FwSmDesc_t CrFwOutCmpMakeBase()
Return the base OutComponent from which all other OutComponents are derived.
void CrFwSetAppErrCode(CrFwAppErrCode_t errCode)
Set the value of the application error code (see CrFwGetAppErrCode).
#define CR_FW_HOST_APP_ID
The identifier of the host application.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
CrFwPckt_t CrFwPcktMake(CrFwPcktLength_t pcktLength)
Make function for command or report packets.
static CrFwInstanceId_t apidInstanceId
The part of the command or report identifier which depends on the application identifier.
Definition of the OutFactory component.
Type for the data describing an OutComponent.
CrFwServType_t servType
The service type.
CrFwPckt_t pckt
Packet to which the out-going command or report is serialized.
Interface for creating and accessing a report or command packet.
CrFwOutCmpEnableCheck_t isEnabled
Function which implements the Enable Check for the out-going command or report.
void CrFwBaseCmpDefShutdownAction(FwSmDesc_t smDesc)
Function which performs the Shutdown Action for the Base State Machine.
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).
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...
Dummy Component Execution Procedure (CEP) for the Base Component.
Definition of the OutRegistry Component.
#define CR_FW_NBITS_APP_ID
The number of bits reserved for the application identifier in a command or report identifier...
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.
unsigned short CrFwDiscriminant_t
Type used for the discriminant of a command or report.
CrFwInstanceId_t instanceId
The instance identifier of the framework component.
CrFwCmdRepIndex_t CrFwOutRegistryGetCmdRepIndex(CrFwServType_t servType, CrFwServSubType_t servSubType)
Get the index corresponding to the argument [service type, service sub-type] of an out-going command ...
void CrFwBaseCmpDefInitAction(FwPrDesc_t prDesc)
Function which performs the default Initialization Action of the CIP.
unsigned int CrFwCmdRepKindKey_t
Type for the component kind key in CrFwInFactory.c and CrFwOutFactory.c.
An OutComponent allocation request has failed (see CrFwOutFactoryMakeOutCmp).
static FwSmDesc_t outFactory
The singleton instance of the OutFactory.
CrFwOutCmpRepeatCheck_t isRepeat
Function which implements the Repeat Check for the out-going command or report.
unsigned short CrFwCmdRepKindIndex_t
Type for the index of a command or report kind.
OutComponent kind descriptor type.
void CrFwPcktSetCmdRepType(CrFwPckt_t pckt, CrFwCmdRepType_t type)
Set the type of a packet (either a command packet or a report packet).
CrFwOutCmpUpdate_t update
The pointer to the function implementing the Update Operation.
unsigned short CrFwCounterU2_t
Type used for unsigned integers with a "medium" range.
CrFwCmdRepIndex_t index
Index of out-going command or report (see CrFwOutRegistry.h)
#define CR_FW_MAX_DISCRIMINANT
Maximum value of the discriminant attribute of InReports and InCommands.
void CrFwPcktSetServSubType(CrFwPckt_t pckt, CrFwServSubType_t servSubType)
Set the service sub-type of the command or report encapsulated in a packet.
static CrFwInstanceId_t maxInstanceId
The highest value of cmd/rep identifier (before overflowing into the application identifier bits) ...
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.
static CrFwCmpData_t outFactoryData
The data for the OutFactory singleton.
Definition of the utility functions for the CORDET Framework.
static void OutFactoryConfigAction(FwPrDesc_t initPr)
Configuration action for OutFactory.
FwPrDesc_t execProc
The Component Execution Procedure (CEP) (see CrFwBaseCmp.h).
CrFwOutFactoryPoolIndex_t CrFwOutFactoryGetMaxNOfOutCmp()
Return the maximum number of OutComponents which may be allocated at any one time.
FwSmDesc_t CrFwBaseCmpMake()
Retrieve the singleton instance of the Base State Machine.
static CrFwCmdRepKindKey_t outCmpKindKey[CR_FW_OUTCMP_NKINDS]
Array holding the keys of the OutComponents kinds.
#define CR_FW_MAX_SERV_SUBTYPE
Maximum value of the service sub-type attribute of InReports and InCommands.
CrFwOutCmpEnableCheck_t isEnabled
The pointer to the function implementing the Enable Check Operation.
void CrFwCmpReset(FwSmDesc_t smDesc)
Reset a framework component.
FwPrDesc_t CrFwBaseCmpGetDummyExecProc()
Retrieve the singleton instance of the Dummy CEP.
CrFwServSubType_t servSubType
The service sub-type.
static CrFwOutFactoryPoolIndex_t nextFreePos
The index of the next free position in the pool of pre-allocated OutComponent instances (a value of C...
void CrFwPcktSetServType(CrFwPckt_t pckt, CrFwServType_t servType)
Set the service type of the command or report encapsulated in a packet.
static void OutFactoryShutdownAction(FwSmDesc_t smDesc)
Shutdown action for OutFactory.
CrFwOutFactoryPoolIndex_t CrFwOutFactoryGetNOfAllocatedOutCmp()
Return the number of OutComponents which are currently allocated.
Definition of Base Component.
CrFwOutCmpReadyCheck_t isReady
Function which implements the Ready Check for the out-going command or report.
User-modifiable parameters for the OutFactory component (see CrFwOutFactory.h).
void CrFwOutFactoryReleaseOutCmp(FwSmDesc_t outCmpInstance)
Release function for an OutComponent.
static CrFwOutFactoryPoolIndex_t nOfAllocatedOutCmp
The number of currently allocated OutComponents.
CrFwOutCmpReadyCheck_t isReady
The pointer to the function implementing the Ready Check Operation.
Component Initialization Procedure (CIP) for the Base Component.
unsigned short int CrFwPcktLength_t
Type for the packet length.
Definition of the OutComponent Component of the framework.
CrFwDiscriminant_t discriminant
The discriminant value (or zero if no discriminant for this type/sub-type)
FwSmDesc_t CrFwOutFactoryMake()
Factory function for the singleton instance of the OutFactory.
static CrFwCmpData_t outCmpData[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The data for the pre-allocated OutComponent instances.
An OutComponent release request has encountered an error (see CrFwOutFactoryReleaseOutCmp).
#define CR_FW_OUTFACTORY_TYPE
Type identifier for the OutFactory component.
CrFwTypeId_t typeId
The type identifier of the framework component.
#define CR_FW_OUTCMP_INIT_KIND_DESC
Definition of the OutComponent kinds supported by an application.
static CrFwBool_t outCmpInUse[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The in-use status of each pre-allocated OutComponent instance.
static CrFwOutCmpKindDesc_t outCmpKindDesc[CR_FW_OUTCMP_NKINDS]
Array of service descriptors.
static CrFwOutCmpData_t outCmpSpecificData[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The component-specific data for the pre-allocated OutReport instances.
void CrFwPcktSetSeqCnt(CrFwPckt_t pckt, CrFwSeqCnt_t seqCnt)
Set the sequence counter of the command or report encapsulated in a packet.
#define CR_FW_BASE_STATE_CONFIGURED
State identifier for state CONFIGURED in the Base State Machine.
static CrFwInstanceId_t nOfAllocatedOutCmpSinceReset
The total number of OutComponents allocated since the OutFactory was reset.
CrFwOutCmpUpdate_t update
Function which implements the Update Operation for the out-going command or report.
#define CR_FW_OUTCMP_NKINDS
The total number of kinds of OutComponents supported by the application.
static CrFwCmdRepType_t cmdRepType
Destination.
void CrFwPcktSetDiscriminant(CrFwPckt_t pckt, CrFwDiscriminant_t discriminant)
Set the discriminant of the command or report encapsulated in a packet.
FwSmDesc_t CrFwOutFactoryMakeOutCmp(CrFwServType_t type, CrFwServSubType_t subType, CrFwDiscriminant_t discriminant, CrFwPcktLength_t length)
Make function for an OutComponent.
CrFwOutCmpSerialize_t serialize
The pointer to the function implementing the Serialize Operation.
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.
CrFwOutFactoryPoolIndex_t factoryPoolIndex
Index of the position in the pool of pre-allocated OutComponents in the OutFactory to which the OutCo...
CrFwOutCmpRepeatCheck_t isRepeat
The pointer to the function implementing the Ready Check Operation.
Component Reset Procedure (CRP) for the Base Component.
CrFwInstanceId_t CrFwOutFactoryGetNOfInstanceId()
Return the number of distinct instance identifiers supported by the OutFactory.
FwPrDesc_t initProc
The Component Initialization Procedure (CIP) (see CrFwInitProc.h).
unsigned char CrFwServSubType_t
Type used for the command or report sub-type.