CORDET Framework - C2 Implementation
CrPsLptAbortDownCmd.c
Go to the documentation of this file.
1 
24 #include "CrPsLptAbortDownCmd.h"
25 
26 #include <CrFwCmpData.h>
27 #include <FwSmConfig.h>
28 
29 #include <CrPsUtilitiesServLpt.h>
30 #include <CrPsUserConstants.h>
33 
34 
43 void CrPsLptAbortDownCmdStartAction(FwSmDesc_t smDesc)
44 {
45  CrFwCmpData_t *inData;
46  CrFwInCmdData_t *cmpSpecificData;
47  CrFwPckt_t inPckt;
48  CrPsTid_t Tid;
49  uint32_t LptBufferId;
50  uint16_t sm_state;
51 
52  CRFW_UNUSED(smDesc);
53 
54  /* Get inPckt */
55  inData = (CrFwCmpData_t*) FwSmGetData(smDesc);
56  cmpSpecificData = (CrFwInCmdData_t *) inData->cmpSpecificData;
57  inPckt = cmpSpecificData->pckt;
58 
59  /* Determine the identifier of the LPT Buffer */
60  Tid = getLptStartDownCmdTid(inPckt);
61  LptBufferId = Tid % LPT_N_BUF;
62 
63  /* Get in data */
64  inData = (CrFwCmpData_t*)FwSmGetData(smDesc);
65 
66  sm_state = FwSmGetCurState(getSmDescLpt());
67  if (sm_state == CrPsLpt_DOWN_TRANSFER)
68  {
69  inData->outcome = 1;
70  }
71  else
72  {
73  inData->outcome = 0;
74  }
75 
76  /*TODO*/
77  CRFW_UNUSED(LptBufferId);
78  return;
79 }
80 
86 void CrPsLptAbortDownCmdProgressAction(FwSmDesc_t smDesc)
87 {
88  CrFwCmpData_t *inData;
89 
90  CRFW_UNUSED(smDesc);
91 
92  FwSmMakeTrans(getSmDescLpt(), Abort);
93  /*TODO*/
94  /* Get in data */
95  inData = (CrFwCmpData_t*)FwSmGetData(smDesc);
96 
97  inData->outcome = 1;
98 
99  return;
100 }
101 
108 {
109  CrFwCmpData_t *inData;
110 
111  /* Set action outcome to 'success' */
112 
113  /* Get in data */
114  inData = (CrFwCmpData_t*)FwSmGetData(smDesc);
115 
116  inData->outcome = 1;
117 
118  return;
119 }
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.
Implementation of TC(13,130) LptAbortDownCmd.
#define CRFW_UNUSED(x)
A macro that can be used to specify that a function parameter is not used.
Definition: CrFwConstants.h:27
Header file to define all user-configurable constants and types for the IASW Application.
CrFwPckt_t pckt
Packet holding the InCommand.
Interface through which applications can initialize and execute framework PUS extension components...
void CrPsLptAbortDownCmdTerminationAction(FwSmDesc_t smDesc)
Termination action of TC(13,130) LptAbortDownCmd.
Create one instance of the CrPsLpt state machine.
CrPsTid_t Tid
CrPsLptUpCmdStart function definitions.
void CrPsLptAbortDownCmdStartAction(FwSmDesc_t smDesc)
Start action of TC(13,130) LptAbortDownCmd.
void * cmpSpecificData
Derived data which are specific to each type of framework component.
Interface for accessing fields in packets of service "ServLPT".
FwSmDesc_t getSmDescLpt()
Getter for Lpt state machine descriptor.
#define CrPsLpt_DOWN_TRANSFER
Make sure to include this header file only once.
Definition: CrPsLptCreate.h:43
char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:36
Type for the data describing an InCommand.
void CrPsLptAbortDownCmdProgressAction(FwSmDesc_t smDesc)
Progress action of TC(13,130) LptAbortDownCmd.
static CrPsTid_t getLptStartDownCmdTid(void *p)
Get "Tid" from "LptStartDownCmd" packet.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved