CORDET Framework - C2 Implementation
CrFwConstants.h
Go to the documentation of this file.
1 
21 #ifndef CRFW_CONSTANTS_H_
22 #define CRFW_CONSTANTS_H_
23 
24 #include "FwPrConstants.h"
25 #include "FwSmConstants.h"
26 #include "CrFwUserConstants.h"
27 
29 #define CRFW_UNUSED(x) (void)(x);
30 
32 typedef int CrFwBool_t;
33 
35 typedef unsigned short CrFwCmdRepIndex_t;
36 
38 typedef unsigned char* CrFwPckt_t;
39 
41 typedef enum {
43  crCmdType = 1,
47 
63 typedef void (*CrFwInRepUpdateAction_t)(FwPrDesc_t);
64 
90 typedef CrFwBool_t (*CrFwInRepValidityCheck_t)(FwPrDesc_t);
91 
117 typedef CrFwBool_t (*CrFwInCmdValidityCheck_t)(FwPrDesc_t);
118 
127 typedef CrFwBool_t (*CrFwInCmdReadyCheck_t)(FwSmDesc_t);
128 
143 typedef void (*CrFwInCmdStartAction_t)(FwSmDesc_t);
144 
168 typedef void (*CrFwInCmdProgressAction_t)(FwSmDesc_t);
169 
184 typedef void (*CrFwInCmdTerminationAction_t)(FwSmDesc_t);
185 
193 typedef void (*CrFwInCmdAbortAction_t)(FwSmDesc_t);
194 
203 typedef CrFwBool_t (*CrFwOutCmpEnableCheck_t)(FwSmDesc_t);
204 
213 typedef CrFwBool_t (*CrFwOutCmpReadyCheck_t)(FwSmDesc_t);
214 
223 typedef CrFwBool_t (*CrFwOutCmpRepeatCheck_t)(FwSmDesc_t);
224 
234 typedef void (*CrFwOutCmpUpdate_t)(FwSmDesc_t);
235 
244 typedef void (*CrFwOutCmpSerialize_t)(FwSmDesc_t);
245 
262 
274 
289 
302 };
303 
306 
312 typedef struct {
324 
330 typedef struct {
350 
356 typedef struct {
378 
386 typedef struct {
407  unsigned char* isDiscriminantEnabled;
409 
411 typedef struct InManagerData {
413  FwSmDesc_t* pcrl;
426 
428 typedef struct OutManagerData {
430  FwSmDesc_t* pocl;
443 
445 typedef struct InLoaderData {
447  FwSmDesc_t inStream;
449 
451 typedef struct InStreamData {
455  struct CrFwPcktQueue pcktQueue;
465 
467 typedef struct OutStreamData {
471  struct CrFwPcktQueue pcktQueue;
479 
481 typedef struct InCmdData {
518 
520 typedef struct InRepData {
538 
540 typedef struct OutCmpData {
566 
568 #define CR_FW_OUTSTREAM_TYPE 1
569 
571 #define CR_FW_INSTREAM_TYPE 2
572 
574 #define CR_FW_OUTCMP_TYPE 3
575 
577 #define CR_FW_OUTREGISTRY_TYPE 4
578 
580 #define CR_FW_OUTFACTORY_TYPE 5
581 
583 #define CR_FW_OUTMANAGER_TYPE 6
584 
586 #define CR_FW_OUTLOADER_TYPE 7
587 
589 #define CR_FW_INFACTORY_TYPE 8
590 
592 #define CR_FW_INREPORT_TYPE 9
593 
595 #define CR_FW_INCOMMAND_TYPE 10
596 
598 #define CR_FW_INREGISTRY_TYPE 11
599 
601 #define CR_FW_INMANAGER_TYPE 12
602 
604 #define CR_FW_INLOADER_TYPE 13
605 
607 #define CR_FW_APP_TYPE 14
608 
609 /* -------------------------------------------------------------------------------------------------- */
610 
612 #define CR_FW_MAX_NOF_TRANS_CMDS 4
613 
615 #define CR_FW_BASE_STATE_CREATED 1
616 
618 #define CR_FW_BASE_STATE_INITIALIZED 2
619 
621 #define CR_FW_BASE_STATE_CONFIGURED 3
622 
624 #define CR_FW_BASE_TR_INIT 1
625 
627 #define CR_FW_BASE_TR_RESET 2
628 
630 #define CR_FW_BASE_TR_SHUTDOWN 3
631 
633 #define CR_FW_INCMD_STATE_ACCEPTED 1
634 
636 #define CR_FW_INCMD_STATE_PROGRESS 2
637 
639 #define CR_FW_INCMD_STATE_TERMINATED 3
640 
642 #define CR_FW_INCMD_STATE_ABORTED 4
643 
645 #define CR_FW_INCMD_TR_TERMINATE CR_FW_INCOMMAND_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+0
646 
648 #define CR_FW_INSTREAM_STATE_WAITING 1
649 
651 #define CR_FW_INSTREAM_STATE_PCKT_AVAIL 2
652 
654 #define CR_FW_INSTREAM_TR_GET_PCKT CR_FW_INSTREAM_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+0
655 
657 #define CR_FW_INSTREAM_TR_PACKET_AVAILABLE CR_FW_INSTREAM_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+1
658 
660 #define CR_FW_OUTCMP_STATE_LOADED 1
661 
663 #define CR_FW_OUTCMP_STATE_ABORTED 2
664 
666 #define CR_FW_OUTCMP_STATE_PENDING 3
667 
669 #define CR_FW_OUTCMP_STATE_TERMINATED 4
670 
672 #define CR_FW_OUTCMP_TR_TERMINATE CR_FW_OUTCMP_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+0
673 
675 #define CR_FW_OUTSTREAM_STATE_READY 1
676 
678 #define CR_FW_OUTSTREAM_STATE_BUFFERING 2
679 
681 #define CR_FW_OUTSTREAM_TR_SEND CR_FW_OUTSTREAM_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+0
682 
684 #define CR_FW_OUTSTREAM_TR_CONNECTION_AVAILABLE CR_FW_OUTSTREAM_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+1
685 
686 #endif /* CRFW_CONSTANTS_H_ */
CrFwOutCmpSerialize_t serialize
Function which implements the Serialization Operation for the out-going command or report...
void(* CrFwInCmdStartAction_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Start Action Operation for an InCommand.
unsigned char CrFwCounterU1_t
Type used for unsigned integers with a "short" range.
CrFwInFactoryPoolIndex_t factoryPoolIndex
Index of the position in the pool of pre-allocated InReports in the InFactory to which the InComponen...
CrFwPcktCollect_t collectPckt
Function which implements the Packet Collect Operation.
CrFwPcktLength_t pcktLength
The length of the packet attached to the OutComponent.
Type for the data describing an OutStream.
unsigned char CrFwOutFactoryPoolIndex_t
Type for the index in the pool of pre-allocated OutComponents in the OutFactory (see CrFwOutFactory...
CrFwBool_t(* CrFwInCmdReadyCheck_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Ready Check Operation for an InCommand.
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.
CrFwPckt_t * pckt
The list of packets in the PQ.
CrFwCounterU2_t nOfLoadedOutCmp
Number of successfully loaded OutComponents.
Report type.
Definition: CrFwConstants.h:45
struct InLoaderData CrFwInLoaderData_t
Type for the data describing an InLoader.
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.
CrFwTrackingIndex_t trackingIndex
Index through which an InReport is tracked by the InRegistry (see CrFwInRegistry.h) ...
unsigned char CrFwInFactoryPoolIndex_t
Type for the index in the pool of pre-allocated incoming components in the InFactory (see CrFwInFacto...
CrFwBool_t isServTypeEnabled
Number of discriminant values for this [type, sub-type] pair in the next row.
CrFwPckt_t pckt
The packet to be sent out.
struct InCmdData CrFwInCmdData_t
Type for the data describing an InCommand.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:38
CrFwDiscriminant_t discriminant
The discriminant value (or zero if no discriminant for this type/sub-type)
CrFwServType_t servType
The service type.
struct OutManagerData CrFwOutManagerData_t
Type for the data describing an OutManager.
struct OutCmpData CrFwOutCmpData_t
Type for the data describing an OutComponent.
CrFwPckt_t(* CrFwPcktCollect_t)(CrFwDestSrc_t)
Type for a pointer to a function implementing the Packet Collect Operation of an InStream.
CrFwSeqCnt_t * seqCnt
Array holding sequence counters for the groups associated to the OutStream.
unsigned short CrFwCmdRepIndex_t
Type for the index of a command or report in the InRegistry or OutRegistry.
Definition: CrFwConstants.h:35
Type for the data describing an OutComponent.
CrFwPckt_t pckt
Packet holding the InCommand.
CrFwBool_t(* CrFwInCmdValidityCheck_t)(FwPrDesc_t)
Type for a pointer to a function implementing the Validity Check Operation for an InCommand...
CrFwCmdRepType_t
Enumerated type for command and reports.
Definition: CrFwConstants.h:41
FwSmDesc_t * pcrl
Pending Command/Report List (PCRL) for the InManager.
CrFwServType_t servType
The service type.
Type for the data describing an InReport.
CrFwPckt_t pckt
Packet to which the out-going command or report is serialized.
Type for the data describing an InStream.
CrFwOutCmpEnableCheck_t isEnabled
Function which implements the Enable Check for the out-going command or report.
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").
Definition: CrFwConstants.h:32
CrFwBool_t(* CrFwPcktAvailCheck_t)(CrFwDestSrc_t)
Type for a pointer to a function implementing the Packet Available Check Operation of an InStream...
InCommand kind descriptor type.
CrFwSeqCnt_t * seqCnt
Array holding sequence counters for the groups associated to the InStream.
CrFwPckt_t pckt
Packet holding the InReport.
Descriptor for a Packet Queue (PQ) in an OutStream or InStream.
Type for the data describing an InManager.
void(* CrFwOutCmpUpdate_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Update Operation for an OutComponent.
CrFwCounterU1_t nOfOutCmpInPocl
Number of OutComponents currently in POCL.
CrFwPcktHandover_t handoverPckt
Function which hands over a packet from the OutStream to the middleware.
unsigned short CrFwDiscriminant_t
Type used for the discriminant of a command or report.
CrFwCounterU1_t nOfInCmpInPcrl
Number of InReports and InCommands currently in PCRL.
FwSmDesc_t inStream
InStream from which packets are to be retrieved in the next execution cycle.
unsigned char CrFwDestSrc_t
Type used for the command or report destination and source.
CrFwInCmdAbortAction_t abortAction
The pointer to the function implementing the Abort Action Operation.
Command type.
Definition: CrFwConstants.h:43
CrFwServType_t servType
The service type.
CrFwPcktAvailCheck_t isPcktAvail
Function which implements the Packet Available Check Operation.
Type for the data describing an InLoader.
CrFwOutCmpRepeatCheck_t isRepeat
Function which implements the Repeat Check for the out-going command or report.
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.
CrFwDestSrc_t src
Source associated to the InStream.
CrFwBool_t isEmpty
Flag indicating whether the PQ is empty.
OutComponent kind descriptor type.
CrFwInRepUpdateAction_t updateAction
Function which implements the Update Action for the InReport.
CrFwExecStepId_t nOfProgressFailure
Number of progress steps which failed.
CrFwOutCmpUpdate_t update
The pointer to the function implementing the Update Operation.
CrFwTrackingIndex_t trackingIndex
Index through which an out-going command or report is tracked by the OutRegistry (see CrFwOutRegistry...
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.
unsigned short CrFwExecStepId_t
Type for the counter of execution progress steps.
CrFwCmdRepIndex_t index
Index of out-going command or report (see CrFwOutRegistry.h)
CrFwInCmdStartAction_t startAction
The pointer to the function implementing the Start Action Operation.
CrFwBool_t isProgressActionCompleted
Flag indicating whether the progress action has been completed.
CrFwTrackingIndex_t trackingIndex
Index through which an InCommand is tracked by the InRegistry (see CrFwInRegistry.h)
void(* CrFwInCmdProgressAction_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Progress Action Operation for an InCommand...
CrFwBool_t(* CrFwOutCmpRepeatCheck_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Repeat Check Operation for an OutComponent.
InReport kind descriptor type.
unsigned short CrFwProgressStepId_t
Type for the Progress Step Identifier of an InCommand.
CrFwCounterU1_t size
The size of the PQ (the same as the size of the pckt array)
CrFwServType_t servType
The service type.
unsigned char * isDiscriminantEnabled
The enable state for the discriminants in the range [lowerBoundDisc,lowerBoundDisc].
CrFwOutCmpEnableCheck_t isEnabled
The pointer to the function implementing the Enable Check Operation.
CrFwDiscriminant_t lowerBoundDisc
The lower bound of a range of discriminant values (or zero if no discriminant for this type/sub-type)...
CrFwProgressStepId_t progressStepId
The progress step identifier.
CrFwServSubType_t servSubType
The service sub-type.
FwSmDesc_t * pocl
Pending OutComponent List (POCL) for the OutManager.
CrFwBool_t isServSubTypeEnabled
The enable state for the service sub-type (see CrFwOutRegistry.h)
CrFwPckt_t pckt
The last packet to have been collected from the middleware.
CrFwBool_t(* CrFwInRepValidityCheck_t)(FwPrDesc_t)
Type for a pointer to a function implementing the Validity Check Operation for an InReport...
Definition: CrFwConstants.h:90
CrFwBool_t(* CrFwOutCmpEnableCheck_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Enable Check Operation for an OutComponent.
CrFwInCmdAbortAction_t abortAction
Function which implements the Abort Action for the InCommand.
CrFwInCmdValidityCheck_t isValid
Function which implements the Configuration Check for the InCommand.
CrFwOutCmpReadyCheck_t isReady
Function which implements the Ready Check for the out-going command or report.
Header file to define all user-configurable constants and types for the CORDET Framework (the non-con...
struct InManagerData CrFwInManagerData_t
Type for the data describing an InManager.
CrFwOutCmpReadyCheck_t isReady
The pointer to the function implementing the Ready Check Operation.
CrFwInCmdStartAction_t startAction
Function which implements the Start Action for the InCommand.
unsigned short int CrFwPcktLength_t
Type for the packet length.
CrFwDiscriminant_t discriminant
The discriminant value (or zero if no discriminant for this type/sub-type)
CrFwBool_t(* CrFwOutCmpReadyCheck_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Ready Check Operation for an OutComponent.
CrFwCounterU1_t nextFreePoclPos
Next free position in the POCL.
CrFwDestSrc_t dest
Destination associated to the OutStream.
CrFwDiscriminant_t upperBoundDisc
The upper bound of a range of discriminant values (or zero if no discriminant for this type/sub-type)...
CrFwCounterU1_t oldestItem
The index of the oldest item in the PQ.
CrFwCounterU2_t nOfLoadedInCmp
Number of successfully loaded InReports and InCommands.
CrFwBool_t(* CrFwPcktHandover_t)(CrFwPckt_t pckt)
Type for a pointer to a function implementing the Packet Hand-Over Operation of an OutStream...
Type for the data describing an InCommand.
CrFwInCmdProgressAction_t progressAction
Function which implements the Progress Action for the InCommand.
struct OutStreamData CrFwOutStreamData_t
Type for the data describing an OutStream.
CrFwCmdRepType_t cmdRepType
The command/report type of the out-going command or report.
CrFwOutCmpUpdate_t update
Function which implements the Update Operation for the out-going command or report.
void(* CrFwOutCmpSerialize_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Serialize Operation for an OutComponent.
struct CrFwPcktQueue * CrFwPcktQueue_t
Type used in the framework to represent a packet queue.
void(* CrFwInRepUpdateAction_t)(FwPrDesc_t)
Type for a pointer to a function implementing the Update Action Operation for an InReport.
Definition: CrFwConstants.h:63
CrFwInCmdTerminationAction_t terminationAction
Function which implements the Termination Action for the InCommand.
CrFwServSubType_t servSubType
The service sub-type.
unsigned short CrFwTrackingIndex_t
Type for the index used to track the state of a component.
CrFwInRepValidityCheck_t isValid
Function which implements the Validity Check for the InReport.
CrFwServSubType_t servSubType
The service sub-type.
CrFwOutCmpSerialize_t serialize
The pointer to the function implementing the Serialize Operation.
CrFwCounterU1_t nextFreeItem
Index of the next free slot in the PQ.
unsigned char CrFwServType_t
Type used for the service type of a command or report.
void(* CrFwInCmdAbortAction_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Abort Action Operation for an InCommand.
CrFwOutFactoryPoolIndex_t factoryPoolIndex
Index of the position in the pool of pre-allocated OutComponents in the OutFactory to which the OutCo...
struct InRepData CrFwInRepData_t
Type for the data describing an InReport.
Service descriptor type.
unsigned int CrFwSeqCnt_t
Type used for the sequence counter of commands or reports.
CrFwOutCmpRepeatCheck_t isRepeat
The pointer to the function implementing the Ready Check Operation.
CrFwInFactoryPoolIndex_t factoryPoolIndex
Index of the position in the pool of pre-allocated InCommands in the InFactory to which the InCompone...
unsigned char CrFwServSubType_t
Type used for the command or report sub-type.
CrFwDiscriminant_t discriminant
The discriminant value (or zero if no discriminant for this type/sub-type)
void(* CrFwInCmdTerminationAction_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Termination Action Operation for an InCommand...
Type for the data describing an OutManager.
CrFwInRepUpdateAction_t updateAction
The pointer to the function implementing the Update Action Operation.
struct InStreamData CrFwInStreamData_t
Type for the data describing an InStream.
CrFwCounterU1_t nextFreePcrlPos
Next free position in the PCRL.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved