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