CORDET Framework - C2 Implementation
CrPsEvtRepDisabledCmd.c
Go to the documentation of this file.
1 
23 #include "CrPsEvtRepDisabledCmd.h"
24 
25 /* CrFramework includes */
26 #include <Pckt/CrFwPckt.h>
28 #include <OutCmp/CrFwOutCmp.h>
30 #include <CrFwCmpData.h>
31 
32 /* FwProfile includes */
33 #include "FwSmConstants.h"
34 #include "FwSmConfig.h"
35 #include "FwSmCore.h"
36 #include "FwPrDCreate.h"
37 #include "FwPrConfig.h"
38 #include "FwPrCore.h"
39 #include "FwPrConstants.h"
40 
41 /* Used for CrPsRepErr() -> OutFactoryFail */
42 #include <CrPsRepErr.h>
43 
47 
48 static FwSmDesc_t rep;
49 
50 
59 void CrPsEvtRepDisabledCmdStartAction(FwSmDesc_t smDesc)
60 {
61  CrFwCmpData_t *cmpData;
62 
63  /* Get cmp data */
64  cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
65 
67 
68  if (rep != NULL)
69  {
70  cmpData->outcome = 1;
71  }
72  else
73  {
74  /* TM(5,8) OUTFACTORY_FAIL */
76 
77  cmpData->outcome = 0;
78  }
79 
80  return ;
81 }
82 
90 void CrPsEvtRepDisabledCmdProgressAction(FwSmDesc_t smDesc)
91 {
92  CrFwCmpData_t* inData;
93  CrFwInCmdData_t* inSpecificData;
94  CrFwPckt_t inPckt;
95  CrFwDestSrc_t source;
96 
97  /* Get in packet */
98  inData = (CrFwCmpData_t*)FwSmGetData(smDesc);
99  inSpecificData = (CrFwInCmdData_t*)inData->cmpSpecificData;
100  inPckt = inSpecificData->pckt;
101 
102  /* Set out component parameters */
103  source = CrFwPcktGetSrc(inPckt);
104  CrFwOutCmpSetDest(rep, source);
105 
106  /* load the report in the OutLoader */
108 
109  inData->outcome = 1;
110 
111  return;
112 }
113 
120 {
121  CrFwCmpData_t *inData;
122 
123  /* Set action outcome to 'success' */
124 
125  /* Get in data */
126  inData = (CrFwCmpData_t*)FwSmGetData(smDesc);
127 
128  inData->outcome = 1;
129  return ;
130 }
131 
Type for the Framework Component Data (FCD).
CrFwOutcome_t outcome
The outcome of an action or check executed by a state machine or by one of its procedures.
CrFwDestSrc_t CrFwPcktGetSrc(CrFwPckt_t pckt)
Return the source of the command or report encapsulated in a packet.
void CrPsEvtRepDisabledCmdTerminationAction(FwSmDesc_t smDesc)
Termination action of TC(5,7) EvtRepDisabledCmd.
Implementation of TC(5,7) EvtRepDisabledCmd.
FwSmDesc_t rep
CrPsCmd3s9Prgr function definitions.
Definition of the OutFactory component.
CrFwPckt_t pckt
Packet holding the InCommand.
unsigned char CrFwDestSrc_t
Type used for the command or report destination and source.
Header file to define all service and packet identifiers.
Interface for creating and accessing a report or command packet.
size_t getEvtRepDisabledSize()
Get the size of a Disabled Event Reporting packet.
void CrFwOutLoaderLoad(FwSmDesc_t outCmp)
Load an OutComponent into its OutManager.
#define CRPS_EVT_REPDISABLED_REP
Subtype identifier of the Event Report Report Disabled out-going report packet.
The Outfactory failed to make the component (see CrPsRepErr.h)
void CrPsEvtRepDisabledCmdStartAction(FwSmDesc_t smDesc)
Start action of TC(5,7) EvtRepDisabledCmd.
void * cmpSpecificData
Derived data which are specific to each type of framework component.
void CrPsEvtRepDisabledCmdProgressAction(FwSmDesc_t smDesc)
Progress action of TC(5,7) EvtRepDisabledCmd.
Interface for accessing fields in packets of service "ServEvt".
void CrPsRepErr(CrPsRepErrCode_t errCode, CrFwServType_t repType, CrFwServSubType_t repSubType, CrFwDiscriminant_t repDiscriminant)
Report an error which has no parameters attached to it.
Definition: CrPsRepErr.c:37
Interface for reporting an error detected by a PUS Extension component.
char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:36
Definition of the OutComponent Component of the framework.
void CrFwOutCmpSetDest(FwSmDesc_t smDesc, CrFwDestSrc_t dest)
Set the destination of the OutComponent.
Definition: CrFwOutCmp.c:192
Type for the data describing an InCommand.
auxiliary Interface for accessing fields in packets of service "ServEvt".
Definition of the OutLoader component.
FwSmDesc_t CrFwOutFactoryMakeOutCmp(CrFwServType_t type, CrFwServSubType_t subType, CrFwDiscriminant_t discriminant, CrFwPcktLength_t length)
Make function for an OutComponent.
#define CRPS_EVT
Type identifier of the Event Reporting Service.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved