CORDET Framework - C2 Implementation
CrFwInLoaderTestCases.c
Go to the documentation of this file.
1 
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include "CrFwInLoaderTestCases.h"
22 #include "CrFwInCmdSample1.h"
23 #include "CrFwInRepSample1.h"
25 /* Include FW Profile files */
26 #include "FwSmConstants.h"
27 #include "FwSmConfig.h"
28 #include "FwSmCore.h"
29 #include "FwPrConfig.h"
30 #include "FwPrCore.h"
31 #include "FwPrConstants.h"
32 /* Include framework files */
34 #include "BaseCmp/CrFwBaseCmp.h"
35 #include "Pckt/CrFwPckt.h"
36 #include "InRep/CrFwInRep.h"
37 #include "InCmd/CrFwInCmd.h"
38 #include "InStream/CrFwInStream.h"
41 #include "CrFwTime.h"
42 #include "CrFwRepErr.h"
44 /* Include configuration files */
45 #include "CrFwInRegistryUserPar.h"
46 #include "CrFwOutStreamUserPar.h"
47 #include "CrFwInLoaderUserPar.h"
48 #include "CrFwInStreamStub.h"
49 #include "CrFwOutStreamStub.h"
50 #include "CrFwRepErrStub.h"
51 #include "CrFwInFactoryUserPar.h"
52 #include "CrFwOutFactoryUserPar.h"
53 #include "CrFwCmpData.h"
54 #include "CrFwRepInCmdOutcome.h"
55 
58 
59 /* ---------------------------------------------------------------------------------------------*/
65  reroutingDest = retValue;
66 }
67 
68 /* ---------------------------------------------------------------------------------------------*/
70  (void)(pcktDest);
71  return reroutingDest;
72 }
73 
74 /* ---------------------------------------------------------------------------------------------*/
76  FwSmDesc_t inLoader;
77 
78  /* Instantiate the InLoader */
80 
81  /* Check current state of InLoader */
83  return 0;
84 
85  /* Initialize and Configure InLoader and check success */
88  return 0;
91  return 0;
92 
93  /* Check Instance and Type Identifiers */
95  return 0;
97  return 0;
98 
99  /* Check default implementation of function which re-routes a destination */
101  return 0;
103  return 0;
105  return 0;
106 
107  /* Check default implementation of function which re-routes a destination */
108  if (CrFwInLoaderDefNoRerouting(1) != 0)
109  return 0;
110  if (CrFwInLoaderDefNoRerouting(0) != 0)
111  return 0;
112  if (CrFwInLoaderDefNoRerouting(2) != 0)
113  return 0;
114 
115  /* Check default implementation of function which selects the InManager */
116  if (CrFwInLoaderDefGetInManager(0,0,0,crCmdType) != 0)
117  return 0;
118  if (CrFwInLoaderDefGetInManager(0,0,0,crRepType) != 1)
119  return 0;
120 
121  /* Check that there are no allocated packets */
122  if (CrFwPcktGetNOfAllocated() != 0)
123  return 0;
124 
125  /* Check application errors */
126  if (CrFwGetAppErrCode() != crNoAppErr)
127  return 0;
128 
129  return 1;
130 }
131 
132 /* ---------------------------------------------------------------------------------------------*/
134  FwSmDesc_t inLoader, inStream;
135  CrFwCounterU2_t errRepPosLocal;
136 
137  /* Store the current value of the error report counter */
138  errRepPosLocal = CrFwRepErrStubGetPos();
139 
140  /* Instantiate, initialize and configure the InLoader */
145  return 0;
146 
147  /* Create InStream and configure it to have no pending packet */
148  inStream = CrFwInStreamMake(0);
150  CrFwCmpInit(inStream);
151  CrFwCmpReset(inStream);
152  if (!CrFwCmpIsInConfigured(inStream))
153  return 0;
154 
155  /* Configure InLoader to return "destination invalid" */
157 
158  /* Load InStream in the InLoader and execute InLoader*/
159  CrFwInLoaderSetInStream(inStream);
161 
162  /* Check that no error report has been generated */
163  if (CrFwRepErrStubGetPos() != errRepPosLocal)
164  return 0;
165 
166  /* Check that there are no allocated packets */
167  if (CrFwPcktGetNOfAllocated() != 0)
168  return 0;
169 
170  /* Check application errors */
171  if (CrFwGetAppErrCode() != crNoAppErr)
172  return 0;
173 
174  return 1;
175 }
176 
177 /* ---------------------------------------------------------------------------------------------*/
179  FwSmDesc_t inLoader, inStream;
180  CrFwCounterU2_t errRepPosLocal;
181 
182  /* Store the current value of the error report counter */
183  errRepPosLocal = CrFwRepErrStubGetPos();
184 
185  /* Instantiate, initialize and configure the InLoader */
190  return 0;
191 
192  /* Create InStream and configure it to have one pending packet for another application */
193  inStream = CrFwInStreamMake(0);
194  CrFwInStreamStubSetPcktDest(CR_FW_HOST_APP_ID+1); /* Packet destination is not the host application */
195  CrFwInStreamStubSetPcktCollectionCnt(1); /* One pending packet in InStream */
196  CrFwInStreamStubSetPcktCmdRepId(111); /* Define command/report identifier */
197  CrFwCmpInit(inStream);
198  CrFwCmpReset(inStream);
199  if (!CrFwCmpIsInConfigured(inStream))
200  return 0;
201 
202  /* Configure InLoader to return "destination invalid" */
204 
205  /* Load InStream in the InLoader and execute InLoader*/
206  CrFwInLoaderSetInStream(inStream);
208 
209  /* Check that an error report has been generated */
210  if (CrFwRepErrStubGetPos() != errRepPosLocal + 1)
211  return 0;
213  return 0;
215  return 0;
217  return 0;
219  return 0;
221  return 0;
222 
223  /* Check that there are no allocated packets */
224  if (CrFwPcktGetNOfAllocated() != 0)
225  return 0;
226 
227  /* Check application errors */
228  if (CrFwGetAppErrCode() != crNoAppErr)
229  return 0;
230 
231  return 1;
232 }
233 
234 /* ---------------------------------------------------------------------------------------------*/
236  FwSmDesc_t inLoader, inStream, outStream;
237  CrFwCounterU2_t errRepPosLocal;
238  CrFwCounterU1_t handoverCnt;
239 
240  /* Store the current value of the OutStream packet handover counter */
241  handoverCnt = CrFwOutStreamStubGetHandoverCnt();
242 
243  /* Store the current value of the error report counter */
244  errRepPosLocal = CrFwRepErrStubGetPos();
245 
246  /* Instantiate, initialize and configure the InLoader */
251  return 0;
252 
253  /* Create InStream and configure it to be in state AVAIL with one pending packet */
254  inStream = CrFwInStreamMake(0);
256  CrFwCmpInit(inStream);
257  CrFwCmpReset(inStream);
258  if (!CrFwCmpIsInConfigured(inStream))
259  return 0;
260  if (!CrFwInStreamIsInPcktAvail(inStream))
261  return 0;
262  if (CrFwInStreamGetNOfPendingPckts(inStream) != 1)
263  return 0;
264 
265  /* Create OutStream */
266  outStream = CrFwOutStreamMake(0);
267  FwSmStart(outStream);
268  CrFwCmpInit(outStream);
269  CrFwCmpReset(outStream);
270  if (!CrFwCmpIsInConfigured(outStream))
271  return 0;
272  CrFwOutStreamStubSetHandoverFlag(1); /* Configure Packet Hand-Over Operation to return "hand-over successful" */
273  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0) /* Check that there are no pending packets */
274  return 0;
275 
276  /* Configure InLoader to return first destination associated to OutStream */
277  CrFwDestSrc_t dest = CrFwOutStreamGetDest(outStream, 1);
279 
280  /* Load InStream in the InLoader and execute InLoader*/
281  CrFwInLoaderSetInStream(inStream);
283 
284  /* Check that a packet was loaded into the OutStream and was passed on to the middleware */
285  if (CrFwOutStreamStubGetHandoverCnt() != handoverCnt + 1)
286  return 0;
287  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0)
288  return 0;
289 
290  /* Check that no error report has been generated */
291  if (CrFwRepErrStubGetPos() != errRepPosLocal)
292  return 0;
293 
294  /* Check that there are no allocated packets */
295  if (CrFwPcktGetNOfAllocated() != 0)
296  return 0;
297 
298  /* Check application errors */
299  if (CrFwGetAppErrCode() != crNoAppErr)
300  return 0;
301 
302  return 1;
303 }
304 
305 /* ---------------------------------------------------------------------------------------------*/
307  FwSmDesc_t inLoader, inStream, outStream, inFactory;
308  CrFwCounterU2_t errRepPosLocal;
309  CrFwCounterU1_t handoverCnt;
310  CrFwCounterU2_t cmdRepPos;
311 
312  /* Store the current value of the command report counter */
313  cmdRepPos = CrFwRepInCmdOutcomeStubGetPos();
314 
315  /* Store the current value of the OutStream packet handover counter */
316  handoverCnt = CrFwOutStreamStubGetHandoverCnt();
317 
318  /* Store the current value of the error report counter */
319  errRepPosLocal = CrFwRepErrStubGetPos();
320 
321  /* Instantiate, initialize and configure the InLoader */
326  return 0;
327 
328  /* Create InStream and configure it to be in state AVAIL with one pending packet */
329  inStream = CrFwInStreamMake(0);
330  CrFwInStreamStubSetPcktCollectionCnt(1); /* One pending packet in InStream */
331  CrFwInStreamStubSetPcktType(0,0,0); /* Set packet type to invalid */
332  CrFwInStreamStubSetPcktDest(CR_FW_HOST_APP_ID); /* Set packet destination to current destination */
333  CrFwInStreamStubSetPcktCmdRepType(crRepType); /* Define packet as InReport */
334  CrFwInStreamStubSetPcktCmdRepId(111); /* Define command/report identifier */
335  CrFwCmpInit(inStream);
336  CrFwCmpReset(inStream);
337  if (!CrFwCmpIsInConfigured(inStream))
338  return 0;
339  if (!CrFwInStreamIsInPcktAvail(inStream))
340  return 0;
341  if (CrFwInStreamGetNOfPendingPckts(inStream) != 1)
342  return 0;
343 
344  /* Create OutStream */
345  outStream = CrFwOutStreamMake(0);
346  FwSmStart(outStream);
347  CrFwCmpInit(outStream);
348  CrFwCmpReset(outStream);
349  if (!CrFwCmpIsInConfigured(outStream))
350  return 0;
351  CrFwOutStreamStubSetHandoverFlag(1); /* Configure Packet Hand-Over Operation to return "hand-over successful" */
352  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0) /* Check that there are no pending packets */
353  return 0;
354 
355  /* Create InFactory */
360  return 0;
361 
362  /* Load InStream in the InLoader and execute InLoader*/
363  CrFwInLoaderSetInStream(inStream);
365 
366  /* Check that no packet was loaded into the OutStream */
367  if (CrFwOutStreamStubGetHandoverCnt() != handoverCnt)
368  return 0;
369  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0)
370  return 0;
371 
372  /* Check application error */
374  return 0;
376 
377  /* Check that error report has been generated */
378  if (CrFwRepErrStubGetPos() != errRepPosLocal+1)
379  return 0;
381  return 0;
383  return 0;
385  return 0;
386 
387  /* Load the InStream with a packet representing an InCommand */
388  CrFwInStreamStubSetPcktCollectionCnt(1); /* One pending packet in InStream */
389  CrFwInStreamStubSetPcktType(0,1,2); /* Set packet type to invalid */
390  CrFwInStreamStubSetPcktDest(CR_FW_HOST_APP_ID); /* Set packet destination to current destination */
391  CrFwInStreamStubSetPcktCmdRepType(crCmdType); /* Define packet as InReport */
392  CrFwInStreamStubSetPcktCmdRepId(111); /* Define command/report identifier */
393  CrFwCmpReset(inStream);
394 
395  /* Execute InLoader*/
397 
398  /* Check that no packet was loaded into the OutStream */
399  if (CrFwOutStreamStubGetHandoverCnt() != handoverCnt)
400  return 0;
401  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0)
402  return 0;
403 
404  /* Check application error */
406  return 0;
408 
409  /* Check that acceptance failure report has been generated */
410  if (CrFwRepInCmdOutcomeStubGetPos() != cmdRepPos+1)
411  return 0;
413  return 0;
414  if (CrFwRepInCmdOutcomeStubGetFailCode(cmdRepPos) != 0)
415  return 0;
416  if (CrFwRepInCmdOutcomeStubGetServType(cmdRepPos) != 0)
417  return 0;
418  if (CrFwRepInCmdOutcomeStubGetServSubType(cmdRepPos) != 1)
419  return 0;
420  if (CrFwRepInCmdOutcomeStubGetDiscriminant(cmdRepPos) != 2)
421  return 0;
422 
423  /* Check that no error reports were generated */
424  if (CrFwRepErrStubGetPos() != errRepPosLocal+1)
425  return 0;
426 
427  /* Check that there are no allocated packets */
428  if (CrFwPcktGetNOfAllocated() != 0)
429  return 0;
430 
431  /* Check application errors */
432  if (CrFwGetAppErrCode() != crNoAppErr)
433  return 0;
434 
435  return 1;
436 }
437 
438 /* ---------------------------------------------------------------------------------------------*/
440  FwSmDesc_t inLoader, inStream, outStream, inFactory;
441  CrFwCounterU2_t errRepPosLocal;
442  CrFwCounterU1_t handoverCnt;
443  CrFwCounterU2_t cmdRepPos;
444  CrFwCounterU2_t i;
445  CrFwPckt_t inRepPckt, inCmdPckt;
446  FwSmDesc_t inRepArray[CR_FW_INFACTORY_MAX_NOF_INREP];
447  FwSmDesc_t inCmdArray[CR_FW_INFACTORY_MAX_NOF_INCMD];
448 
449  /* Store the current value of the command report counter */
450  cmdRepPos = CrFwRepInCmdOutcomeStubGetPos();
451 
452  /* Store the current value of the OutStream packet handover counter */
453  handoverCnt = CrFwOutStreamStubGetHandoverCnt();
454 
455  /* Store the current value of the error report counter */
456  errRepPosLocal = CrFwRepErrStubGetPos();
457 
458  /* Instantiate, initialize and configure the InLoader */
463  return 0;
464 
465  /* Create InStream and configure it to be in state AVAIL with one pending packet */
466  inStream = CrFwInStreamMake(0);
467  CrFwInStreamStubSetPcktCollectionCnt(1); /* One pending packet in InStream */
468  CrFwInStreamStubSetPcktType(5,1,1); /* Set packet type to a valid value */
469  CrFwInStreamStubSetPcktDest(CR_FW_HOST_APP_ID); /* Set packet destination to current destination */
470  CrFwInStreamStubSetPcktCmdRepType(crRepType); /* Define packet as InReport */
471  CrFwInStreamStubSetPcktCmdRepId(111); /* Define command/report identifier */
472  CrFwCmpInit(inStream);
473  CrFwCmpReset(inStream);
474  if (!CrFwCmpIsInConfigured(inStream))
475  return 0;
476  if (!CrFwInStreamIsInPcktAvail(inStream))
477  return 0;
478  if (CrFwInStreamGetNOfPendingPckts(inStream) != 1)
479  return 0;
480 
481  /* Create OutStream */
482  outStream = CrFwOutStreamMake(0);
483  FwSmStart(outStream);
484  CrFwCmpInit(outStream);
485  CrFwCmpReset(outStream);
486  if (!CrFwCmpIsInConfigured(outStream))
487  return 0;
488  CrFwOutStreamStubSetHandoverFlag(1); /* Configure Packet Hand-Over Operation to return "hand-over successful" */
489  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0) /* Check that there are no pending packets */
490  return 0;
491 
492  /* Create InFactory */
497  return 0;
498 
499  /* Configure InFactory to have no spare InReports */
500  for (i=0; i<CR_FW_INFACTORY_MAX_NOF_INREP; i++) {
501  inRepPckt = CrFwPcktMake(100);
502  CrFwPcktSetServType(inRepPckt,5);
503  CrFwPcktSetServSubType(inRepPckt,1);
504  CrFwPcktSetDiscriminant(inRepPckt,1);
505  inRepArray[i] = CrFwInFactoryMakeInRep(inRepPckt);
506  if (inRepArray[i]==NULL)
507  return 0;
508  }
509 
510  /* Load InStream in the InLoader and execute InLoader*/
511  CrFwInLoaderSetInStream(inStream);
513 
514  /* Check that no packet was loaded into the OutStream */
515  if (CrFwOutStreamStubGetHandoverCnt() != handoverCnt)
516  return 0;
517  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0)
518  return 0;
519 
520  /* Check application error */
522  return 0;
524 
525  /* Check that error report has been generated */
526  if (CrFwRepErrStubGetPos() != errRepPosLocal+1)
527  return 0;
529  return 0;
531  return 0;
533  return 0;
534 
535  /* Release all InReports */
536  for (i=0; i<CR_FW_INFACTORY_MAX_NOF_INREP; i++)
537  CrFwInFactoryReleaseInRep(inRepArray[i]);
538 
539  /* Load the InStream with a packet representing an InCommand */
540  CrFwInStreamStubSetPcktCollectionCnt(1); /* One pending packet in InStream */
541  CrFwInStreamStubSetPcktType(8,1,1); /* Set packet type to invalid */
542  CrFwInStreamStubSetPcktDest(CR_FW_HOST_APP_ID); /* Set packet destination to current destination */
543  CrFwInStreamStubSetPcktCmdRepType(crCmdType); /* Define packet as InReport */
544  CrFwInStreamStubSetPcktCmdRepId(111); /* Define command/report identifier */
545  CrFwCmpReset(inStream);
546 
547  /* Configure InFactory to have no spare InCommands */
548  for (i=0; i<CR_FW_INFACTORY_MAX_NOF_INCMD; i++) {
549  inCmdPckt = CrFwPcktMake(100);
550  CrFwPcktSetServType(inCmdPckt,8);
551  CrFwPcktSetServSubType(inCmdPckt,1);
552  CrFwPcktSetDiscriminant(inCmdPckt,1);
553  inCmdArray[i] = CrFwInFactoryMakeInCmd(inCmdPckt);
554  if (inCmdArray[i]==NULL)
555  return 0;
556  }
557 
558  /* Execute InLoader*/
560 
561  /* Check that no packet was loaded into the OutStream */
562  if (CrFwOutStreamStubGetHandoverCnt() != handoverCnt)
563  return 0;
564  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0)
565  return 0;
566 
567  /* Check application error */
569  return 0;
571 
572  /* Check that acceptance failure report has been generated */
573  if (CrFwRepInCmdOutcomeStubGetPos() != cmdRepPos+1)
574  return 0;
576  return 0;
577  if (CrFwRepInCmdOutcomeStubGetFailCode(cmdRepPos) != 0)
578  return 0;
579  if (CrFwRepInCmdOutcomeStubGetServType(cmdRepPos) != 8)
580  return 0;
581  if (CrFwRepInCmdOutcomeStubGetServSubType(cmdRepPos) != 1)
582  return 0;
583  if (CrFwRepInCmdOutcomeStubGetDiscriminant(cmdRepPos) != 1)
584  return 0;
585 
586  /* Check that no error reports were generated */
587  if (CrFwRepErrStubGetPos() != errRepPosLocal+1)
588  return 0;
589 
590  /* Release all InCommands */
591  for (i=0; i<CR_FW_INFACTORY_MAX_NOF_INCMD; i++)
592  CrFwInFactoryReleaseInCmd(inCmdArray[i]);
593 
594  /* Check that there are no allocated packets */
595  if (CrFwPcktGetNOfAllocated() != 0)
596  return 0;
597 
598  /* Check application errors */
599  if (CrFwGetAppErrCode() != crNoAppErr)
600  return 0;
601 
602  return 1;
603 }
604 
605 /* ---------------------------------------------------------------------------------------------*/
607  FwSmDesc_t inLoader, inStream, outStream, inFactory;
608  CrFwCounterU2_t errRepPosLocal;
609  CrFwCounterU1_t handoverCnt;
610  CrFwCounterU2_t cmdRepPos;
611 
612  /* Store the current value of the command report counter */
613  cmdRepPos = CrFwRepInCmdOutcomeStubGetPos();
614 
615  /* Store the current value of the OutStream packet handover counter */
616  handoverCnt = CrFwOutStreamStubGetHandoverCnt();
617 
618  /* Store the current value of the error report counter */
619  errRepPosLocal = CrFwRepErrStubGetPos();
620 
621  /* Instantiate, initialize and configure the InLoader */
626  return 0;
627 
628  /* Create InStream and configure it to be in state AVAIL with one pending packet */
629  inStream = CrFwInStreamMake(0);
630  CrFwInStreamStubSetPcktCollectionCnt(1); /* One pending packet in InStream */
631  CrFwInStreamStubSetPcktType(40,1,0); /* Set packet type to be Sample 1 InReport */
632  CrFwInStreamStubSetPcktDest(CR_FW_HOST_APP_ID); /* Set packet destination to current destination */
633  CrFwInStreamStubSetPcktCmdRepType(crRepType); /* Define packet as InReport */
634  CrFwInStreamStubSetPcktCmdRepId(111); /* Define command/report identifier */
635  CrFwInRepSample1SetValidityFlag(0); /* Validity Check of InReport will fail */
636  CrFwCmpInit(inStream);
637  CrFwCmpReset(inStream);
638  if (!CrFwCmpIsInConfigured(inStream))
639  return 0;
640  if (!CrFwInStreamIsInPcktAvail(inStream))
641  return 0;
642  if (CrFwInStreamGetNOfPendingPckts(inStream) != 1)
643  return 0;
644 
645  /* Create OutStream */
646  outStream = CrFwOutStreamMake(0);
647  FwSmStart(outStream);
648  CrFwCmpInit(outStream);
649  CrFwCmpReset(outStream);
650  if (!CrFwCmpIsInConfigured(outStream))
651  return 0;
652  CrFwOutStreamStubSetHandoverFlag(1); /* Configure Packet Hand-Over Operation to return "hand-over successful" */
653  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0) /* Check that there are no pending packets */
654  return 0;
655 
656  /* Create InFactory */
661  return 0;
662 
663  /* Load InStream in the InLoader and execute InLoader*/
664  CrFwInLoaderSetInStream(inStream);
666 
667  /* Check that no packet was loaded into the OutStream */
668  if (CrFwOutStreamStubGetHandoverCnt() != handoverCnt)
669  return 0;
670  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0)
671  return 0;
672 
673  /* Check that error report has been generated */
674  if (CrFwRepErrStubGetPos() != errRepPosLocal+1)
675  return 0;
677  return 0;
679  return 0;
680 
681  /* Load the InStream with a packet representing an InCommand */
682  CrFwInStreamStubSetPcktCollectionCnt(1); /* One pending packet in InStream */
683  CrFwInStreamStubSetPcktType(50,1,0); /* Set packet type to Sample 1 InCommand */
684  CrFwInStreamStubSetPcktDest(CR_FW_HOST_APP_ID); /* Set packet destination to current destination */
685  CrFwInStreamStubSetPcktCmdRepType(crCmdType); /* Define packet as InReport */
686  CrFwInStreamStubSetPcktCmdRepId(111); /* Define command/report identifier */
687  CrFwInCmdSample1SetValidityFlag(0); /* Validity Check of InCommand will fail */
688  CrFwCmpReset(inStream);
689 
690  /* Execute InLoader*/
692 
693  /* Check that no packet was loaded into the OutStream */
694  if (CrFwOutStreamStubGetHandoverCnt() != handoverCnt)
695  return 0;
696  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0)
697  return 0;
698 
699  /* Check that acceptance failure report has been generated */
700  if (CrFwRepInCmdOutcomeStubGetPos() != cmdRepPos+1)
701  return 0;
703  return 0;
704  if (CrFwRepInCmdOutcomeStubGetFailCode(cmdRepPos) != 0)
705  return 0;
706  if (CrFwRepInCmdOutcomeStubGetServType(cmdRepPos) != 50)
707  return 0;
708  if (CrFwRepInCmdOutcomeStubGetServSubType(cmdRepPos) != 1)
709  return 0;
710  if (CrFwRepInCmdOutcomeStubGetDiscriminant(cmdRepPos) != 0)
711  return 0;
712 
713  /* Check that no error reports were generated */
714  if (CrFwRepErrStubGetPos() != errRepPosLocal+1)
715  return 0;
716 
717  /* Check that there are no allocated packets */
718  if (CrFwPcktGetNOfAllocated() != 0)
719  return 0;
720 
721  /* Check application errors */
722  if (CrFwGetAppErrCode() != crNoAppErr)
723  return 0;
724 
725  return 1;
726 }
727 
728 /* ---------------------------------------------------------------------------------------------*/
730  FwSmDesc_t inLoader, inStream, outStream, inFactory, inManager;
731  CrFwCounterU2_t errRepPosLocal;
732  CrFwCounterU1_t handoverCnt;
733  CrFwCounterU2_t cmdRepPos;
734  CrFwCounterU2_t i;
735  CrFwPckt_t pckt;
736 
737  /* Store the current value of the command report counter */
738  cmdRepPos = CrFwRepInCmdOutcomeStubGetPos();
739 
740  /* Store the current value of the OutStream packet handover counter */
741  handoverCnt = CrFwOutStreamStubGetHandoverCnt();
742 
743  /* Store the current value of the error report counter */
744  errRepPosLocal = CrFwRepErrStubGetPos();
745 
746  /* Instantiate, initialize and configure the InLoader */
751  return 0;
752 
753  /* Create InStream and configure it to be in state AVAIL with one pending packet */
754  inStream = CrFwInStreamMake(0);
755  CrFwInStreamStubSetPcktCollectionCnt(1); /* One pending packet in InStream */
756  CrFwInStreamStubSetPcktType(40,1,0); /* Set packet type to be Sample 1 InReport */
757  CrFwInStreamStubSetPcktDest(CR_FW_HOST_APP_ID); /* Set packet destination to current destination */
758  CrFwInStreamStubSetPcktCmdRepType(crRepType); /* Define packet as InReport */
759  CrFwInStreamStubSetPcktCmdRepId(111); /* Define command/report identifier */
760  CrFwInRepSample1SetValidityFlag(1); /* Validity Check of InReport will succeed */
761  CrFwCmpInit(inStream);
762  CrFwCmpReset(inStream);
763  if (!CrFwCmpIsInConfigured(inStream))
764  return 0;
765  if (!CrFwInStreamIsInPcktAvail(inStream))
766  return 0;
767  if (CrFwInStreamGetNOfPendingPckts(inStream) != 1)
768  return 0;
769 
770  /* Create OutStream */
771  outStream = CrFwOutStreamMake(0);
772  FwSmStart(outStream);
773  CrFwCmpInit(outStream);
774  CrFwCmpReset(outStream);
775  if (!CrFwCmpIsInConfigured(outStream))
776  return 0;
777  CrFwOutStreamStubSetHandoverFlag(1); /* Configure Packet Hand-Over Operation to return "hand-over successful" */
778  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0) /* Check that there are no pending packets */
779  return 0;
780 
781  /* Create InFactory */
786  return 0;
787 
788  /* Create InManager for InReports and configure it to be full */
789  inManager = CrFwInManagerMake(1); /* InManager for InReports */
790  CrFwCmpInit(inManager);
791  CrFwCmpReset(inManager);
792  if (!CrFwCmpIsInConfigured(inManager))
793  return 0;
794  for (i=0; i<CrFwInManagerGetPCRLSize(inManager); i++) {
795  pckt = CrFwPcktMake(100);
796  CrFwPcktSetServType(pckt,5);
797  CrFwPcktSetServSubType(pckt,1);
798  CrFwPcktSetDiscriminant(pckt,1);
799  CrFwInManagerLoad(inManager, CrFwInFactoryMakeInRep(pckt));
800  }
801 
802  /* Load InStream in the InLoader and execute InLoader*/
803  CrFwInLoaderSetInStream(inStream);
805 
806  /* Check that no packet was loaded into the OutStream */
807  if (CrFwOutStreamStubGetHandoverCnt() != handoverCnt)
808  return 0;
809  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0)
810  return 0;
811 
812  /* Check that error reports have been generated (one by the Load operation of the InManager
813  * and one by the InLoader) */
814  if (CrFwRepErrStubGetPos() != errRepPosLocal+2)
815  return 0;
817  return 0;
819  return 0;
821  return 0;
822 
823  /* Reset the InManager (this should clear the PCRL and release all loaded components) */
824  CrFwCmpReset(inManager);
825 
826  /* Create InManager for InCommands and configure it to be full */
827  inManager = CrFwInManagerMake(0); /* InManager for InCommands */
828  CrFwCmpInit(inManager);
829  CrFwCmpReset(inManager);
830  if (!CrFwCmpIsInConfigured(inManager))
831  return 0;
832  for (i=0; i<CrFwInManagerGetPCRLSize(inManager); i++) {
833  pckt = CrFwPcktMake(100);
834  CrFwPcktSetServType(pckt,8);
835  CrFwPcktSetServSubType(pckt,1);
836  CrFwPcktSetDiscriminant(pckt,1);
837  CrFwInManagerLoad(inManager, CrFwInFactoryMakeInCmd(pckt));
838  }
839 
840  /* Load the InStream with a packet representing an InCommand */
841  CrFwInStreamStubSetPcktCollectionCnt(1); /* One pending packet in InStream */
842  CrFwInStreamStubSetPcktType(50,1,0); /* Set packet type to Sample 1 InCommand */
843  CrFwInStreamStubSetPcktDest(CR_FW_HOST_APP_ID); /* Set packet destination to current destination */
844  CrFwInStreamStubSetPcktCmdRepType(crCmdType); /* Define packet as InCommand */
845  CrFwInStreamStubSetPcktCmdRepId(111); /* Define command/report identifier */
846  CrFwInCmdSample1SetValidityFlag(1); /* Validity Check of InCommand will succeed */
847  CrFwCmpReset(inStream);
848 
849  /* Execute InLoader*/
851 
852  /* Check that no packet was loaded into the OutStream */
853  if (CrFwOutStreamStubGetHandoverCnt() != handoverCnt)
854  return 0;
855  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0)
856  return 0;
857 
858  /* Check that acceptance failure report has been generated */
859  if (CrFwRepInCmdOutcomeStubGetPos() != cmdRepPos+1)
860  return 0;
862  return 0;
863  if (CrFwRepInCmdOutcomeStubGetFailCode(cmdRepPos) != 0)
864  return 0;
865  if (CrFwRepInCmdOutcomeStubGetServType(cmdRepPos) != 50)
866  return 0;
867  if (CrFwRepInCmdOutcomeStubGetServSubType(cmdRepPos) != 1)
868  return 0;
869  if (CrFwRepInCmdOutcomeStubGetDiscriminant(cmdRepPos) != 0)
870  return 0;
871 
872  /* Check that no error reports were generated (other than the one generated by the load
873  * operation on the InManager) */
874  if (CrFwRepErrStubGetPos() != errRepPosLocal+3)
875  return 0;
877  return 0;
878 
879  /* Reset the InManager (this should clear the PCRL and release all loaded components) */
880  CrFwCmpReset(inManager);
881 
882  /* Check that there are no allocated packets */
883  if (CrFwPcktGetNOfAllocated() != 0)
884  return 0;
885 
886  /* Check application errors */
887  if (CrFwGetAppErrCode() != crNoAppErr)
888  return 0;
889 
890  return 1;
891 }
892 
893 /* ---------------------------------------------------------------------------------------------*/
895  FwSmDesc_t inLoader, inStream, outStream, inFactory, inManager;
896  CrFwCounterU2_t errRepPosLocal;
897  CrFwCounterU1_t handoverCnt;
898  CrFwCounterU2_t cmdRepPos;
899 
900  /* Store the current value of the command report counter */
901  cmdRepPos = CrFwRepInCmdOutcomeStubGetPos();
902 
903  /* Store the current value of the OutStream packet handover counter */
904  handoverCnt = CrFwOutStreamStubGetHandoverCnt();
905 
906  /* Store the current value of the error report counter */
907  errRepPosLocal = CrFwRepErrStubGetPos();
908 
909  /* Instantiate, initialize and configure the InLoader */
914  return 0;
915 
916  /* Create InStream and configure it to be in state AVAIL with one pending packet */
917  inStream = CrFwInStreamMake(0);
918  CrFwInStreamStubSetPcktCollectionCnt(1); /* One pending packet in InStream */
919  CrFwInStreamStubSetPcktType(40,1,0); /* Set packet type to be Sample 1 InReport */
920  CrFwInStreamStubSetPcktDest(CR_FW_HOST_APP_ID); /* Set packet destination to current destination */
921  CrFwInStreamStubSetPcktCmdRepType(crRepType); /* Define packet as InReport */
922  CrFwInStreamStubSetPcktCmdRepId(111); /* Define command/report identifier */
923  CrFwInRepSample1SetValidityFlag(1); /* Validity Check of InReport will succeed */
924  CrFwCmpInit(inStream);
925  CrFwCmpReset(inStream);
926  if (!CrFwCmpIsInConfigured(inStream))
927  return 0;
928  if (!CrFwInStreamIsInPcktAvail(inStream))
929  return 0;
930  if (CrFwInStreamGetNOfPendingPckts(inStream) != 1)
931  return 0;
932 
933  /* Create OutStream */
934  outStream = CrFwOutStreamMake(0);
935  FwSmStart(outStream);
936  CrFwCmpInit(outStream);
937  CrFwCmpReset(outStream);
938  if (!CrFwCmpIsInConfigured(outStream))
939  return 0;
940  CrFwOutStreamStubSetHandoverFlag(1); /* Configure Packet Hand-Over Operation to return "hand-over successful" */
941  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0) /* Check that there are no pending packets */
942  return 0;
943 
944  /* Create InFactory */
949  return 0;
950 
951  /* Create InManager for InReports */
952  inManager = CrFwInManagerMake(1); /* InManager for InReports */
953  CrFwCmpInit(inManager);
954  CrFwCmpReset(inManager);
955  if (!CrFwCmpIsInConfigured(inManager))
956  return 0;
957 
958  /* Load InStream in the InLoader and execute InLoader*/
959  CrFwInLoaderSetInStream(inStream);
961 
962  /* Check that no packet was loaded into the OutStream */
963  if (CrFwOutStreamStubGetHandoverCnt() != handoverCnt)
964  return 0;
965  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0)
966  return 0;
967 
968  /* Check that one component has been loaded in the InManager */
969  if (CrFwInManagerGetNOfPendingInCmp(inManager) != 1)
970  return 0;
971 
972  /* Reset the InManager (this should clear the PCRL and release all loaded components) */
973  CrFwCmpReset(inManager);
974 
975  /* Check that no command reports were generated */
976  if (CrFwRepInCmdOutcomeStubGetPos() != cmdRepPos)
977  return 0;
978 
979  /* Check that no error reports were generated */
980  if (CrFwRepErrStubGetPos() != errRepPosLocal)
981  return 0;
983  return 0;
984 
985  /* Check that there are no allocated packets */
986  if (CrFwPcktGetNOfAllocated() != 0)
987  return 0;
988 
989  /* Check application errors */
990  if (CrFwGetAppErrCode() != crNoAppErr)
991  return 0;
992 
993  return 1;
994 }
995 
996 /* ---------------------------------------------------------------------------------------------*/
998  FwSmDesc_t inLoader, inStream, outStream, inFactory, inManager;
999  CrFwCounterU2_t errRepPosLocal;
1000  CrFwCounterU1_t handoverCnt;
1001  CrFwCounterU2_t cmdRepPos;
1002 
1003  /* Store the current value of the command report counter */
1004  cmdRepPos = CrFwRepInCmdOutcomeStubGetPos();
1005 
1006  /* Store the current value of the OutStream packet handover counter */
1007  handoverCnt = CrFwOutStreamStubGetHandoverCnt();
1008 
1009  /* Store the current value of the error report counter */
1010  errRepPosLocal = CrFwRepErrStubGetPos();
1011 
1012  /* Instantiate, initialize and configure the InLoader */
1017  return 0;
1018 
1019  /* Create InStream and configure it to be in state AVAIL with one pending packet */
1020  inStream = CrFwInStreamMake(0);
1021  CrFwInStreamStubSetPcktCollectionCnt(1); /* One pending packet in InStream */
1022  CrFwInStreamStubSetPcktType(50,1,0); /* Set packet type to Sample 1 InCommand */
1023  CrFwInStreamStubSetPcktDest(CR_FW_HOST_APP_ID); /* Set packet destination to current destination */
1024  CrFwInStreamStubSetPcktCmdRepType(crCmdType); /* Define packet as InReport */
1025  CrFwInStreamStubSetPcktAckLevel(0,0,0,0); /* Do not acknolwedge */
1026  CrFwInStreamStubSetPcktCmdRepId(111); /* Define command/report identifier */
1027  CrFwInCmdSample1SetValidityFlag(1); /* Validity Check of InCommand will succeed */
1028 
1029  CrFwCmpInit(inStream);
1030  CrFwCmpReset(inStream);
1031  if (!CrFwCmpIsInConfigured(inStream))
1032  return 0;
1033  if (!CrFwInStreamIsInPcktAvail(inStream))
1034  return 0;
1035  if (CrFwInStreamGetNOfPendingPckts(inStream) != 1)
1036  return 0;
1037 
1038  /* Create OutStream */
1039  outStream = CrFwOutStreamMake(0);
1040  FwSmStart(outStream);
1041  CrFwCmpInit(outStream);
1042  CrFwCmpReset(outStream);
1043  if (!CrFwCmpIsInConfigured(outStream))
1044  return 0;
1045  CrFwOutStreamStubSetHandoverFlag(1); /* Configure Packet Hand-Over Operation to return "hand-over successful" */
1046  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0) /* Check that there are no pending packets */
1047  return 0;
1048 
1049  /* Create InFactory */
1054  return 0;
1055 
1056  /* Create InManager for InCommands */
1057  inManager = CrFwInManagerMake(0); /* InManager for InCommands */
1058  CrFwCmpInit(inManager);
1059  CrFwCmpReset(inManager);
1060  if (!CrFwCmpIsInConfigured(inManager))
1061  return 0;
1062 
1063  /* Load InStream in the InLoader and execute InLoader*/
1064  CrFwInLoaderSetInStream(inStream);
1066 
1067  /* Check that no packet was loaded into the OutStream */
1068  if (CrFwOutStreamStubGetHandoverCnt() != handoverCnt)
1069  return 0;
1070  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0)
1071  return 0;
1072 
1073  /* Check that one component has been loaded in the InManager */
1074  if (CrFwInManagerGetNOfPendingInCmp(inManager) != 1)
1075  return 0;
1076 
1077  /* Reset the InManager (this should clear the PCRL and release all loaded components) */
1078  CrFwCmpReset(inManager);
1079 
1080  /* Check that no command reports were generated */
1081  if (CrFwRepInCmdOutcomeStubGetPos() != cmdRepPos)
1082  return 0;
1083 
1084  /* Check that no error reports were generated */
1085  if (CrFwRepErrStubGetPos() != errRepPosLocal)
1086  return 0;
1088  return 0;
1089 
1090  /* Check that there are no allocated packets */
1091  if (CrFwPcktGetNOfAllocated() != 0)
1092  return 0;
1093 
1094  /* Check application errors */
1095  if (CrFwGetAppErrCode() != crNoAppErr)
1096  return 0;
1097 
1098  return 1;
1099 }
1100 
1101 /* ---------------------------------------------------------------------------------------------*/
1103  FwSmDesc_t inLoader, inStream, outStream, inFactory, inManager;
1104  CrFwCounterU2_t errRepPosLocal;
1105  CrFwCounterU1_t handoverCnt;
1106  CrFwCounterU2_t cmdRepPos;
1107 
1108  /* Store the current value of the command report counter */
1109  cmdRepPos = CrFwRepInCmdOutcomeStubGetPos();
1110 
1111  /* Store the current value of the OutStream packet handover counter */
1112  handoverCnt = CrFwOutStreamStubGetHandoverCnt();
1113 
1114  /* Store the current value of the error report counter */
1115  errRepPosLocal = CrFwRepErrStubGetPos();
1116 
1117  /* Instantiate, initialize and configure the InLoader */
1122  return 0;
1123 
1124  /* Create InStream and configure it to be in state AVAIL with one pending packet */
1125  inStream = CrFwInStreamMake(0);
1126  CrFwInStreamStubSetPcktCollectionCnt(1); /* One pending packet in InStream */
1127  CrFwInStreamStubSetPcktType(50,1,0); /* Set packet type to Sample 1 InCommand */
1128  CrFwInStreamStubSetPcktDest(CR_FW_HOST_APP_ID); /* Set packet destination to current destination */
1129  CrFwInStreamStubSetPcktCmdRepType(crCmdType); /* Define packet as InReport */
1130  CrFwInStreamStubSetPcktAckLevel(1,0,0,0); /* Acknolwedge acceptance */
1131  CrFwInStreamStubSetPcktCmdRepId(111); /* Define command/report identifier */
1132  CrFwInCmdSample1SetValidityFlag(1); /* Validity Check of InCommand will succeed */
1133 
1134  CrFwCmpInit(inStream);
1135  CrFwCmpReset(inStream);
1136  if (!CrFwCmpIsInConfigured(inStream))
1137  return 0;
1138  if (!CrFwInStreamIsInPcktAvail(inStream))
1139  return 0;
1140  if (CrFwInStreamGetNOfPendingPckts(inStream) != 1)
1141  return 0;
1142 
1143  /* Create OutStream */
1144  outStream = CrFwOutStreamMake(0);
1145  FwSmStart(outStream);
1146  CrFwCmpInit(outStream);
1147  CrFwCmpReset(outStream);
1148  if (!CrFwCmpIsInConfigured(outStream))
1149  return 0;
1150  CrFwOutStreamStubSetHandoverFlag(1); /* Configure Packet Hand-Over Operation to return "hand-over successful" */
1151  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0) /* Check that there are no pending packets */
1152  return 0;
1153 
1154  /* Create InFactory */
1159  return 0;
1160 
1161  /* Create InManager for InCommands */
1162  inManager = CrFwInManagerMake(0); /* InManager for InCommands */
1163  CrFwCmpInit(inManager);
1164  CrFwCmpReset(inManager);
1165  if (!CrFwCmpIsInConfigured(inManager))
1166  return 0;
1167 
1168  /* Load InStream in the InLoader and execute InLoader*/
1169  CrFwInLoaderSetInStream(inStream);
1171 
1172  /* Check that no packet was loaded into the OutStream */
1173  if (CrFwOutStreamStubGetHandoverCnt() != handoverCnt)
1174  return 0;
1175  if (CrFwOutStreamGetNOfPendingPckts(outStream) != 0)
1176  return 0;
1177 
1178  /* Check that one component has been loaded in the InManager */
1179  if (CrFwInManagerGetNOfPendingInCmp(inManager) != 1)
1180  return 0;
1181 
1182  /* Reset the InManager (this should clear the PCRL and release all loaded components) */
1183  CrFwCmpReset(inManager);
1184 
1185  /* Check that command acceptance acknowledge report was generated */
1186  if (CrFwRepInCmdOutcomeStubGetPos() != cmdRepPos+1)
1187  return 0;
1189  return 0;
1190  if (CrFwRepInCmdOutcomeStubGetServType(cmdRepPos) != 50)
1191  return 0;
1192  if (CrFwRepInCmdOutcomeStubGetServSubType(cmdRepPos) != 1)
1193  return 0;
1194  if (CrFwRepInCmdOutcomeStubGetDiscriminant(cmdRepPos) != 0)
1195  return 0;
1196 
1197  /* Check that no error reports were generated */
1198  if (CrFwRepErrStubGetPos() != errRepPosLocal)
1199  return 0;
1201  return 0;
1202 
1203  /* Check that there are no allocated packets */
1204  if (CrFwPcktGetNOfAllocated() != 0)
1205  return 0;
1206 
1207  /* Check application errors */
1208  if (CrFwGetAppErrCode() != crNoAppErr)
1209  return 0;
1210 
1211  return 1;
1212 }
1213 
CrFwInstanceId_t CrFwCmpGetInstanceId(FwSmDesc_t smDesc)
Return the instance identifier of the argument component.
Definition: CrFwBaseCmp.c:150
void CrFwCmpInit(FwSmDesc_t smDesc)
Initialize a framework component.
Definition: CrFwBaseCmp.c:112
CrFwBool_t CrFwCmpIsInInitialized(FwSmDesc_t smDesc)
Return true if the argument component is in state INITIALIZED.
Definition: CrFwBaseCmp.c:172
CrFwBool_t CrFwCmpIsInConfigured(FwSmDesc_t smDesc)
Return true if the argument component is in state CONFIGURED.
Definition: CrFwBaseCmp.c:177
void CrFwCmpReset(FwSmDesc_t smDesc)
Reset a framework component.
Definition: CrFwBaseCmp.c:117
CrFwBool_t CrFwCmpIsInCreated(FwSmDesc_t smDesc)
Return true if the argument component is in state CREATED.
Definition: CrFwBaseCmp.c:167
void CrFwCmpExecute(FwSmDesc_t smDesc)
Execute a framework component.
Definition: CrFwBaseCmp.c:127
CrFwTypeId_t CrFwCmpGetTypeId(FwSmDesc_t smDesc)
Return the type identifier of the argument component.
Definition: CrFwBaseCmp.c:156
Definition of Base Component.
Definition of the Framework Component Data (FCD) Type.
@ crRepType
Report type.
Definition: CrFwConstants.h:45
@ crCmdType
Command type.
Definition: CrFwConstants.h:43
#define CR_FW_INLOADER_TYPE
Type identifier for the InLoader component.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:38
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
Definition: CrFwConstants.h:32
Definition of the InCommand Component of the framework.
void CrFwInCmdSample1SetValidityFlag(CrFwBool_t flag)
Set the value of the Validity Flag (see CrFwInCmdSample1ValidityCheck).
Sample InCommand used in the Test Suite.
FwSmDesc_t CrFwInFactoryMakeInCmd(CrFwPckt_t pckt)
Make function for a component encapsulating an incoming command (InCommand).
void CrFwInFactoryReleaseInCmd(FwSmDesc_t inCmdInstance)
Release function for an InCommand.
void CrFwInFactoryReleaseInRep(FwSmDesc_t inRepInstance)
Release function for an InReport.
FwSmDesc_t CrFwInFactoryMakeInRep(CrFwPckt_t pckt)
Make function for a component encapsulating an incoming report (InReport).
FwSmDesc_t CrFwInFactoryMake()
Factory function for the singleton instance of the InFactory.
static FwSmDesc_t inFactory
The singleton instance of the InFactory.
Definition of the InFactory component.
User-modifiable parameters for the InFactory component (see CrFwInFactory.h).
#define CR_FW_INFACTORY_MAX_NOF_INCMD
The maximum number of components representing an incoming command which may be allocated at any one t...
#define CR_FW_INFACTORY_MAX_NOF_INREP
The maximum number of InReports which may be allocated at any one time.
void CrFwInLoaderSetInStream(FwSmDesc_t inStream)
Set the InStream from which the packets will be retrieved the next time the InLoader is executed.
Definition: CrFwInLoader.c:132
static FwSmDesc_t inLoader
The InLoader singleton.
Definition: CrFwInLoader.c:53
CrFwInstanceId_t CrFwInLoaderDefGetInManager(CrFwServType_t servType, CrFwServSubType_t servSubType, CrFwDiscriminant_t discriminant, CrFwCmdRepType_t cmdRepFlag)
Default implementation of the function which selects the InManager to which an incoming InReport or I...
Definition: CrFwInLoader.c:245
CrFwDestSrc_t CrFwInLoaderDefGetReroutingDestination(CrFwDestSrc_t pcktDest)
Default implementation of the function which checks the legality of a destination and returns the re-...
Definition: CrFwInLoader.c:234
CrFwDestSrc_t CrFwInLoaderDefNoRerouting(CrFwDestSrc_t pcktDest)
Default implementation of the function which checks the legality of a destination and returns the re-...
Definition: CrFwInLoader.c:239
FwSmDesc_t CrFwInLoaderMake()
Factory function to retrieve the state machine implementing the InLoader singleton component.
Definition: CrFwInLoader.c:90
CrFwBool_t CrFwInLoaderTestCase5()
Check the execution function of an InLoader for the case where the packet destination is the host app...
CrFwBool_t CrFwInLoaderTestCase8()
Check the execution function of an InLoader for the case where the packet destination is the host app...
CrFwBool_t CrFwInLoaderTestCase10()
Check the execution function of an InLoader for the case where the packet destination is the host app...
CrFwBool_t CrFwInLoaderTestCase2()
Check the execution function of an InLoader for the case where there are no pending packet in the InS...
CrFwBool_t CrFwInLoaderTestCase1()
Check the configuration of a newly created InLoader.
CrFwDestSrc_t CrFwInLoaderTestCaseGetReroutingDestination(CrFwDestSrc_t pcktDest)
Test implementation of the function which checks the legality of a destination and returns the re-rou...
static void CrFwInLoaderTestCaseSetReroutingDest(CrFwDestSrc_t retValue)
Function to set the return value of function CrFwInLoaderTestCaseGetReroutingDestination.
CrFwBool_t CrFwInLoaderTestCase11()
Check the execution function of an InLoader for the case where the packet destination is the host app...
CrFwBool_t CrFwInLoaderTestCase4()
Check the execution function of an InLoader for the case where the packet must be re-routed to anothe...
CrFwBool_t CrFwInLoaderTestCase6()
Check the execution function of an InLoader for the case where the packet destination is the host app...
CrFwBool_t CrFwInLoaderTestCase7()
Check the execution function of an InLoader for the case where the packet destination is the host app...
static CrFwDestSrc_t reroutingDest
Return value of function CrFwInLoaderDefGetReroutingDestination.
CrFwBool_t CrFwInLoaderTestCase3()
Check the execution function of an InLoader for the case where the packet destination is invalid.
CrFwBool_t CrFwInLoaderTestCase9()
Check the execution function of an InLoader for the case where the packet destination is the host app...
Declaration of the test cases for the InLoader Component (see CrFwInLoader.h).
User-modifiable parameters for the InLoader components (see CrFwInLoader.h).
CrFwBool_t CrFwInManagerLoad(FwSmDesc_t smDesc, FwSmDesc_t inCmp)
Load a new InReport or InCommand into the InManager.
CrFwCounterU1_t CrFwInManagerGetNOfPendingInCmp(FwSmDesc_t smDesc)
Return the number of InReport or InCommands currently in the PCRL of an InManager.
FwSmDesc_t CrFwInManagerMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th InManager State Machine instance.
Definition: CrFwInManager.c:96
CrFwCounterU1_t CrFwInManagerGetPCRLSize(FwSmDesc_t smDesc)
Return the size of the PCRL of an InManager.
Definition of the InRegistry Component.
User-modifiable parameters for the InRegistry component (see CrFwInRegistry.h).
Definition of the InReport Component of the framework.
void CrFwInRepSample1SetValidityFlag(CrFwBool_t flag)
Set the value of the Validity Flag (see CrFwInRepSample1ValidityCheck).
Sample InReport used in the Test Suite.
CrFwCounterU1_t CrFwInStreamGetNOfPendingPckts(FwSmDesc_t smDesc)
Return the number of packets currently in the packet queue of an InStream.
Definition: CrFwInStream.c:279
CrFwBool_t CrFwInStreamIsInPcktAvail(FwSmDesc_t smDesc)
Return true if the argument InStream is in state PCKT_AVAIL.
Definition: CrFwInStream.c:248
FwSmDesc_t CrFwInStreamMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th InStream State Machine instance.
Definition: CrFwInStream.c:128
Definition of the InStream component.
void CrFwInStreamStubSetPcktDest(CrFwDestSrc_t d)
Set the value of the destination of the next packet collected (see CrFwInStreamStubPcktCollect).
static CrFwDestSrc_t dest
Destination.
void CrFwInStreamStubSetPcktAckLevel(CrFwBool_t acc, CrFwBool_t str, CrFwBool_t prg, CrFwBool_t trm)
Set the value of the acknowledge level of the next packet collected (see CrFwInStreamStubPcktCollect)...
void CrFwInStreamStubSetPcktCollectionCnt(CrFwCounterU1_t cnt)
Set the value of the packet collection counter which defines the number of packets available at the m...
void CrFwInStreamStubSetPcktCmdRepId(CrFwInstanceId_t id)
Set the value of the command or report identifier of the next packet collected (see CrFwInStreamStubP...
void CrFwInStreamStubSetPcktCmdRepType(CrFwCmdRepType_t type)
Set the type (command or report) of the next packet collected (see CrFwInStreamStubPcktCollect).
void CrFwInStreamStubSetPcktType(CrFwServType_t sType, CrFwServSubType_t sSubType, CrFwDiscriminant_t d)
Set the value of the service type, sub-type and discriminant of the next packet collected (see CrFwIn...
Interface for the InStream stub.
User-modifiable parameters for the OutFactory component (see CrFwOutFactory.h).
CrFwCounterU1_t CrFwOutStreamGetNOfPendingPckts(FwSmDesc_t smDesc)
Return the number of packets currently in the packet queue of an OutStream.
CrFwDestSrc_t CrFwOutStreamGetDest(FwSmDesc_t outStream, CrFwCounterU1_t i)
Return the i-th destination associated to the argument outStream.
FwSmDesc_t CrFwOutStreamMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th OutStream State Machine instance.
Definition of the OutStream component.
CrFwCounterU1_t CrFwOutStreamStubGetHandoverCnt()
Return the value of the handover counter which is incremented by the packet handover function in CrFw...
void CrFwOutStreamStubSetHandoverFlag(CrFwBool_t flag)
Set the value of the handover flag which determines the outcome of the packet handover in CrFwOutStre...
Interface for the OutStream stub.
User-modifiable parameters for the OutStream components (see CrFwOutStream.h).
Interface for creating and accessing a report or command packet.
void CrFwPcktSetServSubType(CrFwPckt_t pckt, CrFwServSubType_t servSubType)
Set the service sub-type of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:327
void CrFwPcktSetDiscriminant(CrFwPckt_t pckt, CrFwDiscriminant_t discriminant)
Set the discriminant of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:309
void CrFwPcktSetServType(CrFwPckt_t pckt, CrFwServType_t servType)
Set the service type of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:315
CrFwCounterU2_t CrFwPcktGetNOfAllocated()
Return the number of packets which are currently allocated.
Definition: CrFwPckt.c:214
CrFwPckt_t CrFwPcktMake(CrFwPcktLength_t pcktLength)
Make function for command or report packets.
Definition: CrFwPckt.c:147
CrFwInstanceId_t CrFwRepErrStubGetInstanceId(CrFwCounterU2_t errRepPos)
Return the type identifier of the error report at position errRepPos.
Definition: CrFwRepErr.c:277
CrFwInstanceId_t CrFwRepErrStubGetSecondatyInstanceId(CrFwCounterU2_t errRepPos)
Return the secondary instance identifier associated to the error report at position errRepPos.
Definition: CrFwRepErr.c:304
CrFwCounterU2_t CrFwRepErrStubGetPos()
Return the position in the error report array at which the next error report will be written.
Definition: CrFwRepErr.c:79
CrFwTypeId_t CrFwRepErrStubGetTypeId(CrFwCounterU2_t errRepPos)
Return the type identifier of the error report at position errRepPos.
Definition: CrFwRepErr.c:272
CrFwDestSrc_t CrFwRepErrStubGetDest(CrFwCounterU2_t errRepPos)
Return the destination associated to the error report at position errRepPos.
Definition: CrFwRepErr.c:287
CrFwRepErrCode_t CrFwRepErrStubGetErrCode(CrFwCounterU2_t errRepPos)
Return the error code of the error report at position errRepPos.
Definition: CrFwRepErr.c:267
Interface for reporting an error detected by a framework component.
The CORDET Framework defines an interface for generating error reports (see CrFwRepErr....
CrFwRepInCmdOutcome_t CrFwRepInCmdOutcomeStubGetOutcome(CrFwCounterU2_t repPos)
Return the outcome of the InCommand Outcome Report at position repPos.
CrFwOutcome_t CrFwRepInCmdOutcomeStubGetFailCode(CrFwCounterU2_t repPos)
Return the failure code of the InCommand Outcome Report at position repPos.
CrFwServSubType_t CrFwRepInCmdOutcomeStubGetServSubType(CrFwCounterU2_t repPos)
Return the service sub-type of the InCommand Outcome Report at position repPos.
CrFwDiscriminant_t CrFwRepInCmdOutcomeStubGetDiscriminant(CrFwCounterU2_t repPos)
Return the discriminant of the InCommand Outcome Report at position repPos.
CrFwCounterU2_t CrFwRepInCmdOutcomeStubGetPos()
Return the position in the InCommand Outcome Report array at which the next outcome report will be wr...
CrFwServType_t CrFwRepInCmdOutcomeStubGetServType(CrFwCounterU2_t repPos)
Return the service type of the InCommand Outcome Report at position repPos.
Interface for reporting the outcome of the processing of an InCommand.
@ crCmdAckCreFail
Creation failure.
@ crCmdAckAccFail
Acceptance failure.
@ crCmdAckLdFail
Load failure.
@ crCmdAckAccSucc
Acceptance success.
The CORDET Framework defines an interface for reporting the outcome of an InCommand (see CrFwRepInCmd...
Interface through which framework components access the current time.
unsigned char CrFwDestSrc_t
Type used for the command or report destination and source.
unsigned short CrFwCounterU2_t
Type used for unsigned integers with a "medium" range.
unsigned char CrFwCounterU1_t
Type used for unsigned integers with a "short" range.
@ crInLoaderAccFail
An InReport has failed its validity check.
@ crInLoaderInvDest
The InLoader has retrieved a packet with an invalid destination (see CrFwInLoader....
@ crInManagerPcrlFull
The Pending Command/Report List (PCRL) of an InManager is full (see CrFwInManager....
@ crInLoaderLdFail
An InReport could not be loaded in its InManager.
@ crInLoaderCreFail
An InReport could not be created due to insufficient resources or illegal type/sub-type/discriminant.
@ crIllInRepKind
A framework function was called with an illegal type/sub-type/discriminant triplet for an InReport.
@ crInCmdAllocationFail
Allocation request for a packet for an InCommand has failed (see CrFwInFactoryMakeInCmd).
@ crNoAppErr
No application errors have been detected.
@ crInRepAllocationFail
Allocation request for an InReport has failed (see CrFwInFactoryMakeInRep).
@ crIllInCmdKind
A framework function was called with an illegal type/sub-type/discriminant triplet for an InCommand.
#define CR_FW_HOST_APP_ID
The identifier of the host application (i.e.
CrFwAppErrCode_t CrFwGetAppErrCode()
Return the value of the application error code.
void CrFwSetAppErrCode(CrFwAppErrCode_t errCode)
Set the value of the application error code (see CrFwGetAppErrCode).
Definition of the utility functions for the CORDET Framework.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved