CORDET Framework - C2 Implementation
CrFwOutCmp.c
Go to the documentation of this file.
1 
19 #include <stdlib.h>
20 /* Include configuration files */
21 #include "CrFwCmpData.h"
22 /* Include framework files */
23 #include "CrFwConstants.h"
24 #include "CrFwRepErr.h"
27 #include "OutCmp/CrFwOutCmp.h"
28 #include "BaseCmp/CrFwBaseCmp.h"
29 #include "BaseCmp/CrFwInitProc.h"
30 #include "BaseCmp/CrFwResetProc.h"
33 #include "Pckt/CrFwPckt.h"
34 #include "CrFwTime.h"
35 /* Include FW Profile files */
36 #include "FwPrConfig.h"
37 #include "FwPrDCreate.h"
38 #include "FwSmConfig.h"
39 #include "FwSmDCreate.h"
40 #include "FwPrCore.h"
41 
43 static FwSmDesc_t baseOutCmpSmDesc = NULL;
44 
57 void LoadedToCpsTransAction(FwSmDesc_t smDesc);
58 
81 void PendingDoAction(FwSmDesc_t smDesc);
82 
102 void PendingEntryAction(FwSmDesc_t smDesc);
103 
104 /* --------------------------------------------------------------------------------- */
105 FwSmDesc_t CrFwOutCmpMakeBase() {
106  FwSmCounterS1_t nOfStates = 4; /* Number of states */
107  FwSmCounterS1_t nOfChoicePseudoStates = 1; /* Number of choice pseudo-states */
108  FwSmCounterS1_t nOfTrans = 6; /* Number of transitions */
109  FwSmCounterS1_t nOfActions = 3; /* Number of actions */
110  FwSmCounterS1_t nOfGuards = 3; /* Number of guards */
111  FwSmCounterS1_t CPS_1 = 1; /* Identifier of first choice pseudo-state */
112  FwSmDesc_t esm;
113 
114  if (baseOutCmpSmDesc != NULL)
115  return baseOutCmpSmDesc;
116 
117  /* Create and configure the base OutComponent */
118 
119  /* Extend the Base Component */
120  baseOutCmpSmDesc = FwSmCreateDer(CrFwBaseCmpMake());
121  /* Create the OutComponent SM and then embed it in state CONFIGURED of the Base Component */
122  esm = FwSmCreate(nOfStates, nOfChoicePseudoStates, nOfTrans, nOfActions, nOfGuards);
123  FwSmAddState(esm, CR_FW_OUTCMP_STATE_LOADED, 1, NULL, NULL, NULL, NULL);
124  FwSmAddState(esm, CR_FW_OUTCMP_STATE_ABORTED, 0, NULL, NULL, NULL, NULL);
125  FwSmAddState(esm, CR_FW_OUTCMP_STATE_PENDING, 2, &PendingEntryAction, NULL, &PendingDoAction, NULL);
126  FwSmAddState(esm, CR_FW_OUTCMP_STATE_TERMINATED, 0, NULL, NULL, NULL, NULL);
127  FwSmAddChoicePseudoState(esm, CPS_1, 2);
128  FwSmAddTransIpsToSta(esm, CR_FW_OUTCMP_STATE_LOADED, NULL);
129  FwSmAddTransStaToCps(esm, FW_TR_EXECUTE, CR_FW_OUTCMP_STATE_LOADED, CPS_1,
130  &LoadedToCpsTransAction, NULL);
131  FwSmAddTransCpsToSta(esm, CPS_1, CR_FW_OUTCMP_STATE_ABORTED, NULL, &CrFwIsSmOutcomeZero);
132  FwSmAddTransCpsToSta(esm, CPS_1, CR_FW_OUTCMP_STATE_PENDING, NULL, &CrFwIsSmOutcomeOne);
133  FwSmAddTransStaToSta(esm, CR_FW_OUTCMP_TR_TERMINATE, CR_FW_OUTCMP_STATE_PENDING,
135  FwSmAddTransStaToSta(esm, CR_FW_OUTCMP_TR_TERMINATE, CR_FW_OUTCMP_STATE_PENDING,
138 
139  return baseOutCmpSmDesc;
140 }
141 
142 /* --------------------------------------------------------------------------------- */
143 void CrFwOutCmpTerminate(FwSmDesc_t smDesc) {
144  FwSmMakeTrans(smDesc, CR_FW_OUTCMP_TR_TERMINATE);
145 }
146 
147 /* --------------------------------------------------------------------------------- */
148 CrFwBool_t CrFwOutCmpIsInLoaded(FwSmDesc_t smDesc) {
149  return (FwSmGetCurStateEmb(smDesc) == CR_FW_OUTCMP_STATE_LOADED);
150 }
151 
152 /* --------------------------------------------------------------------------------- */
153 CrFwBool_t CrFwOutCmpIsInAborted(FwSmDesc_t smDesc) {
154  return (FwSmGetCurStateEmb(smDesc) == CR_FW_OUTCMP_STATE_ABORTED);
155 }
156 
157 /* --------------------------------------------------------------------------------- */
158 CrFwBool_t CrFwOutCmpIsInPending(FwSmDesc_t smDesc) {
159  return (FwSmGetCurStateEmb(smDesc) == CR_FW_OUTCMP_STATE_PENDING);
160 }
161 
162 /* --------------------------------------------------------------------------------- */
164  return (FwSmGetCurStateEmb(smDesc) == CR_FW_OUTCMP_STATE_TERMINATED);
165 }
166 
167 /* --------------------------------------------------------------------------------- */
169  return CrFwOutRegistryIsEnabled(smDesc);
170 }
171 
172 /* --------------------------------------------------------------------------------- */
173 void CrFwOutCmpDefSerialize(FwSmDesc_t smDesc) {
174  CrFwPckt_t pckt;
175  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
176  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
177 
178  pckt = cmpSpecificData->pckt;
179  CrFwPcktSetCmdRepId(pckt,cmpData->instanceId);
180 
181  return;
182 }
183 
184 /* --------------------------------------------------------------------------------- */
185 CrFwDestSrc_t CrFwOutCmpGetDest(FwSmDesc_t smDesc) {
186  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
187  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
188  return CrFwPcktGetDest(cmpSpecificData->pckt);
189 }
190 
191 /* --------------------------------------------------------------------------------- */
192 void CrFwOutCmpSetDest(FwSmDesc_t smDesc, CrFwDestSrc_t dest) {
193  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
194  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
195  CrFwPcktSetDest(cmpSpecificData->pckt, dest);
196  return;
197 }
198 
199 /* --------------------------------------------------------------------------------- */
200 CrFwGroup_t CrFwOutCmpGetGroup(FwSmDesc_t smDesc) {
201  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
202  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
203  return CrFwPcktGetGroup(cmpSpecificData->pckt);
204 }
205 
206 /* --------------------------------------------------------------------------------- */
207 void CrFwOutCmpSetGroup(FwSmDesc_t smDesc, CrFwGroup_t group) {
208  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
209  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
210  CrFwPcktSetGroup(cmpSpecificData->pckt, group);
211  return;
212 }
213 
214 /* --------------------------------------------------------------------------------- */
216  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
217  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
218  return CrFwPcktGetTimeStamp(cmpSpecificData->pckt);
219 }
220 
221 /* --------------------------------------------------------------------------------- */
222 void CrFwOutCmpSetTimeStamp(FwSmDesc_t smDesc, CrFwTimeStamp_t timeStamp) {
223  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
224  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
225  CrFwPcktSetTimeStamp(cmpSpecificData->pckt, timeStamp);
226  return;
227 }
228 
229 /* --------------------------------------------------------------------------------- */
231  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
232  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
233  return CrFwPcktGetServType(cmpSpecificData->pckt);
234 }
235 
236 /* --------------------------------------------------------------------------------- */
237 CrFwDestSrc_t CrFwOutCmpGetSrc(FwSmDesc_t smDesc) {
238  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
239  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
240  return CrFwPcktGetSrc(cmpSpecificData->pckt);
241 }
242 
243 /* --------------------------------------------------------------------------------- */
245  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
246  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
247  return CrFwPcktGetServSubType(cmpSpecificData->pckt);
248 }
249 
250 /* --------------------------------------------------------------------------------- */
252  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
253  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
254  return CrFwPcktGetDiscriminant(cmpSpecificData->pckt);
255 }
256 
257 /* --------------------------------------------------------------------------------- */
258 void CrFwOutCmpSetDiscriminant(FwSmDesc_t smDesc, CrFwDiscriminant_t discriminant) {
259  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
260  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
261  CrFwPcktSetDiscriminant(cmpSpecificData->pckt, discriminant);
262 }
263 
264 /* --------------------------------------------------------------------------------- */
265 void CrFwOutCmpSetAckLevel(FwSmDesc_t smDesc, CrFwBool_t accept, CrFwBool_t start,
266  CrFwBool_t progress, CrFwBool_t term) {
267  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
268  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
269  CrFwPcktSetAckLevel(cmpSpecificData->pckt,accept,start,progress,term);
270  return;
271 }
272 
273 /* --------------------------------------------------------------------------------- */
274 CrFwBool_t CrFwOutCmpIsAcceptAck(FwSmDesc_t smDesc) {
275  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
276  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
277  return CrFwPcktIsAcceptAck(cmpSpecificData->pckt);
278 }
279 
280 /* --------------------------------------------------------------------------------- */
281 CrFwBool_t CrFwOutCmpIsStartAck(FwSmDesc_t smDesc) {
282  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
283  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
284  return CrFwPcktIsStartAck(cmpSpecificData->pckt);
285 }
286 
287 /* --------------------------------------------------------------------------------- */
289  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
290  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
291  return CrFwPcktIsProgressAck(cmpSpecificData->pckt);
292 }
293 
294 /* --------------------------------------------------------------------------------- */
295 CrFwBool_t CrFwOutCmpIsTermAck(FwSmDesc_t smDesc) {
296  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
297  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
298  return CrFwPcktIsTermAck(cmpSpecificData->pckt);
299 }
300 
301 /* --------------------------------------------------------------------------------- */
302 void LoadedToCpsTransAction(FwSmDesc_t smDesc) {
303  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
304  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
305  cmpData->outcome = (CrFwOutcome_t)cmpSpecificData->isEnabled(smDesc);
306  return;
307 }
308 
309 /* --------------------------------------------------------------------------------- */
310 void PendingEntryAction(FwSmDesc_t smDesc) {
311  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
312  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
313  CrFwBool_t isReady;
314  CrFwBool_t isRepeat;
316  FwSmDesc_t outStream;
317 
318  isReady = cmpSpecificData->isReady(smDesc);
319  if (isReady) {
320  cmpSpecificData->update(smDesc);
321  dest = CrFwPcktGetDest(cmpSpecificData->pckt);
322  outStream = CrFwOutStreamGet(dest);
323  if (outStream == NULL) {
324  CrFwRepErrDestSrc(crOutCmpSendPcktInvDest, cmpData->typeId, cmpData->instanceId, dest);
325  isRepeat = 0;
326  } else {
328  cmpSpecificData->serialize(smDesc);
329  CrFwOutStreamSend(outStream, cmpSpecificData->pckt);
330  isRepeat = cmpSpecificData->isRepeat(smDesc);
331  }
332  if (isRepeat == 1)
333  cmpData->outcome = 1;
334  else
335  cmpData->outcome = 2;
336  }
337 }
338 
339 /* --------------------------------------------------------------------------------- */
340 void PendingDoAction(FwSmDesc_t smDesc) {
341  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
342  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
344  FwSmDesc_t outStream;
345  CrFwBool_t isReady;
346  CrFwBool_t isRepeat;
347  CrFwBool_t isEnabled;
348 
349  isReady = cmpSpecificData->isReady(smDesc);
350  isEnabled = cmpSpecificData->isEnabled(smDesc);
351 
352  if (isReady == 1)
353  if (isEnabled ==1) {
354  cmpSpecificData->update(smDesc);
355  dest = CrFwPcktGetDest(cmpSpecificData->pckt);
356  outStream = CrFwOutStreamGet(dest);
357  if (outStream == NULL) {
358  CrFwRepErrDestSrc(crOutCmpSendPcktInvDest, cmpData->typeId, cmpData->instanceId, dest);
359  isRepeat = 0;
360  } else {
362  cmpSpecificData->serialize(smDesc);
363  CrFwOutStreamSend(outStream, cmpSpecificData->pckt);
364  isRepeat = cmpSpecificData->isRepeat(smDesc);
365  }
366  if (isRepeat == 0) {
367  cmpData->outcome = 2;
368  return;
369  }
370  }
371 
372  if (isEnabled == 0) {
373  cmpData->outcome = 0;
374  return;
375  }
376 
377  cmpData->outcome = 1;
378 }
379 
380 /* --------------------------------------------------------------------------------- */
381 CrFwPckt_t CrFwOutCmpGetParStart(FwSmDesc_t smDesc) {
382  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
383  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
384  return CrFwPcktGetParStart(cmpSpecificData->pckt);
385 }
386 
387 /* --------------------------------------------------------------------------------- */
389  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
390  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
391  return CrFwPcktGetParLength(cmpSpecificData->pckt);
392 }
393 
394 /* --------------------------------------------------------------------------------- */
396  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
397  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
398  return CrFwPcktGetLength(cmpSpecificData->pckt);
399 }
400 
401 /* --------------------------------------------------------------------------------- */
402 CrFwPckt_t CrFwOutCmpGetPckt(FwSmDesc_t smDesc) {
403  CrFwCmpData_t* cmpData = (CrFwCmpData_t*)FwSmGetData(smDesc);
404  CrFwOutCmpData_t* cmpSpecificData = (CrFwOutCmpData_t*)(cmpData->cmpSpecificData);
405  return cmpSpecificData->pckt;
406 }
CrFwTimeStamp_t CrFwPcktGetTimeStamp(CrFwPckt_t pckt)
Return the time stamp of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:235
CrFwOutCmpSerialize_t serialize
Function which implements the Serialization Operation for the out-going command or report...
void CrFwPcktSetAckLevel(CrFwPckt_t pckt, CrFwBool_t accept, CrFwBool_t start, CrFwBool_t progress, CrFwBool_t term)
Set the acknowledge level for the command encapsulated in a packet.
Definition: CrFwPckt.c:345
CrFwBool_t CrFwOutCmpIsProgressAck(FwSmDesc_t smDesc)
Return the acknowledge level for command progress for the command encapsulated in the OutComponent...
Definition: CrFwOutCmp.c:288
Type for the Framework Component Data (FCD).
Definition: CrFwCmpData.h:79
void PendingEntryAction(FwSmDesc_t smDesc)
Entry action of the SENDING state (including behaviour of Send Packet Procedure). ...
Definition: CrFwOutCmp.c:310
Interface through which framework components access the current time.
#define CR_FW_OUTCMP_STATE_PENDING
State identifier for state PENDING in the OutComponent State Machine.
void CrFwOutStreamSend(FwSmDesc_t smDesc, CrFwPckt_t pckt)
Send a packet to the OutStream.
CrFwOutcome_t outcome
The outcome of an action or check executed by a state machine or by one of its procedures.
Definition: CrFwCmpData.h:93
void CrFwPcktSetGroup(CrFwPckt_t pckt, CrFwGroup_t group)
Set the group of the command/report encapsulated in a packet.
Definition: CrFwPckt.c:392
Definition of the Framework Component Data (FCD) Type.
CrFwDestSrc_t CrFwOutCmpGetDest(FwSmDesc_t smDesc)
Return the destination of the OutComponent.
Definition: CrFwOutCmp.c:185
An OutComponent has an invalid destination (see CrFwOutCmp.h)
CrFwPcktLength_t CrFwOutCmpGetParLength(FwSmDesc_t smDesc)
Return the length in bytes of the parameter area of the OutComponent.
Definition: CrFwOutCmp.c:388
FwSmDesc_t CrFwOutCmpMakeBase()
Return the base OutComponent from which all other OutComponents are derived.
Definition: CrFwOutCmp.c:105
void CrFwOutCmpTerminate(FwSmDesc_t smDesc)
Send command Terminate to the argument OutComponent.
Definition: CrFwOutCmp.c:143
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:38
CrFwPckt_t CrFwPcktGetParStart(CrFwPckt_t pckt)
Return the start address of the packet&#39;s parameter area.
Definition: CrFwPckt.c:382
CrFwPcktLength_t CrFwOutCmpGetLength(FwSmDesc_t smDesc)
Return the length in bytes of the packet to which the OutComponent is serialized. ...
Definition: CrFwOutCmp.c:395
CrFwServType_t CrFwPcktGetServType(CrFwPckt_t pckt)
Return the service type of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:291
CrFwDestSrc_t CrFwPcktGetSrc(CrFwPckt_t pckt)
Return the source of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:327
CrFwBool_t CrFwOutCmpIsStartAck(FwSmDesc_t smDesc)
Return the acknowledge level for command start for the command encapsulated in the OutComponent...
Definition: CrFwOutCmp.c:281
CrFwBool_t CrFwOutCmpIsInTerminated(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state TERMINATED.
Definition: CrFwOutCmp.c:163
#define CR_FW_OUTCMP_TR_TERMINATE
Identifier for transition command "Terminate" in the OutComponent State Machine.
Definition of the OutStream component.
Definition of the OutFactory component.
Type for the data describing an OutComponent.
void CrFwOutCmpSetTimeStamp(FwSmDesc_t smDesc, CrFwTimeStamp_t timeStamp)
Set the time stamp attribute of the OutComponent.
Definition: CrFwOutCmp.c:222
CrFwPckt_t CrFwOutCmpGetParStart(FwSmDesc_t smDesc)
Return the start address of the parameter area of the OutComponent.
Definition: CrFwOutCmp.c:381
CrFwDestSrc_t CrFwPcktGetDest(CrFwPckt_t pckt)
Return the destination of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:315
CrFwPckt_t pckt
Packet to which the out-going command or report is serialized.
Interface for creating and accessing a report or command packet.
CrFwOutCmpEnableCheck_t isEnabled
Function which implements the Enable Check for the out-going command or report.
void CrFwOutCmpSetGroup(FwSmDesc_t smDesc, CrFwGroup_t group)
Set the group of the OutComponent.
Definition: CrFwOutCmp.c:207
void CrFwOutCmpSetAckLevel(FwSmDesc_t smDesc, CrFwBool_t accept, CrFwBool_t start, CrFwBool_t progress, CrFwBool_t term)
Set the acknowledge level for the command encapsulated in the OutComponent.
Definition: CrFwOutCmp.c:265
void CrFwRepErrDestSrc(CrFwRepErrCode_t errCode, CrFwTypeId_t typeId, CrFwInstanceId_t instanceId, CrFwDestSrc_t destSrc)
Report an error which has one single parameter attached to it representing a command or report destin...
Definition: CrFwRepErr.c:94
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
Definition: CrFwConstants.h:32
CrFwServType_t CrFwOutCmpGetServType(FwSmDesc_t smDesc)
Return the type of the OutComponent.
Definition: CrFwOutCmp.c:230
Dummy Component Execution Procedure (CEP) for the Base Component.
void CrFwPcktSetDest(CrFwPckt_t pckt, CrFwDestSrc_t dest)
Set the destination of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:309
void CrFwPcktSetCmdRepId(CrFwPckt_t pckt, CrFwInstanceId_t id)
Set the command or report identifier in the command or report encapsulated in a packet.
Definition: CrFwPckt.c:333
unsigned char CrFwGroup_t
Type used for the destination or source group of a packet.
unsigned char CrFwOutcome_t
Type used for the outcome of a check (see CrFwCmpData).
Header file to define all invariant publicly available constants and types for the CORDET Framework...
unsigned short CrFwDiscriminant_t
Type used for the discriminant of a command or report.
CrFwBool_t CrFwOutCmpIsTermAck(FwSmDesc_t smDesc)
Return the acknowledge level for command termination for the command encapsulated in the OutComponent...
Definition: CrFwOutCmp.c:295
unsigned char CrFwDestSrc_t
Type used for the command or report destination and source.
CrFwInstanceId_t instanceId
The instance identifier of the framework component.
Definition: CrFwCmpData.h:81
FwSmBool_t CrFwIsSmOutcomeZero(FwSmDesc_t smDesc)
Convenience function to check whether the outcome of the last check or action is equal to 0 ("false")...
CrFwPckt_t CrFwOutCmpGetPckt(FwSmDesc_t smDesc)
Return the pointer to the packet which holds the OutComponent.
Definition: CrFwOutCmp.c:402
CrFwBool_t CrFwOutCmpIsInAborted(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state ABORTED.
Definition: CrFwOutCmp.c:153
Interface for reporting an error detected by a framework component.
CrFwOutCmpRepeatCheck_t isRepeat
Function which implements the Repeat Check for the out-going command or report.
CrFwBool_t CrFwOutCmpIsAcceptAck(FwSmDesc_t smDesc)
Return the acknowledge level for command acceptance for the command encapsulated in the OutComponent...
Definition: CrFwOutCmp.c:274
#define CR_FW_OUTCMP_STATE_ABORTED
State identifier for state ABORTED in the OutComponent State Machine.
CrFwDestSrc_t CrFwOutCmpGetSrc(FwSmDesc_t smDesc)
Return the source of the OutComponent.
Definition: CrFwOutCmp.c:237
#define CR_FW_OUTCMP_STATE_TERMINATED
State identifier for state TERMINATED the OutComponent State Machine.
CrFwTimeStamp_t CrFwOutCmpGetTimeStamp(FwSmDesc_t smDesc)
Return the time stamp attribute of the OutComponent.
Definition: CrFwOutCmp.c:215
#define CR_FW_OUTCMP_STATE_LOADED
State identifier for state LOADED in the OutComponent State Machine.
CrFwServType_t CrFwOutCmpGetServSubType(FwSmDesc_t smDesc)
Return the sub-type of the OutComponent.
Definition: CrFwOutCmp.c:244
CrFwBool_t CrFwOutRegistryIsEnabled(FwSmDesc_t outCmp)
Query the enable status of an out-going command or report.
CrFwDiscriminant_t CrFwPcktGetDiscriminant(CrFwPckt_t pckt)
Return the discriminant of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:273
void * cmpSpecificData
Derived data which are specific to each type of framework component.
Definition: CrFwCmpData.h:101
CrFwTimeStamp_t CrFwGetCurrentTimeStamp()
Return the current time in the format used for the command and report time-stamp. ...
Definition: CrFwTime.c:40
void PendingDoAction(FwSmDesc_t smDesc)
Do action of the PENDING state (including behaviour of Send Packet Procedure).
Definition: CrFwOutCmp.c:340
Definition of the utility functions for the CORDET Framework.
FwSmDesc_t CrFwOutStreamGet(CrFwDestSrc_t dest)
Getter function for the OutStream corresponding to the argument destination.
CrFwBool_t CrFwOutCmpIsInLoaded(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state LOADED.
Definition: CrFwOutCmp.c:148
FwSmDesc_t CrFwBaseCmpMake()
Retrieve the singleton instance of the Base State Machine.
Definition: CrFwBaseCmp.c:77
void CrFwOutCmpDefSerialize(FwSmDesc_t smDesc)
Default implementation of the Serialize Operation for an OutComponent.
Definition: CrFwOutCmp.c:173
CrFwServSubType_t CrFwPcktGetServSubType(CrFwPckt_t pckt)
Return the service sub-type of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:303
CrFwDiscriminant_t CrFwOutCmpGetDiscriminant(FwSmDesc_t smDesc)
Return the discriminant of the OutComponent.
Definition: CrFwOutCmp.c:251
static FwSmDesc_t baseOutCmpSmDesc
Base OutComponent from which all other OutComponents are derived.
Definition: CrFwOutCmp.c:43
CrFwBool_t CrFwPcktIsProgressAck(CrFwPckt_t pckt)
Return the acknowledge level for command progress for the command encapsulated in the packet...
Definition: CrFwPckt.c:370
FwSmBool_t CrFwIsSmOutcomeTwo(FwSmDesc_t smDesc)
Convenience function to check whether the outcome of the last check or action is equal to 2...
Definition of Base Component.
unsigned int CrFwTimeStamp_t
Type used for the time stamp of a command or report.
CrFwOutCmpReadyCheck_t isReady
Function which implements the Ready Check for the out-going command or report.
static CrFwDestSrc_t dest
Destination.
CrFwGroup_t CrFwOutCmpGetGroup(FwSmDesc_t smDesc)
Return the group of the OutComponent.
Definition: CrFwOutCmp.c:200
CrFwBool_t CrFwPcktIsStartAck(CrFwPckt_t pckt)
Return the acknowledge level for command start for the command encapsulated in the packet...
Definition: CrFwPckt.c:364
CrFwPcktLength_t CrFwPcktGetLength(CrFwPckt_t pckt)
Return the length (in number of bytes) of a packet.
Definition: CrFwPckt.c:206
void LoadedToCpsTransAction(FwSmDesc_t smDesc)
Transition action on the transition out of the LOADED state.
Definition: CrFwOutCmp.c:302
Component Initialization Procedure (CIP) for the Base Component.
CrFwGroup_t CrFwPcktGetGroup(CrFwPckt_t pckt)
Return the group of the command/report encapsulated in a packet.
Definition: CrFwPckt.c:398
unsigned short int CrFwPcktLength_t
Type for the packet length.
Definition of the OutComponent Component of the framework.
void CrFwOutCmpSetDiscriminant(FwSmDesc_t smDesc, CrFwDiscriminant_t discriminant)
Set the discriminant of the OutComponent.
Definition: CrFwOutCmp.c:258
CrFwPcktLength_t CrFwPcktGetParLength(CrFwPckt_t pckt)
Return the length in bytes of the packet&#39;s parameter area.
Definition: CrFwPckt.c:387
CrFwBool_t CrFwPcktIsTermAck(CrFwPckt_t pckt)
Return the acknowledge level for command termination for the command encapsulated in the packet...
Definition: CrFwPckt.c:376
void CrFwOutCmpSetDest(FwSmDesc_t smDesc, CrFwDestSrc_t dest)
Set the destination of the OutComponent.
Definition: CrFwOutCmp.c:192
CrFwTypeId_t typeId
The type identifier of the framework component.
Definition: CrFwCmpData.h:83
void CrFwPcktSetTimeStamp(CrFwPckt_t pckt, CrFwTimeStamp_t timeStamp)
Set the time stamp of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:241
#define CR_FW_BASE_STATE_CONFIGURED
State identifier for state CONFIGURED in the Base State Machine.
CrFwOutCmpUpdate_t update
Function which implements the Update Operation for the out-going command or report.
CrFwBool_t CrFwOutCmpDefEnableCheck(FwSmDesc_t smDesc)
Default implementation of the Enable Check Operation for an OutComponent.
Definition: CrFwOutCmp.c:168
void CrFwPcktSetDiscriminant(CrFwPckt_t pckt, CrFwDiscriminant_t discriminant)
Set the discriminant of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:279
unsigned char CrFwServType_t
Type used for the service type of a command or report.
FwSmBool_t CrFwIsSmOutcomeOne(FwSmDesc_t smDesc)
Convenience function to check whether the outcome of the last check or action is equal to 1 ("true")...
Component Reset Procedure (CRP) for the Base Component.
CrFwBool_t CrFwOutCmpIsInPending(FwSmDesc_t smDesc)
Return true if the argument OutComponent is in state PENDING.
Definition: CrFwOutCmp.c:158
CrFwBool_t CrFwPcktIsAcceptAck(CrFwPckt_t pckt)
Return the acknowledge level for command acceptance for the command encapsulated in the packet...
Definition: CrFwPckt.c:358
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved