CORDET Framework - C2 Implementation
CrPsTestAreYouAliveConnection.c
Go to the documentation of this file.
1 
22 
23 /* CrFramework includes */
24 #include <Pckt/CrFwPckt.h>
26 #include <OutCmp/CrFwOutCmp.h>
28 #include <CrFwCmpData.h>
29 
30 /* FwProfile includes */
31 #include <FwSmConfig.h>
32 
33 #include <CrPsUtilitiesServTest.h>
35 
36 /* Used for CrPsRepErr() -> OutFactoryFail */
37 #include <CrPsRepErr.h>
38 
39 static FwSmDesc_t rep;
40 
41 
43 {
44  CrFwCmpData_t* inData;
45 
46  /* Retrieve (17,2) report from OutFactory and set action outcome
47  to \success' if retrieval succeeds. If the retrieval fails, generate
48  error report OUTFACTORY FAILED and set outcome of Start
49  Action to 'failed' */
50 
51  /* Get in data */
52  inData = (CrFwCmpData_t*)FwSmGetData(smDesc);
53 
54  /* Create out component */
56 
57  if (rep != NULL)
58  {
59  inData->outcome = 1;
60  }
61  else
62  {
63  /* TM(17,2) OUTFACTORY_FAIL */
65 
66  inData->outcome = 0;
67  }
68 
69  return;
70 }
71 
72 /* ------------------------------------------------------------------------------------ */
74 {
75  CrFwCmpData_t* inData;
76  CrFwInCmdData_t* inSpecificData;
77  CrFwPckt_t inPckt;
78  CrFwDestSrc_t source;
79 
80  /* Configure the (17,2) report with a destination equal to the
81  source of the (17,1) command, load it in the OutLoader, and
82  set action outcome to 'completed' */
83 
84  /* Get in packet */
85  inData = (CrFwCmpData_t*)FwSmGetData(smDesc);
86  inSpecificData = (CrFwInCmdData_t*)inData->cmpSpecificData;
87  inPckt = inSpecificData->pckt;
88 
89  /* Set out component parameters */
90  source = CrFwPcktGetSrc(inPckt);
91  CrFwOutCmpSetDest(rep, source);
92 
93  /* load the report in the OutLoader */
95 
96  inData->outcome = 1;
97 
98  return;
99 }
100 
101 /* ------------------------------------------------------------------------------------ */
103 {
104  CrFwCmpData_t* inData;
105 
106  /* Set action outcome to 'success' */
107 
108  /* Get in data */
109  inData = (CrFwCmpData_t*)FwSmGetData(smDesc);
110 
111  inData->outcome = 1;
112 
113  return;
114 }
115 
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.
void CrPsTestAreYouAliveConnectionStartAction(FwSmDesc_t smDesc)
Start action of the Perform Connection Test in-coming command packet.
CrFwDestSrc_t CrFwPcktGetSrc(CrFwPckt_t pckt)
Return the source of the command or report encapsulated in a packet.
void CrPsTestAreYouAliveConnectionProgressAction(FwSmDesc_t smDesc)
Progress action of the Perform Connection Test in-coming command packet.
#define CRPS_TEST_AREYOUALIVE_CONNECTION_REP
Subtype identifier of the Test AreYouAlive Connection out-going report packet.
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.
void CrPsTestAreYouAliveConnectionTerminationAction(FwSmDesc_t smDesc)
Termination Action of the Perform Connection Test in-coming command packet.
#define CRPS_TEST
Type identifier of the Test Service.
void CrFwOutLoaderLoad(FwSmDesc_t outCmp)
Load an OutComponent into its OutManager.
The Outfactory failed to make the component (see CrPsRepErr.h)
void * cmpSpecificData
Derived data which are specific to each type of framework component.
Interface through which applications can initialize and execute framework PUS extension components...
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.
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.
Declaration of the Perform Connection Test in-coming command packet.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved