CORDET Framework - C2 Implementation
CrPsLptStartDownCmd.c
Go to the documentation of this file.
1 
24 #include "CrPsLptStartDownCmd.h"
25 
26 #include <CrFwCmpData.h>
27 #include <FwSmConfig.h>
28 
29 #include <CrPsUtilitiesServLpt.h>
30 #include <CrPsUserConstants.h>
33 
34 uint32_t DownTransferLptBufferId;
35 
36 
45 void CrPsLptStartDownCmdStartAction(FwSmDesc_t smDesc)
46 {
47  CrFwCmpData_t *inData;
48  CrFwInCmdData_t *cmpSpecificData;
49  CrFwPckt_t inPckt;
50  CrPsTid_t Tid;
51  uint32_t LptBufferId;
52  uint16_t sm_state;
53 
54  CRFW_UNUSED(smDesc);
55 
56  /* Get inPckt */
57  inData = (CrFwCmpData_t*) FwSmGetData(smDesc);
58  cmpSpecificData = (CrFwInCmdData_t *) inData->cmpSpecificData;
59  inPckt = cmpSpecificData->pckt;
60 
61  /* Determine the identifier of the LPT Buffer */
62  Tid = getLptStartDownCmdTid(inPckt);
63  LptBufferId = Tid % LPT_N_BUF;
64 
65  /* Set DownTransferLptBufferId for current Down Transfer */
66  DownTransferLptBufferId = LptBufferId;
67 
68  /* Get in data */
69  inData = (CrFwCmpData_t*)FwSmGetData(smDesc);
70 
71  sm_state = FwSmGetCurState(getSmDescLpt());
72  if (sm_state == CrPsLpt_INACTIVE)
73  {
74  inData->outcome = 1;
75  }
76  else
77  {
78  inData->outcome = 0;
79  }
80 
81  return;
82 }
83 
89 void CrPsLptStartDownCmdProgressAction(FwSmDesc_t smDesc)
90 {
91  CrFwCmpData_t *inData;
92 
93  CRFW_UNUSED(smDesc);
94 
95  FwSmMakeTrans(getSmDescLpt(), StartDownTransfer);
96 
97  /* Get in data */
98  inData = (CrFwCmpData_t*)FwSmGetData(smDesc);
99 
100  inData->outcome = 1;
101 
102  return;
103 }
104 
111 {
112  CrFwCmpData_t *inData;
113 
114  /* Set action outcome to 'success' */
115 
116  /* Get in data */
117  inData = (CrFwCmpData_t*)FwSmGetData(smDesc);
118 
119  inData->outcome = 1;
120 
121  return;
122 }
123 
Type for the Framework Component Data (FCD).
void CrPsLptStartDownCmdStartAction(FwSmDesc_t smDesc)
Start action of TC(13,129) LptStartDownCmd.
CrFwOutcome_t outcome
The outcome of an action or check executed by a state machine or by one of its procedures.
#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 CrPsLptStartDownCmdProgressAction(FwSmDesc_t smDesc)
Progress action of TC(13,129) LptStartDownCmd.
Create one instance of the CrPsLpt state machine.
CrPsTid_t Tid
CrPsLptUpCmdStart function definitions.
Implementation of TC(13,129) LptStartDownCmd.
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.
void CrPsLptStartDownCmdTerminationAction(FwSmDesc_t smDesc)
Termination action of TC(13,129) LptStartDownCmd.
char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:36
Type for the data describing an InCommand.
static CrPsTid_t getLptStartDownCmdTid(void *p)
Get "Tid" from "LptStartDownCmd" packet.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved