33 #include "FwPrConfig.h"
34 #include "FwPrDCreate.h"
35 #include "FwSmConfig.h"
36 #include "FwSmDCreate.h"
98 FwPrDesc_t resetPr, execPr, initPr;
170 while (
servDesc[i].nextServType != 0)
198 while (
servDesc[i].nextServType != 0)
237 if (discriminant == 0) {
242 if (discriminant >
servDesc[i].upperBoundDisc) {
247 if (discriminant <
servDesc[i].lowerBoundDisc) {
263 cmdRepIndex = cmpSpecificData->
index;
264 if (
servDesc[cmdRepIndex].isServTypeEnabled == 0)
267 if (
servDesc[cmdRepIndex].isServSubTypeEnabled == 0)
271 if (discriminant == 0)
337 if (
servDesc[i].upperBoundDisc == 0)
368 if (
servDesc[i].upperBoundDisc != 0)
369 for (j=0; j<nOfDiscValues; j++)
370 servDesc[i].isDiscriminantEnabled[j] = 1;
390 free(
servDesc[i].isDiscriminantEnabled);
void CrFwBaseCmpDefShutdownAction(FwSmDesc_t smDesc)
Function which performs the Shutdown Action for the Base State Machine.
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 short CrFwCmdRepIndex_t
Type for the index of a command or report in the InRegistry or OutRegistry.
#define CR_FW_OUTREGISTRY_TYPE
Type identifier for the OutRegistry component.
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
FwPrDesc_t CrFwBaseCmpGetDummyExecProc()
Retrieve the singleton instance of the Dummy CEP.
Dummy Component Execution Procedure (CEP) for the Base Component.
static CrFwServType_t servType
The InCommand type as computed in the Validity Check.
static CrFwDiscriminant_t disc
Discriminant.
static CrFwInstanceId_t cmdRepId
Command or Report Identifier.
static CrFwServSubType_t servSubType
Service sub-type.
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.
CrFwDiscriminant_t CrFwOutCmpGetDiscriminant(FwSmDesc_t smDesc)
Return the discriminant of the OutComponent.
Definition of the OutComponent Component of the framework.
static CrFwCmpData_t outCmpData[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The data for the pre-allocated OutComponent instances.
static CrFwOutCmpData_t outCmpSpecificData[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The component-specific data for the pre-allocated OutReport instances.
static FwSmDesc_t outCmp[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The pre-allocated OutComponent instances.
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 ...
CrFwServType_t CrFwOutRegistryGetServType(CrFwCmdRepIndex_t cmdRepIndex)
Get the service type of the argument command or report index.
static CrFwServDesc_t servDesc[CR_FW_OUTREGISTRY_NSERV]
Array of service descriptors (see CrFwServDesc_t).
CrFwServSubType_t CrFwOutRegistryGetServSubType(CrFwCmdRepIndex_t cmdRepIndex)
Get the service sub-type of the argument command or report index.
CrFwBool_t CrFwOutRegistryIsEnabled(FwSmDesc_t outCmp)
Query the enable status of an out-going command or report.
static CrFwTrackedState_t cmdRepState[CR_FW_OUTREGISTRY_N]
Array to track the state of out-going commands or reports.
void CrFwOutRegistryStartTracking(FwSmDesc_t outCmp)
Ask the OutRegistry to start tracking an out-going command or report.
static void OutRegistryConfigAction(FwPrDesc_t resetPr)
Configuration action for OutRegistry.
FwSmDesc_t CrFwOutRegistryMake()
Factory function for the singleton instance of the OutRegistry.
void CrFwOutRegistryUpdateState(FwSmDesc_t outCmp, CrFwOutRegistryCmdRepState_t newState)
Ask the OutRegistry to update the state of an out-going command or report.
CrFwDiscriminant_t CrFwOutRegistryGetLowerDiscriminant(CrFwCmdRepIndex_t cmdRepIndex)
Get the lower bound of the argument command or report index.
static CrFwCmpData_t outRegistryData
The data for the OutRegistry singleton.
CrFwDiscriminant_t CrFwOutRegistryGetUpperDiscriminant(CrFwCmdRepIndex_t cmdRepIndex)
Get the upper bound of the argument command or report index.
void CrFwOutRegistrySetEnable(CrFwServType_t servType, CrFwServSubType_t servSubType, CrFwDiscriminant_t discriminant, CrFwBool_t isEnabled)
Set the enable state of a set of out-going commands or reports.
static void OutRegistryShutdownAction(FwSmDesc_t smDesc)
Shutdown action for OutRegistry.
CrFwBool_t CrFwOutRegistryIsDiscriminantEnabled(CrFwCmdRepIndex_t cmdRepIndex, CrFwDiscriminant_t disc)
Get the enable status of a discriminant in the argument command or report index.
static FwSmDesc_t outRegistry
The OutRegistry singleton.
static void OutRegistryInitAction(FwPrDesc_t initPr)
Initialization action for OutRegistry.
CrFwOutRegistryCmdRepState_t CrFwOutRegistryGetState(CrFwInstanceId_t cmdRepId)
Query the OutRegistry for the state of an out-going command or report.
static CrFwTrackingIndex_t cmdRepStateIndex
The index of the most recent entry in cmdRepState.
Definition of the OutRegistry Component.
CrFwOutRegistryCmdRepState_t
Enumerated type for the state of an out-going command or report tracked by the OutRegistry.
@ crOutRegistryNoEntry
No entry yet in OutRegistry.
@ crOutRegistryPending
Out-going command or report is pending (waiting to be sent)
@ crOutRegistryNotTracked
Out-going command or report is not tracked.
User-modifiable parameters for the OutRegistry component (see CrFwOutRegistry.h).
#define CR_FW_OUTREGISTRY_INIT_SERV_DESC
Definition of the range of out-going services supported by an application.
#define CR_FW_OUTREGISTRY_N
The maximum number of out-going commands or reports which can be tracked by the OutRegistry.
#define CR_FW_OUTREGISTRY_NSERV
The total number of service types/sub-types provided by the application.
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.
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.
@ crIllDiscriminant
A framework function was called with an illegal discriminant.
@ crIllServSubType
A framework function was called with an illegal service sub-type.
@ crIllServType
A framework function was called with an illegal service type.
unsigned short CrFwTrackingIndex_t
Type for the index used to track the state of a component.
unsigned short CrFwInstanceId_t
Type used for instance identifiers.
unsigned char CrFwServSubType_t
Type used for the command or report sub-type.
void CrFwSetAppErrCode(CrFwAppErrCode_t errCode)
Set the value of the application error code (see CrFwGetAppErrCode).
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.
CrFwDiscriminant_t upperBoundDisc
The upper bound of a range of discriminant values (or zero if no discriminant for this type/sub-type)
CrFwBool_t isServTypeEnabled
Number of discriminant values for this [type, sub-type] pair in the next row.
CrFwBool_t isServSubTypeEnabled
The enable state for the service sub-type (see CrFwOutRegistry.h)
CrFwDiscriminant_t lowerBoundDisc
The lower bound of a range of discriminant values (or zero if no discriminant for this type/sub-type)
unsigned char * isDiscriminantEnabled
The enable state for the discriminants in the range [lowerBoundDisc,lowerBoundDisc].
CrFwServType_t servType
The service type.
CrFwCmdRepIndex_t nextServType
Index of the next service type or zero when this is the last service type.
CrFwServSubType_t servSubType
The service sub-type.
An instance of this type holds the information about an incoming command or report which is being tra...
CrFwInstanceId_t instanceId
The identifier of the incoming command or report.
CrFwInRegistryCmdRepState_t state
The state of the incoming command or report.
CrFwOutRegistryCmdRepState_t state
The state of the out-going command or report.
Type for the data describing an OutComponent.
CrFwCmdRepIndex_t index
Index of out-going command or report (see CrFwOutRegistry.h)
CrFwTrackingIndex_t trackingIndex
Index through which an out-going command or report is tracked by the OutRegistry (see CrFwOutRegistry...