CORDET Framework - C2 Implementation
CrFwInFactoryTestCases.c
Go to the documentation of this file.
1 
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include "CrFwInFactoryTestCases.h"
22 /* Include FW Profile files */
23 #include "FwSmConstants.h"
24 #include "FwSmConfig.h"
25 #include "FwSmCore.h"
26 #include "FwPrConfig.h"
27 #include "FwPrCore.h"
28 #include "FwPrConstants.h"
29 /* Include framework files */
30 #include "CrFwOutRegistryUserPar.h"
32 #include "BaseCmp/CrFwBaseCmp.h"
33 #include "Pckt/CrFwPckt.h"
35 #include "CrFwTime.h"
36 #include "CrFwRepErr.h"
38 /* Include configuration files */
39 #include "CrFwRepErrStub.h"
40 #include "CrFwInFactoryUserPar.h"
41 #include "CrFwCmpData.h"
42 
43 /* ---------------------------------------------------------------------------------------------*/
45  FwSmDesc_t inFactory1, inFactory2;
46 
47  /* Instantiate the InFactory */
48  inFactory1 = CrFwInFactoryMake();
49  if (inFactory1 == NULL)
50  return 0;
51 
52  /* Instantiate it again and check that same component is returned */
53  inFactory2 = CrFwInFactoryMake();
54  if (inFactory1 != inFactory2)
55  return 0;
56 
57  /* Check configuration of InFactory */
58  if (FwSmCheckRec(inFactory1) != smSuccess)
59  return 0;
60 
61  /* Initialize and Configure InFactory and check success */
62  CrFwCmpInit(inFactory1);
63  CrFwCmpReset(inFactory1);
64  if (!CrFwCmpIsInConfigured(inFactory1))
65  return 0;
66 
67  /* Check component type */
68  if (CrFwCmpGetInstanceId(inFactory1) != 0)
69  return 0;
70  if (CrFwCmpGetTypeId(inFactory1) != CR_FW_INFACTORY_TYPE)
71  return 0;
72 
73  /* Check initial number of allocated InCommands */
75  return 0;
76 
77  /* Check maximum number of InCommands which can be allocated */
79  return 0;
80 
81  /* Check initial number of allocated InReports */
83  return 0;
84 
85  /* Check maximum number of InReports which can be allocated */
87  return 0;
88 
89  return 1;
90 }
91 
92 /*--------------------------------------------------------------------------------*/
94  FwSmDesc_t inFactory, inCmd;
95  CrFwPckt_t inCmdPckt;
97  FwSmDesc_t inCmdArray[CR_FW_INFACTORY_MAX_NOF_INCMD];
98 
99  /* Instantiate the InFactory */
100  inFactory = CrFwInFactoryMake();
101  if (inFactory == NULL)
102  return 0;
103 
104  /* Initialize and configure the InFactory */
105  CrFwCmpInit(inFactory);
106  CrFwCmpReset(inFactory);
107  if (!CrFwCmpIsInConfigured(inFactory))
108  return 0;
109 
110  /* attempt to retrieve an InCommand with undefined service type */
111  inCmdPckt = CrFwPcktMake(100);
112  CrFwPcktSetServType(inCmdPckt,6);
113  CrFwPcktSetServSubType(inCmdPckt,1);
114  CrFwPcktSetDiscriminant(inCmdPckt,1);
115  inCmd = CrFwInFactoryMakeInCmd(inCmdPckt);
116  if (inCmd != NULL)
117  return 0;
119  return 0;
121  CrFwPcktRelease(inCmdPckt);
122 
123  /* attempt to retrieve an InCommand with undefined service sub-type */
124  inCmdPckt = CrFwPcktMake(100);
125  CrFwPcktSetServType(inCmdPckt,8);
126  CrFwPcktSetServSubType(inCmdPckt,13);
127  CrFwPcktSetDiscriminant(inCmdPckt,1);
128  inCmd = CrFwInFactoryMakeInCmd(inCmdPckt);
129  if (inCmd != NULL)
130  return 0;
132  return 0;
134  CrFwPcktRelease(inCmdPckt);
135 
136  /* attempt to retrieve an InCommand with undefined discriminant */
137  inCmdPckt = CrFwPcktMake(100);
138  CrFwPcktSetServType(inCmdPckt,50);
139  CrFwPcktSetServSubType(inCmdPckt,1);
140  CrFwPcktSetDiscriminant(inCmdPckt,3);
141  inCmd = CrFwInFactoryMakeInCmd(inCmdPckt);
142  if (inCmd != NULL)
143  return 0;
145  return 0;
147  CrFwPcktRelease(inCmdPckt);
148 
149  /* Create CR_FW_INFACTORY_MAX_NOF_INCMD InCommand and then attempt to create one more */
150  for (i=0; i<CR_FW_INFACTORY_MAX_NOF_INCMD; i++) {
151  inCmdPckt = CrFwPcktMake(100);
152  CrFwPcktSetServType(inCmdPckt,8);
153  CrFwPcktSetServSubType(inCmdPckt,1);
154  CrFwPcktSetDiscriminant(inCmdPckt,1);
155  inCmdArray[i] = CrFwInFactoryMakeInCmd(inCmdPckt);
156  if (inCmdArray[i]==NULL)
157  return 0;
158  }
159 
160  inCmdPckt = CrFwPcktMake(100);
161  CrFwPcktSetServType(inCmdPckt,8);
162  CrFwPcktSetServSubType(inCmdPckt,1);
163  CrFwPcktSetDiscriminant(inCmdPckt,1);
164  inCmd = CrFwInFactoryMakeInCmd(inCmdPckt);
165  if (inCmd != NULL)
166  return 0;
168  return 0;
170  CrFwPcktRelease(inCmdPckt);
171 
172  /* Release all InCommands */
173  for (i=0; i<CR_FW_INFACTORY_MAX_NOF_INCMD; i++)
174  CrFwInFactoryReleaseInCmd(inCmdArray[i]);
175 
176  /* Check that there are no allocated packets */
177  if (CrFwPcktGetNOfAllocated() != 0)
178  return 0;
179 
180  /* Check application errors */
181  if (CrFwGetAppErrCode() != crNoAppErr)
182  return 0;
183 
184  return 1;
185 }
186 
187 /*--------------------------------------------------------------------------------*/
189  FwSmDesc_t inFactory;
190  FwSmDesc_t inCmd1, inCmd2, inCmd3;
191  CrFwPckt_t pckt1, pckt2, pckt3;
192 
193  /* Instantiate the InFactory */
194  inFactory = CrFwInFactoryMake();
195  if (inFactory == NULL)
196  return 0;
197 
198  /* Initialize and Reset the InFactory */
199  CrFwCmpInit(inFactory);
200  CrFwCmpReset(inFactory);
201  if (!CrFwCmpIsInConfigured(inFactory))
202  return 0;
203 
204  /* Allocate three InCommands */
205  pckt1 = CrFwPcktMake(100);
206  CrFwPcktSetServType(pckt1,8);
207  CrFwPcktSetServSubType(pckt1,1);
208  CrFwPcktSetDiscriminant(pckt1,1);
209  CrFwPcktSetCmdRepId(pckt1,101);
210  inCmd1 = CrFwInFactoryMakeInCmd(pckt1);
211 
212  pckt2 = CrFwPcktMake(100);
213  CrFwPcktSetServType(pckt2,8);
214  CrFwPcktSetServSubType(pckt2,1);
215  CrFwPcktSetDiscriminant(pckt2,2);
216  CrFwPcktSetCmdRepId(pckt2,102);
217  inCmd2 = CrFwInFactoryMakeInCmd(pckt2);
218 
219  pckt3 = CrFwPcktMake(100);
220  CrFwPcktSetServType(pckt3,8);
221  CrFwPcktSetServSubType(pckt3,1);
222  CrFwPcktSetDiscriminant(pckt3,1);
223  CrFwPcktSetCmdRepId(pckt3,103);
224  inCmd3 = CrFwInFactoryMakeInCmd(pckt3);
225  if (CrFwCmpGetInstanceId(inCmd1) != 101)
226  return 0;
227  if (CrFwCmpGetInstanceId(inCmd2) != 102)
228  return 0;
229  if (CrFwCmpGetInstanceId(inCmd3) != 103)
230  return 0;
232  return 0;
233 
234  /* Reset the InFactory and check that no InCommands are allocated */
235  CrFwCmpReset(inFactory);
236  if (!CrFwCmpIsInConfigured(inFactory))
237  return 0;
239  return 0;
240 
241  /* Allocate three InCommands */
242  pckt1 = CrFwPcktMake(100);
243  CrFwPcktSetServType(pckt1,8);
244  CrFwPcktSetServSubType(pckt1,1);
245  CrFwPcktSetDiscriminant(pckt1,1);
246  inCmd1 = CrFwInFactoryMakeInCmd(pckt1);
247 
248  pckt2 = CrFwPcktMake(100);
249  CrFwPcktSetServType(pckt2,8);
250  CrFwPcktSetServSubType(pckt2,1);
251  CrFwPcktSetDiscriminant(pckt2,2);
252  inCmd2 = CrFwInFactoryMakeInCmd(pckt2);
253 
254  pckt3 = CrFwPcktMake(100);
255  CrFwPcktSetServType(pckt3,8);
256  CrFwPcktSetServSubType(pckt3,1);
257  CrFwPcktSetDiscriminant(pckt3,1);
258  inCmd3 = CrFwInFactoryMakeInCmd(pckt3);
260  return 0;
261 
262  /* Shutdown the InFactory and check that no InCommands are allocated */
263  CrFwCmpShutdown(inFactory);
264  if (CrFwCmpIsStarted(inFactory) != 0)
265  return 0;
267  return 0;
268 
269  /* Restart and initialize the InFactory */
270  FwSmStart(inFactory);
271  CrFwCmpInit(inFactory);
272 
273  /* Check that there are no allocated packets */
274  if (CrFwPcktGetNOfAllocated() != 0)
275  return 0;
276 
277  /* Check application errors */
278  if (CrFwGetAppErrCode() != crNoAppErr)
279  return 0;
280 
281  return 1;
282 }
283 
284 /*--------------------------------------------------------------------------------*/
286  FwSmDesc_t inFactory;
287  FwSmDesc_t inCmd1, inCmd2, inCmd3;
288  CrFwPckt_t pckt1, pckt2, pckt3;
289 
290  /* Instantiate the InFactory */
291  inFactory = CrFwInFactoryMake();
292  if (inFactory == NULL)
293  return 0;
294 
295  /* Reset the InFactory */
296  CrFwCmpReset(inFactory);
297  if (!CrFwCmpIsInConfigured(inFactory))
298  return 0;
299 
300  /* Allocate three InCommands */
301  pckt1 = CrFwPcktMake(100);
302  CrFwPcktSetServType(pckt1,8);
303  CrFwPcktSetServSubType(pckt1,1);
304  CrFwPcktSetDiscriminant(pckt1,1);
305  inCmd1 = CrFwInFactoryMakeInCmd(pckt1);
306 
307  pckt2 = CrFwPcktMake(100);
308  CrFwPcktSetServType(pckt2,8);
309  CrFwPcktSetServSubType(pckt2,1);
310  CrFwPcktSetDiscriminant(pckt2,2);
311  inCmd2 = CrFwInFactoryMakeInCmd(pckt2);
312 
313  pckt3 = CrFwPcktMake(100);
314  CrFwPcktSetServType(pckt3,8);
315  CrFwPcktSetServSubType(pckt3,1);
316  CrFwPcktSetDiscriminant(pckt3,1);
317  inCmd3 = CrFwInFactoryMakeInCmd(pckt3);
319  return 0;
320 
321  /* Release one of the InCommands */
324  return 0;
325 
326  /* Attempt to release the InCommand a second time */
329  return 0;
331  return 0;
333 
334  /* Release the other two InCommands */
338  return 0;
339 
340  /* Reset the InFactory */
341  CrFwCmpReset(inFactory);
342 
343  /* Check that there are no allocated packets */
344  if (CrFwPcktGetNOfAllocated() != 0)
345  return 0;
346 
347  /* Check application errors */
348  if (CrFwGetAppErrCode() != crNoAppErr)
349  return 0;
350 
351  return 1;
352 }
353 
354 
355 /*--------------------------------------------------------------------------------*/
357  FwSmDesc_t inFactory, inRep;
358  CrFwPckt_t inRepPckt;
359  CrFwCounterU2_t i;
360  FwSmDesc_t inRepArray[CR_FW_INFACTORY_MAX_NOF_INREP];
361 
362  /* Instantiate the InFactory */
363  inFactory = CrFwInFactoryMake();
364  if (inFactory == NULL)
365  return 0;
366 
367  /* Initialize and configure the InFactory */
368  CrFwCmpInit(inFactory);
369  CrFwCmpReset(inFactory);
370  if (!CrFwCmpIsInConfigured(inFactory))
371  return 0;
372 
373  /* attempt to retrieve an InReport with undefined service type */
374  inRepPckt = CrFwPcktMake(100);
375  CrFwPcktSetServType(inRepPckt,6);
376  CrFwPcktSetServSubType(inRepPckt,1);
377  CrFwPcktSetDiscriminant(inRepPckt,1);
378  inRep = CrFwInFactoryMakeInRep(inRepPckt);
379  if (inRep != NULL)
380  return 0;
382  return 0;
384  CrFwPcktRelease(inRepPckt);
385 
386  /* attempt to retrieve an InReport with undefined service sub-type */
387  inRepPckt = CrFwPcktMake(100);
388  CrFwPcktSetServType(inRepPckt,5);
389  CrFwPcktSetServSubType(inRepPckt,13);
390  CrFwPcktSetDiscriminant(inRepPckt,1);
391  inRep = CrFwInFactoryMakeInRep(inRepPckt);
392  if (inRep != NULL)
393  return 0;
395  return 0;
397  CrFwPcktRelease(inRepPckt);
398 
399  /* attempt to retrieve an InReport with undefined discriminant */
400  inRepPckt = CrFwPcktMake(100);
401  CrFwPcktSetServType(inRepPckt,40);
402  CrFwPcktSetServSubType(inRepPckt,1);
403  CrFwPcktSetDiscriminant(inRepPckt,3);
404  inRep = CrFwInFactoryMakeInRep(inRepPckt);
405  if (inRep != NULL)
406  return 0;
408  return 0;
410  CrFwPcktRelease(inRepPckt);
411 
412  /* Create CR_FW_INFACTORY_MAX_NOF_INREP InReport and then attempt to create one more */
413  for (i=0; i<CR_FW_INFACTORY_MAX_NOF_INREP; i++) {
414  inRepPckt = CrFwPcktMake(100);
415  CrFwPcktSetServType(inRepPckt,5);
416  CrFwPcktSetServSubType(inRepPckt,1);
417  CrFwPcktSetDiscriminant(inRepPckt,1);
418  inRepArray[i] = CrFwInFactoryMakeInRep(inRepPckt);
419  if (inRepArray[i]==NULL)
420  return 0;
421  }
422 
423  inRepPckt = CrFwPcktMake(100);
424  CrFwPcktSetServType(inRepPckt,5);
425  CrFwPcktSetServSubType(inRepPckt,1);
426  CrFwPcktSetDiscriminant(inRepPckt,1);
427  inRep = CrFwInFactoryMakeInRep(inRepPckt);
428  if (inRep != NULL)
429  return 0;
431  return 0;
433  CrFwPcktRelease(inRepPckt);
434 
435  /* Release all InReports */
436  for (i=0; i<CR_FW_INFACTORY_MAX_NOF_INREP; i++)
437  CrFwInFactoryReleaseInRep(inRepArray[i]);
438 
439  /* Check that there are no allocated packets */
440  if (CrFwPcktGetNOfAllocated() != 0)
441  return 0;
442 
443  /* Check application errors */
444  if (CrFwGetAppErrCode() != crNoAppErr)
445  return 0;
446 
447  return 1;
448 }
449 
450 /*--------------------------------------------------------------------------------*/
452  FwSmDesc_t inFactory;
453  FwSmDesc_t inRep1, inRep2, inRep3;
454  CrFwPckt_t pckt1, pckt2, pckt3;
455 
456  /* Instantiate the InFactory */
457  inFactory = CrFwInFactoryMake();
458  if (inFactory == NULL)
459  return 0;
460 
461  /* Reset the InFactory */
462  CrFwCmpReset(inFactory);
463  if (!CrFwCmpIsInConfigured(inFactory))
464  return 0;
465 
466  /* Allocate three InReports */
467  pckt1 = CrFwPcktMake(100);
468  CrFwPcktSetServType(pckt1,5);
469  CrFwPcktSetServSubType(pckt1,1);
470  CrFwPcktSetDiscriminant(pckt1,1);
471  CrFwPcktSetCmdRepId(pckt1, 101);
472  inRep1 = CrFwInFactoryMakeInRep(pckt1);
473 
474  pckt2 = CrFwPcktMake(100);
475  CrFwPcktSetServType(pckt2,5);
476  CrFwPcktSetServSubType(pckt2,1);
477  CrFwPcktSetDiscriminant(pckt2,2);
478  CrFwPcktSetCmdRepId(pckt2, 102);
479  inRep2 = CrFwInFactoryMakeInRep(pckt2);
480 
481  pckt3 = CrFwPcktMake(100);
482  CrFwPcktSetServType(pckt3,5);
483  CrFwPcktSetServSubType(pckt3,1);
484  CrFwPcktSetDiscriminant(pckt3,3);
485  CrFwPcktSetCmdRepId(pckt3, 103);
486  inRep3 = CrFwInFactoryMakeInRep(pckt3);
487  if (CrFwCmpGetInstanceId(inRep1) != 101)
488  return 0;
489  if (CrFwCmpGetInstanceId(inRep2) != 102)
490  return 0;
491  if (CrFwCmpGetInstanceId(inRep3) != 103)
492  return 0;
494  return 0;
495 
496  /* Reset the InFactory and check that no InReports are allocated */
497  CrFwCmpReset(inFactory);
498  if (!CrFwCmpIsInConfigured(inFactory))
499  return 0;
501  return 0;
502 
503  /* Allocate three InReports */
504  pckt1 = CrFwPcktMake(100);
505  CrFwPcktSetServType(pckt1,5);
506  CrFwPcktSetServSubType(pckt1,1);
507  CrFwPcktSetDiscriminant(pckt1,1);
508  inRep1 = CrFwInFactoryMakeInRep(pckt1);
509 
510  pckt2 = CrFwPcktMake(100);
511  CrFwPcktSetServType(pckt2,5);
512  CrFwPcktSetServSubType(pckt2,1);
513  CrFwPcktSetDiscriminant(pckt2,2);
514  inRep2 = CrFwInFactoryMakeInRep(pckt2);
515 
516  pckt3 = CrFwPcktMake(100);
517  CrFwPcktSetServType(pckt3,5);
518  CrFwPcktSetServSubType(pckt3,1);
519  CrFwPcktSetDiscriminant(pckt3,3);
520  inRep3 = CrFwInFactoryMakeInRep(pckt3);
522  return 0;
523 
524  /* Shutdown the InFactory and check that no InReports are allocated */
525  CrFwCmpShutdown(inFactory);
526  if (CrFwCmpIsStarted(inFactory) != 0)
527  return 0;
529  return 0;
530 
531  /* Restart and initialize the InFactory */
532  FwSmStart(inFactory);
533  CrFwCmpInit(inFactory);
534 
535  /* Check that there are no allocated packets */
536  if (CrFwPcktGetNOfAllocated() != 0)
537  return 0;
538 
539  /* Check application errors */
540  if (CrFwGetAppErrCode() != crNoAppErr)
541  return 0;
542 
543  return 1;
544 }
545 
546 /*--------------------------------------------------------------------------------*/
548  FwSmDesc_t inFactory;
549  FwSmDesc_t inRep1, inRep2, inRep3;
550  CrFwPckt_t pckt1, pckt2, pckt3;
551 
552  /* Instantiate the InFactory */
553  inFactory = CrFwInFactoryMake();
554  if (inFactory == NULL)
555  return 0;
556 
557  /* Reset the InFactory */
558  CrFwCmpReset(inFactory);
559  if (!CrFwCmpIsInConfigured(inFactory))
560  return 0;
561 
562  /* Allocate three InReports */
563  pckt1 = CrFwPcktMake(100);
564  CrFwPcktSetServType(pckt1,5);
565  CrFwPcktSetServSubType(pckt1,1);
566  CrFwPcktSetDiscriminant(pckt1,1);
567  inRep1 = CrFwInFactoryMakeInRep(pckt1);
568 
569  pckt2 = CrFwPcktMake(100);
570  CrFwPcktSetServType(pckt2,5);
571  CrFwPcktSetServSubType(pckt2,1);
572  CrFwPcktSetDiscriminant(pckt2,2);
573  inRep2 = CrFwInFactoryMakeInRep(pckt2);
574 
575  pckt3 = CrFwPcktMake(100);
576  CrFwPcktSetServType(pckt3,5);
577  CrFwPcktSetServSubType(pckt3,1);
578  CrFwPcktSetDiscriminant(pckt3,3);
579  inRep3 = CrFwInFactoryMakeInRep(pckt3);
581  return 0;
582 
583  /* Release one of the InReports */
586  return 0;
587 
588  /* Attempt to release the InReport a second time */
591  return 0;
593  return 0;
595 
596  /* Release the other InReports */
599 
600  /* Reset the InFactory */
601  CrFwCmpReset(inFactory);
602 
603  /* Check that there are no allocated packets */
604  if (CrFwPcktGetNOfAllocated() != 0)
605  return 0;
606 
607  /* Check application errors */
608  if (CrFwGetAppErrCode() != crNoAppErr)
609  return 0;
610 
611  return 1;
612 }
Interface through which framework components access the current time.
A framework function was called with an illegal type/sub-type/discriminant triplet for an InCommand...
CrFwBool_t CrFwInFactoryTestCase6()
Test the InReport part of the Reset and Shutdown functions of the InFactory component.
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
CrFwBool_t CrFwInFactoryTestCase3()
Test the InCommand part of the Reset and Shutdown functions of the InFactory component.
Definition of the Framework Component Data (FCD) Type.
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).
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:38
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.
Interface for creating and accessing a report or command packet.
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
Definition: CrFwConstants.h:32
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).
void CrFwPcktSetCmdRepId(CrFwPckt_t pckt, CrFwInstanceId_t id)
Set the command or report identifier in the command or report encapsulated in a packet.
Definition: CrFwPckt.c:333
void CrFwPcktRelease(CrFwPckt_t pckt)
Release function for command or report packets.
Definition: CrFwPckt.c:156
Definition of the InRegistry Component.
#define CR_FW_INFACTORY_TYPE
Type identifier for the InFactory component.
An InReport release request has encountered an error (see CrFwInFactoryReleaseInRep).
Declaration of the test cases for the InFactory Component (see CrFwInFactory.h).
Interface for reporting an error detected by a framework component.
unsigned short CrFwCounterU2_t
Type used for unsigned integers with a "medium" range.
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
CrFwBool_t CrFwInFactoryTestCase4()
Test the InCommand part of the Release function of the InFactory component.
Definition of the InFactory component.
static FwSmDesc_t inRep[CR_FW_INFACTORY_MAX_NOF_INREP]
The pre-allocated InReport instances.
Definition: CrFwInFactory.c:61
Definition of the utility functions for the CORDET Framework.
CrFwBool_t CrFwInFactoryTestCase1()
Test the creation and configuration of the InFactory singleton component.
void CrFwCmpReset(FwSmDesc_t smDesc)
Reset a framework component.
Definition: CrFwBaseCmp.c:117
CrFwInFactoryPoolIndex_t CrFwInFactoryGetMaxNOfInCmd()
Return the maximum number of InCommands which may be allocated at any one time.
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 CrFwInFactoryReleaseInRep(FwSmDesc_t inRepInstance)
Release function for an InReport.
Definition of Base Component.
CrFwBool_t CrFwCmpIsStarted(FwSmDesc_t smDesc)
Return true if the state machine of the argument component has been started.
Definition: CrFwBaseCmp.c:162
FwSmDesc_t CrFwInFactoryMake()
Factory function for the singleton instance of the InFactory.
CrFwBool_t CrFwInFactoryTestCase7()
Test the InReport part of the Release function of the InFactory component.
The CORDET Framework defines an interface for generating error reports (see CrFwRepErr.h).
void CrFwInFactoryReleaseInCmd(FwSmDesc_t inCmdInstance)
Release function for an InCommand.
CrFwCounterU2_t CrFwPcktGetNOfAllocated()
Return the number of packets which are currently allocated.
Definition: CrFwPckt.c:196
User-modifiable parameters for the OutRegistry component (see CrFwOutRegistry.h). ...
FwSmDesc_t CrFwInFactoryMakeInRep(CrFwPckt_t pckt)
Make function for a component encapsulating an incoming report (InReport).
CrFwInFactoryPoolIndex_t CrFwInFactoryGetNOfAllocatedInCmd()
Return the number of InCommands which are currently allocated.
CrFwBool_t CrFwInFactoryTestCase5()
Test the InReport creation service in non-nominal situations where the creation fails.
static FwSmDesc_t inCmd[CR_FW_INFACTORY_MAX_NOF_INCMD]
The pre-allocated InCommand instances.
Definition: CrFwInFactory.c:58
CrFwInFactoryPoolIndex_t CrFwInFactoryGetNOfAllocatedInRep()
Return the number of InReports which are currently allocated.
void CrFwCmpShutdown(FwSmDesc_t smDesc)
Shutdown a framework component.
Definition: CrFwBaseCmp.c:122
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.
An InCommand release request has encountered an error (see CrFwInFactoryReleaseInCmd).
CrFwBool_t CrFwInFactoryTestCase2()
Test the InCommand creation service in non-nominal situations where the creation fails.
CrFwInFactoryPoolIndex_t CrFwInFactoryGetMaxNOfInRep()
Return the maximum number of InReports which may be allocated at any one time.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved