CORDET Framework - C2 Implementation
CrPsEvtDisableCmd.c
Go to the documentation of this file.
1 
23 #include <CrFwCmpData.h>
24 
25 #include <FwSmConfig.h>
26 #include "FwPrConfig.h"
27 #include "FwPrCore.h"
28 
30 
31 #include <CrPsUtilitiesServEvt.h>
32 #include <DataPool/CrPsDpServEvt.h>
34 #include "CrPsEvtDisableCmd.h"
35 
36 CrPsFlag_t evtFlag[EVT_N_EID];
37 
38 
45 void CrPsEvtDisableCmdStartAction(FwSmDesc_t smDesc)
46 {
47  prDescCmdEidStart_t prData;
48 
49  /* Set prData of procedure */
50  /* initial setting of prData */
51  prData.smDesc = smDesc;
52  prData.evtFlagPtr = evtFlag;
53  FwPrSetData(getPrDescEvtCmd5EidStart(), &prData);
54 
55  FwPrRun(getPrDescEvtCmd5EidStart());
56 
57  return ;
58 }
59 
68 void CrPsEvtDisableCmdProgressAction(FwSmDesc_t smDesc)
69 {
70  CrFwCounterU2_t evtSlot;
71  CrFwBool_t isEnabled;
72  uint8_t evtEidLevelArray[EVT_N_EID] = EVT_EID_LEVEL; /*TODO Which Type ??*/
73  uint8_t evtEidLevel;
74  CrPsFlag_t evtEidFlag;
75  CrPsNumberU2_t nmbDisEvtLevel;
76  CrFwCmpData_t *cmpData;
77 
78 
79  /* Get in data */
80  cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
81 
82  for (evtSlot = 0; evtSlot < EVT_N_EID; evtSlot++)
83  {
84  evtEidFlag = evtFlag[evtSlot];
85 
86  if (evtEidFlag == 1)
87  {
88  isEnabled = 0;
89  setDpisEidEnabledItem(evtSlot, isEnabled);
90 
91  /* Get the severity level */
92  evtEidLevel = evtEidLevelArray[evtSlot];
93 
94  switch (evtEidLevel)
95  {
97  nmbDisEvtLevel = getDpnOfDisabledEid_1();
98  nmbDisEvtLevel++;
99  setDpnOfDisabledEid_1(nmbDisEvtLevel);
100  break;
102  nmbDisEvtLevel = getDpnOfDisabledEid_2();
103  nmbDisEvtLevel++;
104  setDpnOfDisabledEid_2(nmbDisEvtLevel);
105  break;
107  nmbDisEvtLevel = getDpnOfDisabledEid_3();
108  nmbDisEvtLevel++;
109  setDpnOfDisabledEid_3(nmbDisEvtLevel);
110  break;
112  nmbDisEvtLevel = getDpnOfDisabledEid_4();
113  nmbDisEvtLevel++;
114  setDpnOfDisabledEid_4(nmbDisEvtLevel);
115  break;
116  default: /*TODO (01.02.2018) can not be reached, because in the EVT_EID_LEVEL should not be a other entry !? */
117  break;
118  }
119  }
120  }
121 
122  cmpData->outcome = 1;
123 
124  return ;
125 }
126 
132 void CrPsEvtDisableCmdTerminationAction(FwSmDesc_t smDesc)
133 {
134  CrFwCmpData_t *inData;
135 
136  /* Set action outcome to 'success' */
137 
138  /* Get in data */
139  inData = (CrFwCmpData_t*)FwSmGetData(smDesc);
140 
141  inData->outcome = 1;
142 
143  return ;
144 }
145 
void CrPsEvtDisableCmdProgressAction(FwSmDesc_t smDesc)
Progress action of TC(5,6) EvtDisableCmd.
Type for the Framework Component Data (FCD).
#define CRPS_EVT_SEVLEVEL4_REP
Subtype identifier of the Event Report Severity Level 4 out-going report packet.
CrFwOutcome_t outcome
The outcome of an action or check executed by a state machine or by one of its procedures.
#define EVT_N_EID
Number of event identifiers supported by the application.
#define CRPS_EVT_SEVLEVEL2_REP
Subtype identifier of the Event Report Severity Level 2 out-going report packet.
Create one instance of the CrPsCmd5EidStart procedure.
Interface for accessing data pool items.
static void setDpnOfDisabledEid_3(CrPsNumberU2_t nOfDisabledEid_3)
Sets the value of the datapool item nOfDisabledEid_3.
Header file to define all service and packet identifiers.
FwPrDesc_t getPrDescEvtCmd5EidStart()
Getter for EvtCmd5EidStart procedure descriptor.
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
Definition: CrFwConstants.h:30
static CrPsNumberU2_t getDpnOfDisabledEid_1()
Gets the value of the datapool item nOfDisabledEid_1.
static void setDpnOfDisabledEid_1(CrPsNumberU2_t nOfDisabledEid_1)
Sets the value of the datapool item nOfDisabledEid_1.
Implementation of TC(5,6) EvtDisableCmd.
static void setDpisEidEnabledItem(int i, CrPsFlag_t isEidEnabled)
Sets the value of the i-th element in the datapool array isEidEnabled.
Interface through which applications can initialize and execute framework PUS extension components...
static CrPsNumberU2_t getDpnOfDisabledEid_3()
Gets the value of the datapool item nOfDisabledEid_3.
void CrPsEvtDisableCmdStartAction(FwSmDesc_t smDesc)
Start action of TC(5,6) EvtDisableCmd.
static void setDpnOfDisabledEid_4(CrPsNumberU2_t nOfDisabledEid_4)
Sets the value of the datapool item nOfDisabledEid_4.
static CrPsNumberU2_t getDpnOfDisabledEid_2()
Gets the value of the datapool item nOfDisabledEid_2.
#define CRPS_EVT_SEVLEVEL1_REP
Subtype identifier of the Event Report Severity Level 1 out-going report packet.
static void setDpnOfDisabledEid_2(CrPsNumberU2_t nOfDisabledEid_2)
Sets the value of the datapool item nOfDisabledEid_2.
static CrPsNumberU2_t getDpnOfDisabledEid_4()
Gets the value of the datapool item nOfDisabledEid_4.
#define EVT_EID_LEVEL
Array of EVT N EID elements holding the severity level of the event identifiers.
#define CRPS_EVT_SEVLEVEL3_REP
Subtype identifier of the Event Report Severity Level 3 out-going report packet.
void CrPsEvtDisableCmdTerminationAction(FwSmDesc_t smDesc)
Termination action of TC(5,6) EvtDisableCmd.
unsigned short CrFwCounterU2_t
Type used for unsigned integers with a "medium" range.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved