CORDET Framework - C2 Implementation
pustests/CrFwOutStreamStub.c
1 
24 #include <stdlib.h>
25 #include "CrFwOutStreamStub.h"
26 #include "CrFwRepErrStub.h"
27 /* Include configuration files */
28 #include "CrFwOutStreamUserPar.h"
29 #include "CrFwCmpData.h"
30 /* Include FW Profile files */
31 #include "FwSmConstants.h"
32 #include "FwSmConfig.h"
33 #include "FwSmCore.h"
34 #include "FwPrConfig.h"
35 #include "FwPrCore.h"
36 #include "FwPrConstants.h"
37 /* Include framework files */
39 #include "BaseCmp/CrFwBaseCmp.h"
41 #include "Pckt/CrFwPckt.h"
42 #include "CrFwTime.h"
43 #include "CrFwRepErr.h"
44 
47 
49 static CrFwBool_t pcktHandOverFlag = 1;
50 
52 static CrFwBool_t checkFlag = 1;
53 
55 static CrFwBool_t actionFlag = 1;
56 
58 static CrFwCounterU1_t shutdownCnt = 0;
59 
60 /* ---------------------------------------------------------------------------------------------*/
62  (void)(pckt);
64  return pcktHandOverFlag;
65 }
66 
67 /* ---------------------------------------------------------------------------------------------*/
69  return pcktHandOverCnt;
70 }
71 
72 /* ---------------------------------------------------------------------------------------------*/
74  return shutdownCnt;
75 }
76 
77 /* ---------------------------------------------------------------------------------------------*/
79  pcktHandOverFlag = flag;
80 }
81 
82 /* ---------------------------------------------------------------------------------------------*/
83 void CrFwOutStreamStubDummyCheck(FwPrDesc_t prDesc) {
84  CrFwCmpData_t* outStreamData = (CrFwCmpData_t*)FwPrGetData(prDesc);
85  outStreamData->outcome = (CrFwOutcome_t)checkFlag;
86 }
87 
88 /* ---------------------------------------------------------------------------------------------*/
90  checkFlag = flag;
91 }
92 
93 /* ---------------------------------------------------------------------------------------------*/
94 void CrFwOutStreamStubInitAction(FwPrDesc_t prDesc) {
95  CrFwCmpData_t* outStreamBaseData = (CrFwCmpData_t*)FwPrGetData(prDesc);
96  CrFwOutStreamData_t* cmpSpecificData = (CrFwOutStreamData_t*)outStreamBaseData->cmpSpecificData;
97  if (cmpSpecificData->seqCnt == NULL)
99  outStreamBaseData->outcome = (CrFwOutcome_t)actionFlag;
100 }
101 
102 /* ---------------------------------------------------------------------------------------------*/
103 void CrFwOutStreamStubConfigAction(FwPrDesc_t prDesc) {
104  CrFwCmpData_t* outStreamData = (CrFwCmpData_t*)FwPrGetData(prDesc);
106  outStreamData->outcome = (CrFwOutcome_t)actionFlag;
107 }
108 
109 /* ---------------------------------------------------------------------------------------------*/
111  actionFlag = flag;
112 }
113 
114 /* ---------------------------------------------------------------------------------------------*/
115 void CrFwOutStreamStubShutdown(FwSmDesc_t smDesc) {
116  shutdownCnt++;
118  }
119 
120 void abc1(){
121  shutdownCnt++;
122 }
void CrFwOutStreamDefConfigAction(FwPrDesc_t prDesc)
Default configuration action for an OutStream.
Type for the Framework Component Data (FCD).
Interface through which framework components access the current time.
CrFwOutcome_t outcome
The outcome of an action or check executed by a state machine or by one of its procedures.
void CrFwOutStreamStubInitAction(FwPrDesc_t prDesc)
Dummy implementation of a configuration action for an OutStream.
Type for the data describing an OutStream.
CrFwSeqCnt_t * seqCnt
Array holding sequence counters for the groups associated to the OutStream.
Definition of the OutStream component.
Interface for creating and accessing a report or command packet.
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
Definition: CrFwConstants.h:30
static CrFwBool_t pcktHandOverFlag
Return value of the packet hand-over operation.
Interface for reporting an error detected by a framework component.
void CrFwOutStreamStubSetCheckFlag(CrFwBool_t flag)
Set the value of the check flag which determines the outcome of the dummy check of CrFwOutStreamStubD...
void CrFwOutStreamStubDummyCheck(FwPrDesc_t prDesc)
Dummy implementation of an initialization or configuration check for an OutStream.
CrFwCounterU1_t CrFwOutStreamStubGetHandoverCnt()
Return the value of the handover counter which is incremented by the packet handover function in CrFw...
static CrFwCounterU1_t pcktHandOverCnt
Counter incremented every time the packet hand-over operation is called.
void * cmpSpecificData
Derived data which are specific to each type of framework component.
CrFwCounterU1_t CrFwOutStreamStubGetShutdownCnt()
Return the value of the shutdown counter which is incremented by the packet shutdown function in CrFw...
Definition of the utility functions for the CORDET Framework.
void CrFwOutStreamStubConfigAction(FwPrDesc_t prDesc)
Dummy implementation of a configuration action for an OutStream.
void CrFwOutStreamDefShutdownAction(FwSmDesc_t smDesc)
Default shutdown action for an OutStream.
void CrFwOutStreamDefInitAction(FwPrDesc_t prDesc)
Default initialization action for an OutStream.
static CrFwBool_t actionFlag
Outcome of dummy action.
unsigned char CrFwOutcome_t
Type used for the outcome of a check (see CrFwCmpData).
Definition of Base Component.
static CrFwCmpData_t outStreamData[CR_FW_NOF_OUTSTREAM]
The base data structures for the OutStream State Machines and their Procedures.
Definition: CrFwOutStream.c:80
char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:36
void CrFwOutStreamStubSetActionFlag(CrFwBool_t flag)
Set the value of the action flag which determines the outcome of the initialization of configuration ...
CrFwBool_t CrFwOutStreamStubPcktHandover(CrFwPckt_t pckt)
Stub function implementing the hand-over operation for the OutStream.
unsigned char CrFwCounterU1_t
Type used for unsigned integers with a "short" range.
static CrFwBool_t checkFlag
Outcome of dummy check.
void CrFwOutStreamStubSetHandoverFlag(CrFwBool_t flag)
Set the value of the handover flag which determines the outcome of the packet handover in CrFwOutStre...
static CrFwCounterU1_t shutdownCnt
Counter incremented by stub Shutdown Operation.
void CrFwOutStreamStubShutdown(FwSmDesc_t smDesc)
Stub function implementing the shutdown operation for an OutStream.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved