CORDET Framework - C2 Implementation
CrFwInStreamTestCases.c
Go to the documentation of this file.
1 
19 #include <stdlib.h>
20 #include "CrFwRepErrStub.h"
21 #include "CrFwInStreamTestCases.h"
22 #include "CrFwInStreamStub.h"
23 /* Include FW Profile files */
24 #include "FwSmConstants.h"
25 #include "FwSmConfig.h"
26 #include "FwSmCore.h"
27 #include "FwPrConfig.h"
28 #include "FwPrCore.h"
29 #include "FwPrConstants.h"
30 /* Include configuration files */
31 #include "CrFwInStreamUserPar.h"
32 #include "CrFwCmpData.h"
33 /* Include framework files */
34 #include "InStream/CrFwInStream.h"
35 #include "BaseCmp/CrFwBaseCmp.h"
36 #include "Pckt/CrFwPckt.h"
37 #include "CrFwTime.h"
38 #include "CrFwRepErr.h"
40 
41 /* ---------------------------------------------------------------------------------------------*/
43  FwSmDesc_t inStream0, inStreamBis, inStream[CR_FW_NOF_INSTREAM];
46 
47  /* Attempt to instantiate an InStream with an illegal identifier */
49  return 0;
50  inStream0 = CrFwInStreamMake(CR_FW_NOF_INSTREAM + 1);
51  if (inStream0 != NULL)
52  return 0;
54  return 0;
55  CrFwSetAppErrCode(crNoAppErr); /* reset application error code */
56 
57  /* Create the first InStream */
58  inStream0 = CrFwInStreamMake(0);
59  if (inStream0 == NULL)
60  return 0;
61 
62  /* Create the first InStream again and check that the same component is returned */
63  inStreamBis = CrFwInStreamMake(0);
64  if (inStream0 != inStreamBis)
65  return 0;
66 
67  /* Check configuration of InStream */
68  if (FwSmCheckRec(inStream0) != smSuccess)
69  return 0;
70 
71  /* Initialize inStream and check success */
72  if (!CrFwCmpIsInCreated(inStream0))
73  return 0;
74 
75  CrFwCmpInit(inStream0);
76  if (!CrFwCmpIsInInitialized(inStream0))
77  return 0;
78 
79  /* Reset InStream */
80  CrFwCmpReset(inStream0);
81  if (!CrFwCmpIsInConfigured(inStream0))
82  return 0;
83 
84  /* Since the packet available stub declares "packet is not available", the InStream is in WAITING */
85  if (!CrFwInStreamIsInWaiting(inStream0))
86  return 0;
87 
88  if (CrFwInStreamGetSeqCnt(inStream0,0) != 0)
89  return 0;
90 
91  if (CrFwInStreamGetNOfPendingPckts(inStream0) != 0)
92  return 0;
93 
94  /* Check the function to get the InStream as a function of packet source under nominal conditions */
95  for (i=0; i<CR_FW_NOF_INSTREAM; i++)
96  inStream[i] = CrFwInStreamMake(i);
97  if (CrFwInStreamGet(inStreamSrc[0])!=inStream[0])
98  return 0;
99  if (CrFwInStreamGet(inStreamSrc[1])!=inStream[1])
100  return 0;
101  if (CrFwInStreamGet(inStreamSrc[CR_FW_NOF_INSTREAM-2])!=inStream[CR_FW_NOF_INSTREAM-2])
102  return 0;
103 
104  /* Check the function to get the InStream as a function of packet source under non-nominal conditions */
105  if (CrFwGetAppErrCode() != crNoAppErr)
106  return 0;
107  if (CrFwInStreamGet(0)!=NULL) /* No packet source has identifier zero */
108  return 0;
110  return 0;
111  CrFwSetAppErrCode(crNoAppErr); /* reset application error code */
112 
113  /* Check the function to get the number of groups (this is set in CrFwInStreamUserPar.h) */
114  if (CrFwInStreamGetNOfGroups(inStream0) != 1)
115  return 0;
116 
117  /* Check that all packets have been de-allocated */
118  if (CrFwPcktGetNOfAllocated() != 0)
119  return 0;
120 
121  /* Check application errors */
122  if (CrFwGetAppErrCode() != crNoAppErr)
123  return 0;
124 
125  return 1;
126 }
127 
128 /* ---------------------------------------------------------------------------------------------*/
130  FwSmDesc_t inStream0;
131  CrFwPckt_t pckt1, pckt2;
132 
133  /* Retrieve the first InStream */
134  inStream0 = CrFwInStreamMake(0);
135  if (inStream0 == NULL)
136  return 0;
137 
138  /* Verify that InStream is in WAITING */
139  if (!CrFwInStreamIsInWaiting(inStream0))
140  return 0;
141 
142  /* Send PACKET_AVAILABLE command to InStream at a time when no packets are available and
143  * verify that InStream remains in WAITING */
144  CrFwInStreamPcktAvail(inStream0);
145  if (!CrFwInStreamIsInWaiting(inStream0))
146  return 0;
147  if (CrFwInStreamGetNOfPendingPckts(inStream0) != 0)
148  return 0;
149 
150  /* Send GET_PCKT command to InStream and verify that nothing is returned */
151  pckt1 = CrFwInStreamGetPckt(inStream0);
152  if (pckt1 != NULL)
153  return 0;
154  if (!CrFwInStreamIsInWaiting(inStream0))
155  return 0;
156  if (CrFwInStreamGetNOfPendingPckts(inStream0) != 0)
157  return 0;
158 
159  /* Set up stub to simulate presence of two packets for the host application */
161  CrFwInStreamStubSetPcktGroup(0); /* First InStream only has one group */
164 
165  /* Send PACKET_AVAILABLE command to InStream */
166  CrFwInStreamSetSeqCnt(inStream0, 0, 5555);
167  CrFwInStreamPcktAvail(inStream0);
168  if (!CrFwInStreamIsInPcktAvail(inStream0))
169  return 0;
170  if (CrFwInStreamGetNOfPendingPckts(inStream0) != 2)
171  return 0;
172  if (CrFwInStreamGetSeqCnt(inStream0,0) != (5555+2))
173  return 0;
174 
175  /* Send first GET_PCKT command to InStream */
176  pckt1 = CrFwInStreamGetPckt(inStream0);
177  if (!CrFwInStreamIsInPcktAvail(inStream0))
178  return 0;
179  if (CrFwInStreamGetNOfPendingPckts(inStream0) != 1)
180  return 0;
181  if (CrFwPcktGetSeqCnt(pckt1) != 5556)
182  return 0;
183 
184  /* Send second GET_PCKT command to InStream */
185  pckt2 = CrFwInStreamGetPckt(inStream0);
186  if (!CrFwInStreamIsInWaiting(inStream0))
187  return 0;
188  if (CrFwInStreamGetNOfPendingPckts(inStream0) != 0)
189  return 0;
190  if (CrFwPcktGetSeqCnt(pckt2) != 5557)
191  return 0;
192 
193  /* De-allocate packets */
194  CrFwPcktRelease(pckt1);
195  CrFwPcktRelease(pckt2);
196 
197  /* Check that all packets have been de-allocated */
198  if (CrFwPcktGetNOfAllocated() != 0)
199  return 0;
200 
201  /* Check application errors */
202  if (CrFwGetAppErrCode() != crNoAppErr)
203  return 0;
204 
205  return 1;
206 }
207 
208 /* ---------------------------------------------------------------------------------------------*/
210  FwSmDesc_t inStream0;
211  CrFwSeqCnt_t seqCnt;
212 
213  /* Retrieve the first InStream */
214  inStream0 = CrFwInStreamMake(0);
215  if (inStream0 == NULL)
216  return 0;
217 
218  /* Set up stub to simulate presence of one packet for the host application */
220  CrFwInStreamStubSetPcktGroup(0); /* First InStream only has one group */
222 
223  /* Check initial state of InStream */
224  if (!CrFwInStreamIsInWaiting(inStream0))
225  return 0;
226 
227  /* Get current sequence counter value */
228  seqCnt = CrFwInStreamGetSeqCnt(inStream0,0);
229 
230  /* Send PACKET_AVAILABLE command to InStream */
231  CrFwInStreamPcktAvail(inStream0);
232  if (!CrFwInStreamIsInPcktAvail(inStream0))
233  return 0;
234  if (CrFwInStreamGetNOfPendingPckts(inStream0) != 1)
235  return 0;
236  if (CrFwInStreamGetSeqCnt(inStream0,0) != seqCnt+1)
237  return 0;
238 
239  /* Set up stub to simulate presence of one more packet in the middleware */
241 
242  /* Send PACKET_AVAILABLE command again to InStream */
243  CrFwInStreamPcktAvail(inStream0);
244  if (!CrFwInStreamIsInPcktAvail(inStream0))
245  return 0;
246  if (CrFwInStreamGetNOfPendingPckts(inStream0) != 2)
247  return 0;
248  if (CrFwInStreamGetSeqCnt(inStream0,0) != seqCnt+2)
249  return 0;
250 
251  /* Send SHUTDOWN command to InStream */
252  CrFwCmpShutdown(inStream0);
253  if (CrFwCmpIsStarted(inStream0) != 0)
254  return 0;
255  if (CrFwInStreamGetNOfPendingPckts(inStream0) != 0)
256  return 0;
257 
258  /* Check that all packets have been de-allocated */
259  if (CrFwPcktGetNOfAllocated() != 0)
260  return 0;
261 
262  /* Check application errors */
263  if (CrFwGetAppErrCode() != crNoAppErr)
264  return 0;
265 
266  return 1;
267 }
268 
269 /* ---------------------------------------------------------------------------------------------*/
271  FwSmDesc_t inStream0;
272  CrFwCounterU2_t errRepPosLocal;
273  CrFwPckt_t pckt;
274  CrFwPcktLength_t i, n;
275 
276  /* Reset the error reporting interface */
278 
279  /* Retrieve the first InStream */
280  inStream0 = CrFwInStreamMake(0);
281  if (inStream0 == NULL)
282  return 0;
283 
284  /* Check the initial state of the InStream */
285  if (CrFwCmpIsStarted(inStream0) != 0)
286  return 0;
287 
288  /* Set up stub to simulate absence of packets in the middleware */
290 
291  /* Start and configure the InStream */
292  FwSmStart(inStream0);
293  CrFwCmpInit(inStream0);
294  CrFwCmpReset(inStream0);
295  if (!CrFwInStreamIsInWaiting(inStream0))
296  return 0;
297 
298  /* Set up stub to simulate packets for the host application (i.e. not in transit) */
300  CrFwInStreamStubSetPcktGroup(0); /* First InStream only has one group */
301 
302  /* Set up stub to simulate presence of one packet for the host application */
304 
305  /* Reset the sequence counter of the packets generated by the middleware stub */
307 
308  /* Send PACKET_AVAILABLE command to InStream */
309  CrFwInStreamPcktAvail(inStream0);
310  if (!CrFwInStreamIsInPcktAvail(inStream0))
311  return 0;
312  if (CrFwInStreamGetNOfPendingPckts(inStream0) != 1)
313  return 0;
314  if (CrFwInStreamGetSeqCnt(inStream0,0) != 1)
315  return 0;
316 
317  /* Set up stub to simulate presence of one more packet in the middleware */
319 
320  /* Set up the stub to simulate a sequence counter error */
322 
323  /* Store the current value of the error report counter */
324  errRepPosLocal = CrFwRepErrStubGetPos();
325 
326  /* Send PACKET_AVAILABLE command to InStream */
327  CrFwInStreamPcktAvail(inStream0);
328  if (!CrFwInStreamIsInPcktAvail(inStream0))
329  return 0;
330  if (CrFwInStreamGetNOfPendingPckts(inStream0) != 2)
331  return 0;
332  if (CrFwInStreamGetSeqCnt(inStream0,0) != 10)
333  return 0;
334  if (CrFwRepErrStubGetPos() != errRepPosLocal+1)
335  return 0;
337  return 0;
339  return 0;
341  return 0;
343  return 0;
345  return 0;
346 
347  /* Set up stub to simulate presence of a packet in transit in the middleware */
349  CrFwInStreamStubSetPcktGroup(99); /* group should not matter since packet is in transit */
351 
352  /* Set up the stub to simulate a sequence counter error */
354 
355  /* Store the current value of the error report counter */
356  errRepPosLocal = CrFwRepErrStubGetPos();
357 
358  /* Send PACKET_AVAILABLE command to InStream */
359  CrFwInStreamPcktAvail(inStream0);
360  if (!CrFwInStreamIsInPcktAvail(inStream0))
361  return 0;
362  if (CrFwInStreamGetNOfPendingPckts(inStream0) != 3)
363  return 0;
364  if (CrFwInStreamGetSeqCnt(inStream0,0) != 10)
365  return 0;
366  if (CrFwRepErrStubGetPos() != errRepPosLocal)
367  return 0;
368 
369  /* Collect and release the packets in the packet queue */
370  n = CrFwInStreamGetNOfPendingPckts(inStream0);
371  for (i=0; i<n; i++) {
372  pckt = CrFwInStreamGetPckt(inStream0);
373  if (pckt == NULL)
374  return 0;
375  CrFwPcktRelease(pckt);
376  }
377 
378  /* Set up the stub to simulate the presence of (N+1) packets for the host application */
380  CrFwInStreamStubSetPcktGroup(0); /* First InStream only has one group */
382  CrFwInStreamStubSetPcktSeqCnt(CrFwInStreamGetSeqCnt(inStream0,0)); /* no seq. cnt. error */
383 
384  /* Store the current value of the error report counter */
385  errRepPosLocal = CrFwRepErrStubGetPos();
386 
387  /* Send PACKET_AVAILABLE command to InStream (this results in a "PQ Full" error */
388  CrFwInStreamPcktAvail(inStream0);
389  if (!CrFwInStreamIsInPcktAvail(inStream0))
390  return 0;
392  return 0;
393  if (CrFwInStreamGetSeqCnt(inStream0,0) != (CrFwSeqCnt_t)(10+CrFwInStreamGetPcktQueueSize(inStream0)+1))
394  return 0;
395  if (CrFwRepErrStubGetPos() != errRepPosLocal+1)
396  return 0;
398  return 0;
400  return 0;
402  return 0;
403 
404  /* Collect and release the packets in the packet queue */
405  n = CrFwInStreamGetNOfPendingPckts(inStream0);
406  for (i=0; i<n; i++) {
407  pckt = CrFwInStreamGetPckt(inStream0);
408  if (pckt == NULL)
409  return 0;
410  CrFwPcktRelease(pckt);
411  }
412 
413  /* Reset InStream (to ensure that any hanging packets are released) */
414  CrFwCmpReset(inStream0);
415 
416  /* Check that all packets have been released */
417  if (CrFwPcktGetNOfAllocated() != 0)
418  return 0;
419 
420  /* Check application errors */
421  if (CrFwGetAppErrCode() != crNoAppErr)
422  return 0;
423 
424  return 1;
425 }
426 
427 
428 /* ---------------------------------------------------------------------------------------------*/
430  FwSmDesc_t inStream3;
431 
432  /* Create the fourth InStream */
433  inStream3 = CrFwInStreamMake(3);
434  if (inStream3 == NULL)
435  return 0;
436 
437  /* Configure the newly-created InStream */
438  CrFwCmpInit(inStream3);
439  CrFwCmpReset(inStream3);
440  if (!CrFwCmpIsInConfigured(inStream3))
441  return 0;
442 
443  /* Check that the correct source has been loaded */
444  if (CrFwInStreamGetSrc(inStream3) != 4)
445  return 0;
446 
447  /* Shut down the newly-created InStream */
448  CrFwCmpShutdown(inStream3);
449 
450  /* Configure initialization check and action until initialization succeeds */
453  FwSmStart(inStream3);
454  if (!CrFwCmpIsInCreated(inStream3))
455  return 0;
456 
457  CrFwCmpInit(inStream3);
458  if (!CrFwCmpIsInCreated(inStream3))
459  return 0;
460 
463  CrFwCmpInit(inStream3);
464  if (!CrFwCmpIsInCreated(inStream3))
465  return 0;
466 
469  CrFwCmpInit(inStream3);
470  if (!CrFwCmpIsInCreated(inStream3))
471  return 0;
472 
475  CrFwCmpInit(inStream3);
476  if (!CrFwCmpIsInInitialized(inStream3))
477  return 0;
478 
479  /* Configure configuration check and action until configuration succeeds */
482  CrFwCmpReset(inStream3);
483  if (!CrFwCmpIsInInitialized(inStream3))
484  return 0;
485 
488  CrFwCmpReset(inStream3);
489  if (!CrFwCmpIsInInitialized(inStream3))
490  return 0;
491 
494  CrFwCmpReset(inStream3);
495  if (!CrFwCmpIsInInitialized(inStream3))
496  return 0;
497 
500  CrFwCmpReset(inStream3);
501  if (!CrFwCmpIsInConfigured(inStream3))
502  return 0;
503 
504  /* Configure configuration check and action to fail and then check that component reset fails */
506  CrFwCmpReset(inStream3);
507  if (!CrFwCmpIsInInitialized(inStream3))
508  return 0;
509 
510  /* Check application errors */
511  if (CrFwGetAppErrCode() != crNoAppErr)
512  return 0;
513 
514  return 1;
515 }
516 
517 /* ---------------------------------------------------------------------------------------------*/
519  FwSmDesc_t inStream1;
520 
521  /* Create the second InStream */
522  inStream1 = CrFwInStreamMake(1);
523  if (inStream1 == NULL)
524  return 0;
525 
526  /* Check that InStream is in STARTED state */
527  if (CrFwCmpIsStarted(inStream1) != 1)
528  return 0;
529 
530  /* Set up stub to simulate presence of one packet for the host application */
532  CrFwInStreamStubSetPcktGroup(0); /* Second InStream only has one group */
534 
535  /* Bring InStream to state CONFIGURED */
536  FwSmStart(inStream1);
537  CrFwCmpInit(inStream1);
538  CrFwCmpReset(inStream1);
539  if (!CrFwCmpIsInConfigured(inStream1))
540  return 0;
541 
542  /* Check that InStream is in PCKT_AVAIL */
543  if (!CrFwInStreamIsInPcktAvail(inStream1))
544  return 0;
545 
546  /* Shutdown the newly-created InStream */
547  CrFwCmpShutdown(inStream1);
549  return 0;
550 
551  if (CrFwCmpIsStarted(inStream1) != 0)
552  return 0;
553 
554  /* Check application errors */
555  if (CrFwGetAppErrCode() != crNoAppErr)
556  return 0;
557 
558  return 1;
559 }
560 
561 /* ---------------------------------------------------------------------------------------------*/
563  FwSmDesc_t inStream2;
564  CrFwPckt_t pckt1, pckt2, pckt3;
565  CrFwGroup_t i;
566  CrFwCounterU2_t errRepPosLocal;
567 
568  /* Reset the error reporting interface */
570 
571  /* Store the current value of the error report counter */
572  errRepPosLocal = CrFwRepErrStubGetPos();
573 
574  /* Retrieve the third InStream (this InStream must have two groups) */
575  inStream2 = CrFwInStreamMake(2);
576  if (inStream2 == NULL)
577  return 0;
578 
579  /* Start and configure the InStream */
580  FwSmStart(inStream2);
581  CrFwCmpInit(inStream2);
582  CrFwCmpReset(inStream2);
583  if (!CrFwInStreamIsInWaiting(inStream2))
584  return 0;
585 
586  /* Check value of sequence counters */
587  for (i=0; i<CrFwInStreamGetNOfGroups(inStream2); i++)
588  if (CrFwInStreamGetSeqCnt(inStream2,i) != 0)
589  return 0;
590 
591  /* Set up stub to simulate presence of two packets for the host application belonging to first group */
596 
597  /* Send PACKET_AVAILABLE command to InStream */
598  CrFwInStreamPcktAvail(inStream2);
599  if (!CrFwInStreamIsInPcktAvail(inStream2))
600  return 0;
601  if (CrFwInStreamGetNOfPendingPckts(inStream2) != 2)
602  return 0;
603  if (CrFwInStreamGetSeqCnt(inStream2,0) != 102)
604  return 0;
605 
606  /* Set up stub to simulate presence of packet for the host application belonging to second group */
611 
612  /* Send PACKET_AVAILABLE command to InStream */
613  CrFwInStreamPcktAvail(inStream2);
614  if (!CrFwInStreamIsInPcktAvail(inStream2))
615  return 0;
616  if (CrFwInStreamGetNOfPendingPckts(inStream2) != 3)
617  return 0;
618  if (CrFwInStreamGetSeqCnt(inStream2,1) != 201)
619  return 0;
620 
621  /* Send GET_PCKT commands to InStream */
622  pckt1 = CrFwInStreamGetPckt(inStream2);
623  if (!CrFwInStreamIsInPcktAvail(inStream2))
624  return 0;
625  if (CrFwInStreamGetNOfPendingPckts(inStream2) != 2)
626  return 0;
627  if (CrFwPcktGetSeqCnt(pckt1) != 101)
628  return 0;
629 
630  pckt2 = CrFwInStreamGetPckt(inStream2);
631  if (!CrFwInStreamIsInPcktAvail(inStream2))
632  return 0;
633  if (CrFwInStreamGetNOfPendingPckts(inStream2) != 1)
634  return 0;
635  if (CrFwPcktGetSeqCnt(pckt2) != 102)
636  return 0;
637 
638  pckt3 = CrFwInStreamGetPckt(inStream2);
639  if (!CrFwInStreamIsInWaiting(inStream2))
640  return 0;
641  if (CrFwInStreamGetNOfPendingPckts(inStream2) != 0)
642  return 0;
643  if (CrFwPcktGetSeqCnt(pckt3) != 201)
644  return 0;
645 
646  if (CrFwRepErrStubGetPos() != errRepPosLocal)
647  return 0;
648 
649  /* De-allocate packets */
650  CrFwPcktRelease(pckt1);
651  CrFwPcktRelease(pckt2);
652  CrFwPcktRelease(pckt3);
653 
654  /* Set up stub to simulate presence of packet for the host application belonging to non-existent group */
658 
659  /* Send PACKET_AVAILABLE command to InStream */
660  CrFwInStreamPcktAvail(inStream2);
661  if (!CrFwInStreamIsInPcktAvail(inStream2))
662  return 0;
663  if (CrFwInStreamGetNOfPendingPckts(inStream2) != 1)
664  return 0;
665  if (CrFwInStreamGetSeqCnt(inStream2,0) != 102)
666  return 0;
667  if (CrFwInStreamGetSeqCnt(inStream2,1) != 201)
668  return 0;
669 
670  if (CrFwRepErrStubGetPos() != errRepPosLocal+1)
671  return 0;
673  return 0;
674 
675  /* Send GET_PCKT command to InStream */
676  pckt1 = CrFwInStreamGetPckt(inStream2);
677  if (!CrFwInStreamIsInWaiting(inStream2))
678  return 0;
679  if (CrFwInStreamGetNOfPendingPckts(inStream2) != 0)
680  return 0;
681 
682  /* De-allocate packets */
683  CrFwPcktRelease(pckt1);
684 
685  /* Shutdown the InStream */
686  CrFwCmpShutdown(inStream2);
687 
688  /* Check that all packets have been de-allocated */
689  if (CrFwPcktGetNOfAllocated() != 0)
690  return 0;
691 
692  /* Check application errors */
693  if (CrFwGetAppErrCode() != crNoAppErr)
694  return 0;
695 
696  return 1;
697 }
unsigned char CrFwCounterU1_t
Type used for unsigned integers with a "short" range.
CrFwCounterU1_t CrFwInStreamGetPcktQueueSize(FwSmDesc_t smDesc)
Return the size of the packet queue of the InStream.
Definition: CrFwInStream.c:281
Interface through which framework components access the current time.
Declaration of the test cases for the InStream Component (see CrFwInStream.h).
unsigned short CrFwInstanceId_t
Type used for instance identifiers.
void CrFwCmpInit(FwSmDesc_t smDesc)
Initialize a framework component.
Definition: CrFwBaseCmp.c:112
Definition of the Framework Component Data (FCD) Type.
CrFwDestSrc_t CrFwInStreamGetSrc(FwSmDesc_t smDesc)
Get the currently defined packet source of an InStream.
Definition: CrFwInStream.c:246
CrFwBool_t CrFwInStreamIsInWaiting(FwSmDesc_t smDesc)
Return true if the argument InStream is in state WAITING.
Definition: CrFwInStream.c:222
CrFwBool_t CrFwCmpIsInConfigured(FwSmDesc_t smDesc)
Return true if the argument component is in state CONFIGURED.
Definition: CrFwBaseCmp.c:177
void CrFwSetAppErrCode(CrFwAppErrCode_t errCode)
Set the value of the application error code (see CrFwGetAppErrCode).
#define CR_FW_HOST_APP_ID
The identifier of the host application.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:38
CrFwBool_t CrFwCmpIsInCreated(FwSmDesc_t smDesc)
Return true if the argument component is in state CREATED.
Definition: CrFwBaseCmp.c:167
CrFwSeqCnt_t CrFwPcktGetSeqCnt(CrFwPckt_t pckt)
Return the sequence counter of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:223
#define CR_FW_INSTREAM_TYPE
Type identifier for the InStream components.
CrFwBool_t CrFwInStreamTestCase2()
Test the collection of packets from an InStream.
Interface for creating and accessing a report or command packet.
Definition of the InStream component.
CrFwBool_t CrFwInStreamIsInPcktAvail(FwSmDesc_t smDesc)
Return true if the argument InStream is in state PCKT_AVAIL.
Definition: CrFwInStream.c:227
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
Definition: CrFwConstants.h:32
void CrFwInStreamStubSetPcktCollectionCnt(CrFwCounterU1_t cnt)
Set the value of the packet collection counter which defines the number of packets available at the m...
CrFwCounterU1_t CrFwInStreamGetNOfPendingPckts(FwSmDesc_t smDesc)
Return the number of packets currently in the packet queue of an InStream.
Definition: CrFwInStream.c:268
CrFwGroup_t CrFwInStreamGetNOfGroups(FwSmDesc_t smDesc)
Return the number of groups associated to the InStream.
Definition: CrFwInStream.c:275
unsigned char CrFwGroup_t
Type used for the destination or source group of a packet.
CrFwCounterU1_t CrFwInStreamStubGetShutdownCnt()
Get the value of the shutdown counter (see CrFwInStreamStubShutdown).
void CrFwInStreamStubSetPcktSeqCnt(CrFwSeqCnt_t cnt)
Set the value of the sequence counter of the next packet collected (see CrFwInStreamStubPcktCollect)...
CrFwSeqCnt_t CrFwInStreamGetSeqCnt(FwSmDesc_t smDesc, CrFwGroup_t group)
Return the value of the sequence counter of the last packet successfully collected by the InStream fo...
Definition: CrFwInStream.c:253
void CrFwPcktRelease(CrFwPckt_t pckt)
Release function for command or report packets.
Definition: CrFwPckt.c:156
void CrFwRepErrStubReset()
Reset the error reporting interface.
Definition: CrFwRepErr.c:76
CrFwBool_t CrFwCmpIsInInitialized(FwSmDesc_t smDesc)
Return true if the argument component is in state INITIALIZED.
Definition: CrFwBaseCmp.c:172
unsigned char CrFwDestSrc_t
Type used for the command or report destination and source.
Interface for reporting an error detected by a framework component.
CrFwTypeId_t CrFwRepErrStubGetTypeId(CrFwCounterU2_t errRepPos)
Return the type identifier of the error report at position errRepPos.
Definition: CrFwRepErr.c:264
void CrFwInStreamStubSetPcktDest(CrFwDestSrc_t d)
Set the value of the destination of the next packet collected (see CrFwInStreamStubPcktCollect).
#define CR_FW_INSTREAM_SRC
The packet source which is managed by the InStream component.
CrFwRepErrCode_t CrFwRepErrStubGetErrCode(CrFwCounterU2_t errRepPos)
Return the error code of the error report at position errRepPos.
Definition: CrFwRepErr.c:259
unsigned short CrFwCounterU2_t
Type used for unsigned integers with a "medium" range.
CrFwSeqCnt_t CrFwRepErrStubGetExpSeqCnt(CrFwCounterU2_t errRepPos)
Return the expected sequence counter associated to the error report at position errRepPos.
Definition: CrFwRepErr.c:284
CrFwBool_t CrFwInStreamTestCase5()
Test the InStream with checks and actions which may be configured to succeed or fail.
void CrFwInStreamStubSetPcktGroup(CrFwGroup_t group)
Set the value of the group of the next packet collected (see CrFwInStreamStubPcktCollect).
CrFwBool_t CrFwInStreamTestCase4()
Test the error reporting functionalities of an InStream.
An InStream has encountered a sequence counter error (see CrFwInStream.h)
Definition of the utility functions for the CORDET Framework.
CrFwBool_t CrFwInStreamTestCase7()
Test the management of groups by the InStream.
CrFwBool_t CrFwInStreamTestCase1()
Test the initialization and packet queue (PQ) management of the InStream.
void CrFwCmpReset(FwSmDesc_t smDesc)
Reset a framework component.
Definition: CrFwBaseCmp.c:117
A framework function has been called with an illegal InStream identifier.
Interface for the InStream stub.
void CrFwInStreamSetSeqCnt(FwSmDesc_t smDesc, CrFwGroup_t group, CrFwSeqCnt_t seqCnt)
Overwrites the sequence counter value of the last packet for a group.
Definition: CrFwInStream.c:260
#define CR_FW_NOF_INSTREAM
The number of InStream components in the application.
FwSmDesc_t CrFwInStreamGet(CrFwDestSrc_t src)
Getter function for the InStream corresponding to the argument source.
Definition: CrFwInStream.c:211
Definition of Base Component.
The packet queue of an InStream is full (see CrFwInStream.h)
CrFwBool_t CrFwCmpIsStarted(FwSmDesc_t smDesc)
Return true if the state machine of the argument component has been started.
Definition: CrFwBaseCmp.c:162
The CORDET Framework defines an interface for generating error reports (see CrFwRepErr.h).
unsigned short int CrFwPcktLength_t
Type for the packet length.
CrFwCounterU2_t CrFwPcktGetNOfAllocated()
Return the number of packets which are currently allocated.
Definition: CrFwPckt.c:196
CrFwSeqCnt_t CrFwRepErrStubGetActualSeqCnt(CrFwCounterU2_t errRepPos)
Return the actual sequence counter associated to the error report at position errRepPos.
Definition: CrFwRepErr.c:290
CrFwCounterU2_t CrFwRepErrStubGetPos()
Return the position in the error report array at which the next error report will be written...
Definition: CrFwRepErr.c:71
FwSmDesc_t CrFwInStreamMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th InStream State Machine instance.
Definition: CrFwInStream.c:121
void CrFwInStreamStubSetActionFlag(CrFwBool_t flag)
Set the value of the action flag which determines the outcome of the initialization or configuration ...
void CrFwInStreamPcktAvail(FwSmDesc_t smDesc)
Query the middleware for available packets and collect them if they are available.
Definition: CrFwInStream.c:241
CrFwPckt_t CrFwInStreamGetPckt(FwSmDesc_t smDesc)
Retrieve a packet from the InStream.
Definition: CrFwInStream.c:232
A framework function has been called with a source attribute which is not associated to any InStream...
void CrFwInStreamStubSetCheckFlag(CrFwBool_t flag)
Set the value of the check flag which determines the outcome of the dummy check of CrFwInStreamStubDu...
User-modifiable parameters for the InStream components (see CrFwInStream.h).
CrFwInstanceId_t CrFwRepErrStubGetInstanceId(CrFwCounterU2_t errRepPos)
Return the type identifier of the error report at position errRepPos.
Definition: CrFwRepErr.c:269
CrFwBool_t CrFwInStreamTestCase6()
Test the function to override the Shutdown Operation of an InStream and to verify entry into PCKT_AVA...
void CrFwCmpShutdown(FwSmDesc_t smDesc)
Shutdown a framework component.
Definition: CrFwBaseCmp.c:122
No application errors have been detected.
CrFwBool_t CrFwInStreamTestCase3()
Test the self-transition on state PCKT_AVAIL and the shutdown of an InStream.
CrFwAppErrCode_t CrFwGetAppErrCode()
Return the value of the application error code.
unsigned int CrFwSeqCnt_t
Type used for the sequence counter of commands or reports.
An incoming command or report has an illegal group.
static CrFwDestSrc_t inStreamSrc[CR_FW_NOF_INSTREAM]
The sources associated to the InStream components.
Definition: CrFwInStream.c:76
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved