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,
45  crRepType = 2
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 
267 
284 
299 
324 typedef void (*CrFwSetDst_t)(CrFwCounterU2_t* nofTypeCounter,
325  CrFwDestTypeKey_t** destTypeKey);
326 
339 };
340 
343 
349 typedef struct {
361 
367 typedef struct {
387 
393 typedef struct {
415 
423 typedef struct {
444  unsigned char* isDiscriminantEnabled;
446 
448 typedef struct InManagerData {
450  FwSmDesc_t* pcrl;
463 
465 typedef struct OutManagerData {
467  FwSmDesc_t* pocl;
480 
482 typedef struct InLoaderData {
484  FwSmDesc_t inStream;
486 
488 typedef struct InStreamData {
490  struct CrFwPcktQueue pcktQueue;
498 
500 typedef struct OutStreamData {
502  struct CrFwPcktQueue pcktQueue;
508 
510 typedef struct InCmdData {
547 
549 typedef struct InRepData {
567 
569 typedef struct OutCmpData {
595 
597 #define CR_FW_OUTSTREAM_TYPE 1
598 
600 #define CR_FW_INSTREAM_TYPE 2
601 
603 #define CR_FW_OUTCMP_TYPE 3
604 
606 #define CR_FW_OUTREGISTRY_TYPE 4
607 
609 #define CR_FW_OUTFACTORY_TYPE 5
610 
612 #define CR_FW_OUTMANAGER_TYPE 6
613 
615 #define CR_FW_OUTLOADER_TYPE 7
616 
618 #define CR_FW_INFACTORY_TYPE 8
619 
621 #define CR_FW_INREPORT_TYPE 9
622 
624 #define CR_FW_INCOMMAND_TYPE 10
625 
627 #define CR_FW_INREGISTRY_TYPE 11
628 
630 #define CR_FW_INMANAGER_TYPE 12
631 
633 #define CR_FW_INLOADER_TYPE 13
634 
636 #define CR_FW_APP_TYPE 14
637 
638 /* -------------------------------------------------------------------------------------------------- */
639 
641 #define CR_FW_MAX_NOF_TRANS_CMDS 4
642 
644 #define CR_FW_BASE_STATE_CREATED 1
645 
647 #define CR_FW_BASE_STATE_INITIALIZED 2
648 
650 #define CR_FW_BASE_STATE_CONFIGURED 3
651 
653 #define CR_FW_BASE_TR_INIT 1
654 
656 #define CR_FW_BASE_TR_RESET 2
657 
659 #define CR_FW_BASE_TR_SHUTDOWN 3
660 
662 #define CR_FW_INCMD_STATE_ACCEPTED 1
663 
665 #define CR_FW_INCMD_STATE_PROGRESS 2
666 
668 #define CR_FW_INCMD_STATE_TERMINATED 3
669 
671 #define CR_FW_INCMD_STATE_ABORTED 4
672 
674 #define CR_FW_INCMD_TR_TERMINATE CR_FW_INCOMMAND_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+0
675 
677 #define CR_FW_INSTREAM_STATE_WAITING 1
678 
680 #define CR_FW_INSTREAM_STATE_PCKT_AVAIL 2
681 
683 #define CR_FW_INSTREAM_TR_GET_PCKT CR_FW_INSTREAM_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+0
684 
686 #define CR_FW_INSTREAM_TR_PACKET_AVAILABLE CR_FW_INSTREAM_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+1
687 
689 #define CR_FW_OUTCMP_STATE_LOADED 1
690 
692 #define CR_FW_OUTCMP_STATE_ABORTED 2
693 
695 #define CR_FW_OUTCMP_STATE_PENDING 3
696 
698 #define CR_FW_OUTCMP_STATE_TERMINATED 4
699 
701 #define CR_FW_OUTCMP_TR_TERMINATE CR_FW_OUTCMP_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+0
702 
704 #define CR_FW_OUTSTREAM_STATE_READY 1
705 
707 #define CR_FW_OUTSTREAM_STATE_BUFFERING 2
708 
710 #define CR_FW_OUTSTREAM_TR_SEND CR_FW_OUTSTREAM_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+0
711 
713 #define CR_FW_OUTSTREAM_TR_CONNECTION_AVAILABLE CR_FW_OUTSTREAM_TYPE*CR_FW_MAX_NOF_TRANS_CMDS+1
714 
715 #endif /* CRFW_CONSTANTS_H_ */
void(* CrFwInCmdAbortAction_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Abort Action Operation for an InCommand.
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
unsigned short CrFwCmdRepIndex_t
Type for the index of a command or report in the InRegistry or OutRegistry.
Definition: CrFwConstants.h:35
struct InManagerData CrFwInManagerData_t
Type for the data describing an InManager.
CrFwPckt_t(* CrFwPcktCollect_t)(CrFwDestSrc_t, CrFwDestSrc_t *)
Type for a pointer to a function implementing the Packet Collect Operation of an InStream.
CrFwCmdRepType_t
Enumerated type for command and reports.
Definition: CrFwConstants.h:41
@ crRepType
Report type.
Definition: CrFwConstants.h:45
@ crCmdType
Command type.
Definition: CrFwConstants.h:43
CrFwBool_t(* CrFwInCmdValidityCheck_t)(FwPrDesc_t)
Type for a pointer to a function implementing the Validity Check Operation for an InCommand.
CrFwBool_t(* CrFwOutCmpEnableCheck_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Enable Check Operation for an OutComponent.
struct InRepData CrFwInRepData_t
Type for the data describing an InReport.
CrFwBool_t(* CrFwInCmdReadyCheck_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Ready Check Operation for an InCommand.
struct OutStreamData CrFwOutStreamData_t
Type for the data describing an OutStream.
struct OutCmpData CrFwOutCmpData_t
Type for the data describing an OutComponent.
void(* CrFwSetDst_t)(CrFwCounterU2_t *nofTypeCounter, CrFwDestTypeKey_t **destTypeKey)
Type for a pointer to a function implement the Set DTS operation of an OutStream.
void(* CrFwOutCmpUpdate_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Update Operation for an OutComponent.
struct InStreamData CrFwInStreamData_t
Type for the data describing an InStream.
void(* CrFwInCmdTerminationAction_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Termination 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.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:38
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, CrFwDestSrc_t *)
Type for a pointer to a function implementing the Packet Available Check Operation of an InStream.
void(* CrFwInRepUpdateAction_t)(FwPrDesc_t)
Type for a pointer to a function implementing the Update Action Operation for an InReport.
Definition: CrFwConstants.h:63
CrFwBool_t(* CrFwOutCmpReadyCheck_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Ready Check Operation for an OutComponent.
void(* CrFwInCmdProgressAction_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Progress Action Operation for an InCommand.
void(* CrFwOutCmpSerialize_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Serialize Operation for an OutComponent.
CrFwBool_t(* CrFwPcktHandover_t)(CrFwPckt_t pckt)
Type for a pointer to a function implementing the Packet Hand-Over Operation of an OutStream.
struct OutManagerData CrFwOutManagerData_t
Type for the data describing an OutManager.
struct CrFwPcktQueue * CrFwPcktQueue_t
Type used in the framework to represent a packet queue.
struct InCmdData CrFwInCmdData_t
Type for the data describing an InCommand.
void(* CrFwInCmdStartAction_t)(FwSmDesc_t)
Type for a pointer to a function implementing the Start Action Operation for an InCommand.
struct InLoaderData CrFwInLoaderData_t
Type for the data describing an InLoader.
Header file to define all user-configurable constants and types for the CORDET Framework (the non-con...
unsigned short CrFwProgressStepId_t
Type for the Progress Step Identifier of an InCommand.
unsigned short CrFwExecStepId_t
Type for the counter of execution progress steps.
unsigned char CrFwServType_t
Type used for the service type of a command or report.
unsigned char CrFwInFactoryPoolIndex_t
Type for the index in the pool of pre-allocated incoming components in the InFactory (see CrFwInFacto...
unsigned char CrFwDestSrc_t
Type used for the command or report destination and source.
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 char CrFwCounterU1_t
Type used for unsigned integers with a "short" range.
unsigned short int CrFwPcktLength_t
Type for the packet length.
unsigned char CrFwOutFactoryPoolIndex_t
Type for the index in the pool of pre-allocated OutComponents in the OutFactory (see CrFwOutFactory....
unsigned int CrFwDestTypeKey_t
Type for the destination type key in CrFwOutStream.c.
unsigned short CrFwTrackingIndex_t
Type for the index used to track the state of a component.
unsigned char CrFwServSubType_t
Type used for the command or report sub-type.
InCommand kind descriptor type.
CrFwInCmdValidityCheck_t isValid
The pointer to the function implementing the Validity Check Operation.
CrFwDiscriminant_t discriminant
The discriminant value (or zero if no discriminant for this type/sub-type)
CrFwInCmdTerminationAction_t terminationAction
The pointer to the function implementing the Termination Action Operation.
CrFwInCmdAbortAction_t abortAction
The pointer to the function implementing the Abort Action Operation.
CrFwInCmdProgressAction_t progressAction
The pointer to the function implementing the Progress Action Operation.
CrFwInCmdReadyCheck_t isReady
The pointer to the function implementing the Ready Check Operation.
CrFwServType_t servType
The service type.
CrFwInCmdStartAction_t startAction
The pointer to the function implementing the Start Action Operation.
CrFwServSubType_t servSubType
The service sub-type.
InReport kind descriptor type.
CrFwDiscriminant_t discriminant
The discriminant value (or zero if no discriminant for this type/sub-type)
CrFwInRepUpdateAction_t updateAction
The pointer to the function implementing the Update Action Operation.
CrFwServType_t servType
The service type.
CrFwInRepValidityCheck_t isValid
The pointer to the function implementing the Validity Check Operation.
CrFwServSubType_t servSubType
The service sub-type.
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.
CrFwCmdRepType_t cmdRepType
The command/report type of the out-going command or report.
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.
Descriptor for a Packet Queue (PQ) in an OutStream or InStream.
CrFwCounterU1_t oldestItem
The index of the oldest item in the PQ.
CrFwPckt_t * pckt
The list of packets in the PQ.
CrFwCounterU1_t nextFreeItem
Index of the next free slot in the PQ.
CrFwCounterU1_t size
The size of the PQ (the same as the size of the pckt array)
CrFwBool_t isEmpty
Flag indicating whether the PQ is empty.
Service descriptor type.
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.
Type for the data describing an InCommand.
CrFwInCmdValidityCheck_t isValid
Function which implements the Configuration Check for the InCommand.
CrFwProgressStepId_t progressStepId
The progress step identifier.
CrFwTrackingIndex_t trackingIndex
Index through which an InCommand is tracked by the InRegistry (see CrFwInRegistry....
CrFwPckt_t pckt
Packet holding the InCommand.
CrFwExecStepId_t nOfProgressFailure
Number of progress steps which failed.
CrFwInFactoryPoolIndex_t factoryPoolIndex
Index of the position in the pool of pre-allocated InCommands in the InFactory to which the InCompone...
CrFwInCmdTerminationAction_t terminationAction
Function which implements the Termination Action for the InCommand.
CrFwInCmdAbortAction_t abortAction
Function which implements the Abort Action for the InCommand.
CrFwInCmdProgressAction_t progressAction
Function which implements the Progress Action for the InCommand.
CrFwInCmdReadyCheck_t isReady
Function which implements the Ready Check for the InCommand.
CrFwBool_t isProgressActionCompleted
Flag indicating whether the progress action has been completed.
CrFwInCmdStartAction_t startAction
Function which implements the Start Action for the InCommand.
Type for the data describing an InLoader.
FwSmDesc_t inStream
InStream from which packets are to be retrieved in the next execution cycle.
Type for the data describing an InManager.
CrFwCounterU1_t nextFreePcrlPos
Next free position in the PCRL.
CrFwCounterU2_t nOfLoadedInCmp
Number of successfully loaded InReports and InCommands
CrFwCounterU1_t nOfInCmpInPcrl
Number of InReports and InCommands currently in PCRL.
FwSmDesc_t * pcrl
Pending Command/Report List (PCRL) for the InManager.
Type for the data describing an InReport.
CrFwTrackingIndex_t trackingIndex
Index through which an InReport is tracked by the InRegistry (see CrFwInRegistry.h)
CrFwPckt_t pckt
Packet holding the InReport.
CrFwInFactoryPoolIndex_t factoryPoolIndex
Index of the position in the pool of pre-allocated InReports in the InFactory to which the InComponen...
CrFwInRepUpdateAction_t updateAction
Function which implements the Update Action for the InReport.
CrFwInRepValidityCheck_t isValid
Function which implements the Validity Check for the InReport.
Type for the data describing an InStream.
CrFwPckt_t pckt
The last packet to have been collected from the middleware.
CrFwPcktCollect_t collectPckt
Function which implements the Packet Collect Operation.
CrFwPcktAvailCheck_t isPcktAvail
Function which implements the Packet Available Check Operation.
struct CrFwPcktQueue pcktQueue
Packet queue associated to the InStream.
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...
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.
Type for the data describing an OutManager.
FwSmDesc_t * pocl
Pending OutComponent List (POCL) for the OutManager.
CrFwCounterU1_t nOfOutCmpInPocl
Number of OutComponents currently in POCL.
CrFwCounterU1_t nextFreePoclPos
Next free position in the POCL.
CrFwCounterU2_t nOfLoadedOutCmp
Number of successfully loaded OutComponents.
Type for the data describing an OutStream.
CrFwPckt_t pckt
The packet to be sent out.
CrFwPcktHandover_t handoverPckt
Function which hands over a packet from the OutStream to the middleware.
struct CrFwPcktQueue pcktQueue
Packet queue associated to the OutStream.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved