36 #include "FwPrConfig.h"
37 #include "FwPrDCreate.h"
38 #include "FwSmConfig.h"
40 #include "FwSmDCreate.h"
123 FwPrDesc_t resetPr, execPr, initPr;
282 FwPrDesc_t outCmpInitPr, outCmpResetPr, outCmpExecPr;
357 FwSmReleaseDer(
outCmp[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.
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_BASE_STATE_CONFIGURED
State identifier for state CONFIGURED in the Base State Machine.
#define CR_FW_OUTCMP_TYPE
Type identifier for the OutComponent components.
#define CR_FW_OUTFACTORY_TYPE
Type identifier for the OutFactory component.
FwPrDesc_t CrFwBaseCmpGetDummyExecProc()
Retrieve the singleton instance of the Dummy CEP.
Dummy Component Execution Procedure (CEP) for the Base Component.
static CrFwCmdRepType_t cmdRepType
Destination.
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.
FwSmDesc_t CrFwOutCmpMakeBase()
Return the base OutComponent from which all other OutComponents are derived.
Definition of the OutComponent Component of the framework.
static CrFwCmpData_t outFactoryData
The data for the OutFactory singleton.
static CrFwOutFactoryPoolIndex_t nextFreePos
The index of the next free position in the pool of pre-allocated OutComponent instances (a value of C...
static void OutFactoryInitAction(FwPrDesc_t initPr)
Initialization action for OutFactory.
CrFwInstanceId_t CrFwOutFactoryGetNOfInstanceId()
Return the number of distinct instance identifiers supported by the OutFactory.
static CrFwInstanceId_t nOfAllocatedOutCmpSinceReset
The total number of OutComponents allocated since the OutFactory was reset.
static CrFwBool_t outCmpInUse[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The in-use status of each pre-allocated OutComponent instance.
CrFwOutFactoryPoolIndex_t CrFwOutFactoryGetNOfAllocatedOutCmp()
Return the number of OutComponents which are currently allocated.
static CrFwCmpData_t outCmpData[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The data for the pre-allocated OutComponent instances.
static FwSmDesc_t outFactory
The singleton instance of the OutFactory.
static CrFwOutFactoryPoolIndex_t nOfAllocatedOutCmp
The number of currently allocated OutComponents.
static CrFwInstanceId_t apidInstanceId
The part of the command or report identifier which depends on the application identifier.
static void OutFactoryConfigAction(FwPrDesc_t initPr)
Configuration action for OutFactory.
FwSmDesc_t CrFwOutFactoryMakeOutCmp(CrFwServType_t type, CrFwServSubType_t subType, CrFwDiscriminant_t discriminant, CrFwPcktLength_t length)
Make function for an OutComponent.
static CrFwInstanceId_t maxInstanceId
The highest value of cmd/rep identifier (before overflowing into the application identifier bits)
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.
FwSmDesc_t CrFwOutFactoryMake()
Factory function for the singleton instance of the OutFactory.
static void OutFactoryShutdownAction(FwSmDesc_t smDesc)
Shutdown action for OutFactory.
static FwSmDesc_t outCmp[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The pre-allocated OutComponent instances.
static CrFwCmdRepKindKey_t outCmpKindKey[CR_FW_OUTCMP_NKINDS]
Array holding the keys of the OutComponents kinds.
void CrFwOutFactoryReleaseOutCmp(FwSmDesc_t outCmpInstance)
Release function for an OutComponent.
CrFwOutFactoryPoolIndex_t CrFwOutFactoryGetMaxNOfOutCmp()
Return the maximum number of OutComponents which may be allocated at any one time.
Definition of the OutFactory component.
User-modifiable parameters for the OutFactory component (see CrFwOutFactory.h).
#define CR_FW_OUTCMP_INIT_KIND_DESC
Definition of the OutComponent kinds supported by an application.
#define CR_FW_OUTCMP_NKINDS
The total number of kinds of OutComponents supported by the application.
#define CR_FW_OUTFACTORY_MAX_NOF_OUTCMP
The maximum number of OutComponents which may be allocated at any one time.
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 ...
Definition of the OutRegistry Component.
Interface for creating and accessing a report or command packet.
void CrFwPcktSetServSubType(CrFwPckt_t pckt, CrFwServSubType_t servSubType)
Set the service sub-type of the command or report encapsulated in a packet.
void CrFwPcktSetSeqCnt(CrFwPckt_t pckt, CrFwSeqCnt_t seqCnt)
Set the sequence counter of the command or report encapsulated in a packet.
void CrFwPcktSetCmdRepType(CrFwPckt_t pckt, CrFwCmdRepType_t type)
Set the type of a packet (either a command packet or a report packet).
void CrFwPcktSetDiscriminant(CrFwPckt_t pckt, CrFwDiscriminant_t discriminant)
Set the discriminant of the command or report encapsulated in a packet.
void CrFwPcktSetServType(CrFwPckt_t pckt, CrFwServType_t servType)
Set the service type of the command or report encapsulated in a packet.
void CrFwPcktRelease(CrFwPckt_t pckt)
Release function for command or report packets.
void CrFwPcktSetSrc(CrFwPckt_t pckt, CrFwDestSrc_t src)
Set the source of the command or report encapsulated in a packet.
void CrFwPcktSetGroup(CrFwPckt_t pckt, CrFwGroup_t group)
Set the group of the command/report encapsulated in a packet.
CrFwPckt_t CrFwPcktMake(CrFwPcktLength_t pcktLength)
Make function for command or report packets.
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.
#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 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.
unsigned short int CrFwPcktLength_t
Type for the packet length.
#define CR_FW_NBITS_APP_ID
The number of bits reserved for the application identifier in a command or report identifier.
unsigned char CrFwOutFactoryPoolIndex_t
Type for the index in the pool of pre-allocated OutComponents in the OutFactory (see CrFwOutFactory....
#define CR_FW_MAX_DISCRIMINANT
Maximum value of the discriminant attribute of InReports and InCommands.
@ crOutCmpRelErr
An OutComponent release request has encountered an error (see CrFwOutFactoryReleaseOutCmp).
@ crIllOutCmpKind
A framework function was called with an illegal type/sub-type/discriminant triplet for an OutComponen...
@ crOutCmpAllocationFail
An OutComponent allocation request has failed (see CrFwOutFactoryMakeOutCmp).
#define CR_FW_HOST_APP_ID
The identifier of the host application (i.e.
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.
OutComponent kind descriptor type.
CrFwDiscriminant_t discriminant
The discriminant value (or zero if no discriminant for this type/sub-type)
CrFwOutCmpSerialize_t serialize
The pointer to the function implementing the Serialize Operation.
CrFwOutCmpRepeatCheck_t isRepeat
The pointer to the function implementing the Ready Check Operation.
CrFwOutCmpUpdate_t update
The pointer to the function implementing the Update Operation.
CrFwOutCmpReadyCheck_t isReady
The pointer to the function implementing the Ready Check Operation.
CrFwOutCmpEnableCheck_t isEnabled
The pointer to the function implementing the Enable Check Operation.
CrFwServType_t servType
The service type.
CrFwPcktLength_t pcktLength
The length of the packet attached to the OutComponent.
CrFwServSubType_t servSubType
The service sub-type.
Type for the data describing an OutComponent.
CrFwCmdRepIndex_t index
Index of out-going command or report (see CrFwOutRegistry.h)
CrFwPckt_t pckt
Packet to which the out-going command or report is serialized.
CrFwOutCmpSerialize_t serialize
Function which implements the Serialization Operation for the out-going 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
Function which implements the Repeat Check for the out-going command or report.
CrFwOutCmpUpdate_t update
Function which implements the Update Operation for the out-going command or report.
CrFwOutCmpReadyCheck_t isReady
Function which implements the Ready Check for the out-going command or report.
CrFwOutCmpEnableCheck_t isEnabled
Function which implements the Enable Check for the out-going command or report.