33 #include "FwPrConfig.h" 34 #include "FwPrDCreate.h" 35 #include "FwSmConfig.h" 36 #include "FwSmDCreate.h" 98 FwPrDesc_t resetPr, execPr, initPr;
131 FwPrSetData(outRegistryData.
initProc, &outRegistryData);
132 FwPrSetData(outRegistryData.
resetProc, &outRegistryData);
142 return servDesc[cmdRepIndex].
servType;
170 while (servDesc[i].nextServType != 0)
171 if (servDesc[i].servType < servType)
173 else if (servDesc[i].servType > servType)
178 if (servDesc[i].servType != servType)
181 while (servDesc[i].servSubType <= servSubType) {
182 if (servDesc[i].servSubType == servSubType)
185 if (servDesc[i].servType != servType)
198 while (servDesc[i].nextServType != 0)
199 if (servDesc[i].servType < servType)
201 else if (servDesc[i].servType > servType) {
207 if (servDesc[i].servType != servType) {
212 if (servSubType == 0) {
213 while (servDesc[i].servType == servType) {
222 while (servDesc[i].servType == servType) {
223 if (servDesc[i].servSubType < servSubType)
225 else if (servDesc[i].servSubType > servSubType) {
232 if (servDesc[i].servSubType < servSubType) {
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)
273 discOffset = (discriminant - servDesc[cmdRepIndex].
lowerBoundDisc);
301 if (cmdRepState[i].instanceId == outCmpData->
instanceId) {
302 cmdRepState[i].
state = newState;
319 if (cmdRepState[i].instanceId == cmdRepId) {
320 return cmdRepState[i].
state;
322 i = (CR_FW_OUTREGISTRY_N-1);
337 if (servDesc[i].upperBoundDisc == 0)
346 for (i=CR_FW_OUTREGISTRY_NSERV-1; i>0; i--) {
368 if (servDesc[i].upperBoundDisc != 0)
369 for (j=0; j<nOfDiscValues; j++)
370 servDesc[i].isDiscriminantEnabled[j] = 1;
390 free(servDesc[i].isDiscriminantEnabled);
Type for the Framework Component Data (FCD).
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.
CrFwServSubType_t servSubType
The service sub-type.
CrFwCmdRepIndex_t nextServType
Index of the next service type or zero when this is the last service type.
FwPrDesc_t CrFwCmpGetResetProc()
Retrieve the singleton instance of the CRP.
Definition of the Framework Component Data (FCD) Type.
CrFwDiscriminant_t CrFwOutRegistryGetLowerDiscriminant(CrFwCmdRepIndex_t cmdRepIndex)
Get the lower bound of the argument command or report index.
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.
CrFwBool_t isServTypeEnabled
Number of discriminant values for this [type, sub-type] pair in the next row.
void CrFwSetAppErrCode(CrFwAppErrCode_t errCode)
Set the value of the application error code (see CrFwGetAppErrCode).
Out-going command or report is not tracked.
CrFwOutRegistryCmdRepState_t CrFwOutRegistryGetState(CrFwInstanceId_t cmdRepId)
Query the OutRegistry for the state of an out-going command or report.
#define CR_FW_OUTREGISTRY_INIT_SERV_DESC
Definition of the range of out-going services supported by an application.
unsigned short CrFwCmdRepIndex_t
Type for the index of a command or report in the InRegistry or OutRegistry.
CrFwOutRegistryCmdRepState_t state
The state of the out-going command or report.
Type for the data describing an OutComponent.
static void OutRegistryInitAction(FwPrDesc_t initPr)
Initialization action for OutRegistry.
A framework function was called with an illegal service type.
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).
static CrFwServSubType_t servSubType
Service sub-type.
Dummy Component Execution Procedure (CEP) for the Base Component.
Definition of the OutRegistry Component.
void CrFwOutRegistryStartTracking(FwSmDesc_t outCmp)
Ask the OutRegistry to start tracking an out-going command or report.
Header file to define all invariant publicly available constants and types for the CORDET Framework...
unsigned short CrFwDiscriminant_t
Type used for the discriminant of a command or report.
Out-going command or report is pending (waiting to be sent)
An instance of this type holds the information about an incoming command or report which is being tra...
CrFwBool_t CrFwOutRegistryIsDiscriminantEnabled(CrFwCmdRepIndex_t cmdRepIndex, CrFwDiscriminant_t disc)
Get the enable status of a discriminant in the argument command or report index.
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.
CrFwInstanceId_t instanceId
The identifier of the incoming command or report.
No entry yet in OutRegistry.
void CrFwOutRegistryUpdateState(FwSmDesc_t outCmp, CrFwOutRegistryCmdRepState_t newState)
Ask the OutRegistry to update the state of an out-going command or report.
static CrFwDiscriminant_t disc
Discriminant.
CrFwServType_t CrFwOutRegistryGetServType(CrFwCmdRepIndex_t cmdRepIndex)
Get the service type of the argument command or report index.
CrFwTrackingIndex_t trackingIndex
Index through which an out-going command or report is tracked by the OutRegistry (see CrFwOutRegistry...
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)
CrFwBool_t CrFwOutRegistryIsEnabled(FwSmDesc_t outCmp)
Query the enable status of an out-going command or report.
void * cmpSpecificData
Derived data which are specific to each type of framework component.
A framework function was called with an illegal service sub-type.
static CrFwTrackedState_t cmdRepState[CR_FW_OUTREGISTRY_N]
Array to track the state of out-going commands or reports.
void CrFwBaseCmpDefConfigAction(FwPrDesc_t prDesc)
Function which performs the default Configuration Action of the CRP.
CrFwDiscriminant_t CrFwOutRegistryGetUpperDiscriminant(CrFwCmdRepIndex_t cmdRepIndex)
Get the upper bound of the argument command or report index.
static FwSmDesc_t outRegistry
The OutRegistry singleton.
Definition of the utility functions for the CORDET Framework.
FwSmDesc_t CrFwOutRegistryMake()
Factory function for the singleton instance of the OutRegistry.
FwPrDesc_t execProc
The Component Execution Procedure (CEP) (see CrFwBaseCmp.h).
CrFwServType_t servType
The service type.
unsigned char * isDiscriminantEnabled
The enable state for the discriminants in the range [lowerBoundDisc,lowerBoundDisc].
FwSmDesc_t CrFwBaseCmpMake()
Retrieve the singleton instance of the Base State Machine.
static CrFwInstanceId_t cmdRepId
Command or Report Identifier.
CrFwDiscriminant_t lowerBoundDisc
The lower bound of a range of discriminant values (or zero if no discriminant for this type/sub-type)...
FwPrDesc_t CrFwBaseCmpGetDummyExecProc()
Retrieve the singleton instance of the Dummy CEP.
CrFwBool_t isServSubTypeEnabled
The enable state for the service sub-type (see CrFwOutRegistry.h)
CrFwDiscriminant_t CrFwOutCmpGetDiscriminant(FwSmDesc_t smDesc)
Return the discriminant of the OutComponent.
static CrFwCmpData_t outRegistryData
The data for the OutRegistry singleton.
Definition of Base Component.
static CrFwServType_t servType
The InCommand type as computed in the Validity Check.
#define CR_FW_OUTREGISTRY_N
The maximum number of out-going commands or reports which can be tracked by the OutRegistry.
static CrFwTrackingIndex_t cmdRepStateIndex
The index of the most recent entry in cmdRepState.
Component Initialization Procedure (CIP) for the Base Component.
Definition of the OutComponent Component of the framework.
CrFwOutRegistryCmdRepState_t
Enumerated type for the state of an out-going command or report tracked by the OutRegistry.
static void OutRegistryShutdownAction(FwSmDesc_t smDesc)
Shutdown action for OutRegistry.
static CrFwCmpData_t outCmpData[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The data for the pre-allocated OutComponent instances.
User-modifiable parameters for the OutRegistry component (see CrFwOutRegistry.h). ...
CrFwDiscriminant_t upperBoundDisc
The upper bound of a range of discriminant values (or zero if no discriminant for this type/sub-type)...
static CrFwServDesc_t servDesc[CR_FW_OUTREGISTRY_NSERV]
Array of service descriptors (see CrFwServDesc_t).
CrFwTypeId_t typeId
The type identifier of the framework component.
static CrFwOutCmpData_t outCmpSpecificData[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The component-specific data for the pre-allocated OutReport instances.
CrFwInRegistryCmdRepState_t state
The state of the incoming command or report.
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.
#define CR_FW_OUTREGISTRY_NSERV
The total number of service types/sub-types provided by the application.
unsigned short CrFwTrackingIndex_t
Type for the index used to track the state of a component.
#define CR_FW_OUTREGISTRY_TYPE
Type identifier for the OutRegistry component.
A framework function was called with an illegal discriminant.
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.
static void OutRegistryConfigAction(FwPrDesc_t resetPr)
Configuration action for OutRegistry.
CrFwServSubType_t CrFwOutRegistryGetServSubType(CrFwCmdRepIndex_t cmdRepIndex)
Get the service sub-type of the argument command or report index.
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.