CORDET Framework - C2 Implementation
CrFwOutRegistryTestCases.c
Go to the documentation of this file.
1 
19 #include <stdio.h>
20 #include <stdlib.h>
21 /* Include FW Profile files */
22 #include "FwSmConstants.h"
23 #include "FwSmConfig.h"
24 #include "FwSmCore.h"
25 #include "FwPrConfig.h"
26 #include "FwPrCore.h"
27 #include "FwPrConstants.h"
28 /* Include framework files */
29 #include "CrFwOutRegistryUserPar.h"
31 #include "BaseCmp/CrFwBaseCmp.h"
32 #include "Pckt/CrFwPckt.h"
34 #include "CrFwTime.h"
35 #include "CrFwRepErr.h"
37 /* Include configuration files */
38 #include "CrFwRepErrStub.h"
40 #include "CrFwCmpData.h"
41 
42 /* ---------------------------------------------------------------------------------------------*/
44  FwSmDesc_t outRegistry1, outRegistry2;
46 
47  /* Instantiate the OutRegistry */
48  outRegistry1 = CrFwOutRegistryMake();
49  if (outRegistry1 == NULL)
50  return 0;
51 
52  /* Instantiate it again and check that same component is returned */
53  outRegistry2 = CrFwOutRegistryMake();
54  if (outRegistry1 != outRegistry2)
55  return 0;
56 
57  /* Check configuration of OutRegistry */
58  if (FwSmCheckRec(outRegistry1) != smSuccess)
59  return 0;
60 
61  /* Initialize outRegistry and check success */
62  if (!CrFwCmpIsInCreated(outRegistry1))
63  return 0;
64 
65  CrFwCmpInit(outRegistry1);
66  if (!CrFwCmpIsInInitialized(outRegistry1))
67  return 0;
68 
69  /* Reset OutRegistry */
70  CrFwCmpReset(outRegistry1);
71  if (!CrFwCmpIsInConfigured(outRegistry1))
72  return 0;
73 
74  /* Check component type */
75  outRegistryData = (CrFwCmpData_t*)FwSmGetData(outRegistry1);
76  if (outRegistryData->instanceId != 0)
77  return 0;
78  if (outRegistryData->typeId != CR_FW_OUTREGISTRY_TYPE)
79  return 0;
80 
81  return 1;
82 }
83 
84 /*--------------------------------------------------------------------------------*/
86 
87  if (CrFwOutRegistryGetServType(0) != 1)
88  return 0;
89 
90  if (CrFwOutRegistryGetServType(8) != 25)
91  return 0;
92 
93  if (CrFwOutRegistryGetServType(4) != 5)
94  return 0;
95 
97  return 0;
98 
100  return 0;
101 
102  if (CrFwOutRegistryGetServSubType(4) != 1)
103  return 0;
104 
106  return 0;
107 
109  return 0;
110 
112  return 0;
113 
115  return 0;
116 
117  if (CrFwOutRegistryGetCmdRepIndex(1,7) != 2)
118  return 0;
119 
120  if (CrFwOutRegistryGetCmdRepIndex(1,1) != 0)
121  return 0;
122 
123  if (CrFwOutRegistryGetCmdRepIndex(1,8) != 3)
124  return 0;
125 
126  if (CrFwOutRegistryGetCmdRepIndex(25,3) != 8)
127  return 0;
128 
130  return 0;
131 
133  return 0;
134 
136  return 0;
137 
139  return 0;
140 
141  return 1;
142 }
143 
144 /*--------------------------------------------------------------------------------*/
146  FwSmDesc_t outRegistry, outFactory, outCmp;
147 
148  /* Instantiate the OutRegistry */
149  outRegistry = CrFwOutRegistryMake();
150  if (outRegistry == NULL)
151  return 0;
152 
153  /* Initialize and configure outRegistry */
154  CrFwCmpInit(outRegistry);
155  CrFwCmpReset(outRegistry);
156  if (!CrFwCmpIsInConfigured(outRegistry))
157  return 0;
158 
159  /* Instantiate the OutFactory */
160  outFactory = CrFwOutFactoryMake();
161  if (outFactory == NULL)
162  return 0;
163 
164  /* Check configuration of OutFactory */
165  if (FwSmCheckRec(outFactory) != smSuccess)
166  return 0;
167 
168  /* Initialize OutFactory and check success */
169  if (!CrFwCmpIsInCreated(outFactory))
170  return 0;
171 
172  CrFwCmpInit(outFactory);
173  if (!CrFwCmpIsInInitialized(outFactory))
174  return 0;
175 
176  /* Reset OutFactory */
177  CrFwCmpReset(outFactory);
178  if (!CrFwCmpIsInConfigured(outFactory))
179  return 0;
180 
181  /* Retrieve an OutComponent from the OutFactory (see CrFwOutRegistryUserPar.h) */
182  outCmp = CrFwOutFactoryMakeOutCmp(50,1,0,0);
183 
184  /* Check that OutComponent is enabled */
185  if (CrFwOutRegistryIsEnabled(outCmp) != 1)
186  return 0;
187 
188  /* Disable OutComponent's service type and check OutComponent's enable state */
189  CrFwOutRegistrySetEnable(50,0,0,0);
190  if (CrFwOutRegistryIsEnabled(outCmp) != 0)
191  return 0;
192 
193  /* Reset enable state */
194  CrFwOutRegistrySetEnable(50,0,0,1);
195  if (CrFwOutRegistryIsEnabled(outCmp) != 1)
196  return 0;
197 
198  /* Disable OutComponent's service sub-type and check OutComponent's enable state */
199  CrFwOutRegistrySetEnable(50,1,0,0);
200  if (CrFwOutRegistryIsEnabled(outCmp) != 0)
201  return 0;
202 
203  /* Reset enable state */
204  CrFwOutRegistrySetEnable(50,1,0,1);
205  if (CrFwOutRegistryIsEnabled(outCmp) != 1)
206  return 0;
207 
208  /* Release OutComponent */
210 
211  /* Check that there are no allocated packets */
212  if (CrFwPcktGetNOfAllocated() != 0)
213  return 0;
214 
215  /* Check application errors */
216  if (CrFwGetAppErrCode() != crNoAppErr)
217  return 0;
218 
219  return 1;
220 }
221 
222 /*--------------------------------------------------------------------------------*/
224  FwSmDesc_t outRegistry, outFactory, outCmp;
225 
226  /* Instantiate the OutRegistry */
227  outRegistry = CrFwOutRegistryMake();
228  if (outRegistry == NULL)
229  return 0;
230 
231  /* Initialize and configure OutRegistry */
232  CrFwCmpInit(outRegistry);
233  CrFwCmpReset(outRegistry);
234  if (!CrFwCmpIsInConfigured(outRegistry))
235  return 0;
236 
237  /* Instantiate the OutFactory */
238  outFactory = CrFwOutFactoryMake();
239  if (outFactory == NULL)
240  return 0;
241 
242  /* Initialize and configure OutFactory */
243  CrFwCmpInit(outFactory);
244  CrFwCmpReset(outFactory);
245  if (!CrFwCmpIsInConfigured(outFactory))
246  return 0;
247 
248  /* Retrieve an OutComponent from the OutFactory (see CrFwOutRegistryUserPar.h and CrFwOutFactoryUserPar.h) */
249  outCmp = CrFwOutFactoryMakeOutCmp(1,2,2,0);
250 
251  /* Check that OutComponent is enabled */
252  if (CrFwOutRegistryIsEnabled(outCmp) != 1)
253  return 0;
254 
255  /* Disable OutComponent's service type and check OutComponent's enable state */
256  CrFwOutRegistrySetEnable(1,0,0,0);
257  if (CrFwOutRegistryIsEnabled(outCmp) != 0)
258  return 0;
259 
260  /* Reset enable state */
261  CrFwOutRegistrySetEnable(1,0,0,1);
262  if (CrFwOutRegistryIsEnabled(outCmp) != 1)
263  return 0;
264 
265  /* Disable OutComponent's service sub-type and check OutComponent's enable state */
266  CrFwOutRegistrySetEnable(1,2,0,0);
267  if (CrFwOutRegistryIsEnabled(outCmp) != 0)
268  return 0;
269 
270  /* Reset enable state */
271  CrFwOutRegistrySetEnable(1,2,0,1);
272  if (CrFwOutRegistryIsEnabled(outCmp) != 1)
273  return 0;
274 
275  /* Disable OutComponent's discriminant and check OutComponent's enable state */
276  CrFwOutRegistrySetEnable(1,2,2,0);
277  if (CrFwOutRegistryIsEnabled(outCmp) != 0)
278  return 0;
279 
280  /* Reset enable state */
281  CrFwOutRegistrySetEnable(1,2,2,1);
282  if (CrFwOutRegistryIsEnabled(outCmp) != 1)
283  return 0;
284 
285  /* Release OutComponent */
287 
288  /* Check that there are no allocated packets */
289  if (CrFwPcktGetNOfAllocated() != 0)
290  return 0;
291 
292  /* Check application errors */
293  if (CrFwGetAppErrCode() != crNoAppErr)
294  return 0;
295 
296  return 1;
297 }
298 
299 /*--------------------------------------------------------------------------------*/
301  FwSmDesc_t outRegistry, outFactory, outCmp1, outCmp2;
302  CrFwCmdRepIndex_t outCmpCmdRepIndex;
303 
304  /* Instantiate the OutRegistry */
305  outRegistry = CrFwOutRegistryMake();
306  if (outRegistry == NULL)
307  return 0;
308 
309  /* Initialize and configure OutRegistry */
310  CrFwCmpInit(outRegistry);
311  CrFwCmpReset(outRegistry);
312  if (!CrFwCmpIsInConfigured(outRegistry))
313  return 0;
314 
315  /* Instantiate the OutFactory */
316  outFactory = CrFwOutFactoryMake();
317  if (outFactory == NULL)
318  return 0;
319 
320  /* Initialize and configure OutFactory */
321  CrFwCmpInit(outFactory);
322  CrFwCmpReset(outFactory);
323  if (!CrFwCmpIsInConfigured(outFactory))
324  return 0;
325 
326  /* Retrieve two OutComponents from the OutFactory (see CrFwOutRegistryUserPar.h and CrFwOutFactoryUserPar.h) */
327  outCmp1 = CrFwOutFactoryMakeOutCmp(5,3,30,0);
328  outCmp2 = CrFwOutFactoryMakeOutCmp(5,3,31,0);
329  outCmpCmdRepIndex = CrFwOutRegistryGetCmdRepIndex(5,3);
330 
331  /* Check that OutComponents are enabled */
332  if (CrFwOutRegistryIsEnabled(outCmp1) != 1)
333  return 0;
334  if (CrFwOutRegistryIsEnabled(outCmp2) != 1)
335  return 0;
336  if (CrFwOutRegistryIsDiscriminantEnabled(outCmpCmdRepIndex, 30) != 1)
337  return 0;
338  if (CrFwOutRegistryIsDiscriminantEnabled(outCmpCmdRepIndex, 31) != 1)
339  return 0;
340 
341  /* Disable the first OutComponent */
342  CrFwOutRegistrySetEnable(5,3,30,0);
343  if (CrFwOutRegistryIsEnabled(outCmp1) != 0)
344  return 0;
345  if (CrFwOutRegistryIsEnabled(outCmp2) != 1)
346  return 0;
347  if (CrFwOutRegistryIsDiscriminantEnabled(outCmpCmdRepIndex, 31) != 1)
348  return 0;
349  if (CrFwOutRegistryIsDiscriminantEnabled(outCmpCmdRepIndex, 30) != 0)
350  return 0;
351 
352  /* Disable the second OutComponent */
353  CrFwOutRegistrySetEnable(5,3,30,1);
354  CrFwOutRegistrySetEnable(5,3,31,0);
355  if (CrFwOutRegistryIsEnabled(outCmp1) != 1)
356  return 0;
357  if (CrFwOutRegistryIsEnabled(outCmp2) != 0)
358  return 0;
359  if (CrFwOutRegistryIsDiscriminantEnabled(outCmpCmdRepIndex, 30) != 1)
360  return 0;
361  if (CrFwOutRegistryIsDiscriminantEnabled(outCmpCmdRepIndex, 31) != 0)
362  return 0;
363 
364  /* Disable both OutComponents */
365  CrFwOutRegistrySetEnable(5,3,30,0);
366  CrFwOutRegistrySetEnable(5,3,31,0);
367  if (CrFwOutRegistryIsEnabled(outCmp1) != 0)
368  return 0;
369  if (CrFwOutRegistryIsEnabled(outCmp2) != 0)
370  return 0;
371  if (CrFwOutRegistryIsDiscriminantEnabled(outCmpCmdRepIndex, 30) != 0)
372  return 0;
373  if (CrFwOutRegistryIsDiscriminantEnabled(outCmpCmdRepIndex, 31) != 0)
374  return 0;
375 
376  /* Enable both OutComponents */
377  CrFwOutRegistrySetEnable(5,3,30,1);
378  CrFwOutRegistrySetEnable(5,3,31,1);
379  if (CrFwOutRegistryIsEnabled(outCmp1) != 1)
380  return 0;
381  if (CrFwOutRegistryIsEnabled(outCmp2) != 1)
382  return 0;
383 
384  /* Release OutComponents */
387 
388  /* Check that there are no allocated packets */
389  if (CrFwPcktGetNOfAllocated() != 0)
390  return 0;
391 
392  /* Check application errors */
393  if (CrFwGetAppErrCode() != crNoAppErr)
394  return 0;
395 
396  return 1;
397 }
398 
399 /*--------------------------------------------------------------------------------*/
401  FwSmDesc_t outRegistry;
402 
403  /* Instantiate the OutRegistry */
404  outRegistry = CrFwOutRegistryMake();
405  if (outRegistry == NULL)
406  return 0;
407 
408  /* Initialize and configure OutRegistry */
409  CrFwCmpInit(outRegistry);
410  CrFwCmpReset(outRegistry);
411  if (!CrFwCmpIsInConfigured(outRegistry))
412  return 0;
413 
414  /* Disable non-existent service types */
415  CrFwOutRegistrySetEnable(4,0,0,0);
417  return 0;
419  CrFwOutRegistrySetEnable(150,0,0,0);
421  return 0;
423 
424  /* Disable non-existent service sub-type */
425  CrFwOutRegistrySetEnable(25,2,0,0);
427  return 0;
429  CrFwOutRegistrySetEnable(25,4,0,0);
431  return 0;
433 
434  /* Disable non-existent discriminant value (higher than upper bound) */
435  CrFwOutRegistrySetEnable(5,4,41,0);
437  return 0;
439 
440  /* Disable non-existent discriminant value (lower than lower bound) */
441  CrFwOutRegistrySetEnable(5,3,19,0);
443  return 0;
445 
446  return 1;
447 }
448 
449 /*--------------------------------------------------------------------------------*/
451  FwSmDesc_t outRegistry, outFactory, outCmp1, outCmp2, outCmp3;
452  CrFwCounterU2_t i;
453  CrFwCmpData_t* cmpData;
454 
455  /* Instantiate the OutRegistry */
456  outRegistry = CrFwOutRegistryMake();
457  if (outRegistry == NULL)
458  return 0;
459 
460  /* Initialize and configure OutRegistry */
461  CrFwCmpInit(outRegistry);
462  CrFwCmpReset(outRegistry);
463  if (!CrFwCmpIsInConfigured(outRegistry))
464  return 0;
465 
466  /* Instantiate the OutFactory */
467  outFactory = CrFwOutFactoryMake();
468  if (outFactory == NULL)
469  return 0;
470 
471  /* Initialize and configure OutFactory */
472  CrFwCmpInit(outFactory);
473  CrFwCmpReset(outFactory);
474  if (!CrFwCmpIsInConfigured(outFactory))
475  return 0;
476 
477  /* Retrieve three OutComponents from the OutFactory (see CrFwOutRegistryUserPar.h and CrFwOutFactoryUserPar.h) */
478  outCmp1 = CrFwOutFactoryMakeOutCmp(5,3,30,0);
479  outCmp2 = CrFwOutFactoryMakeOutCmp(5,3,31,0);
480  outCmp3 = CrFwOutFactoryMakeOutCmp(5,3,31,0);
481 
485 
486  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp1);
488  return 0;
489  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp2);
491  return 0;
492  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp3);
494  return 0;
495 
499 
500  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp1);
502  return 0;
503  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp2);
505  return 0;
506  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp3);
508  return 0;
509 
510  for (i=0; i<CR_FW_OUTREGISTRY_N; i++) {
512  outCmp1 = CrFwOutFactoryMakeOutCmp(5,3,30,0);
514  }
515 
517 
518  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp1);
520  return 0;
521  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp2);
523  return 0;
524  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp3);
526  return 0;
527 
528  /* Release all OutComponents */
532 
533  /* Check that there are no allocated packets */
534  if (CrFwPcktGetNOfAllocated() != 0)
535  return 0;
536 
537  /* Check application errors */
538  if (CrFwGetAppErrCode() != crNoAppErr)
539  return 0;
540 
541  return 1;
542 }
543 
544 /*--------------------------------------------------------------------------------*/
546  FwSmDesc_t outRegistry, outFactory, outCmp1, outCmp2, outCmp3;
547  CrFwCmpData_t* cmpData;
548 
549  /* Instantiate the OutRegistry */
550  outRegistry = CrFwOutRegistryMake();
551  if (outRegistry == NULL)
552  return 0;
553 
554  /* Initialize and configure OutRegistry */
555  CrFwCmpInit(outRegistry);
556  CrFwCmpReset(outRegistry);
557  if (!CrFwCmpIsInConfigured(outRegistry))
558  return 0;
559 
560  /* Instantiate the OutFactory */
561  outFactory = CrFwOutFactoryMake();
562  if (outFactory == NULL)
563  return 0;
564 
565  /* Initialize and configure OutFactory */
566  CrFwCmpInit(outFactory);
567  CrFwCmpReset(outFactory);
568  if (!CrFwCmpIsInConfigured(outFactory))
569  return 0;
570 
571  /* Retrieve three OutComponents from the OutFactory (see CrFwOutRegistryUserPar.h and CrFwOutFactoryUserPar.h) */
572  outCmp1 = CrFwOutFactoryMakeOutCmp(1,1,0,0);
573  outCmp2 = CrFwOutFactoryMakeOutCmp(25,3,0,0);
574  outCmp3 = CrFwOutFactoryMakeOutCmp(5,4,3,0);
575 
579 
580  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp1);
582  return 0;
583  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp2);
585  return 0;
586  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp3);
588  return 0;
589 
590  /* Disable service 1, service (5,1) and service (5,4,3) */
591  CrFwOutRegistrySetEnable(1,0,0,0);
592  CrFwOutRegistrySetEnable(25,3,0,0);
593  CrFwOutRegistrySetEnable(5,4,3,0);
594 
595  if (CrFwOutRegistryIsEnabled(outCmp1) == 1)
596  return 0;
597  if (CrFwOutRegistryIsEnabled(outCmp2) == 1)
598  return 0;
599  if (CrFwOutRegistryIsEnabled(outCmp3) == 1)
600  return 0;
601 
602  /* Shutdown OutRegistry and check success */
603  CrFwCmpShutdown(outRegistry);
604  if (CrFwCmpIsStarted(outRegistry) == 1)
605  return 0;
606  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp1);
608  return 0;
609  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp2);
611  return 0;
612  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp3);
614  return 0;
615 
616  /* Release all OutComponents */
620 
621  /* Restart the OutRegistry */
622  FwSmStart(outRegistry);
623 
624  /* Check that there are no allocated packets */
625  if (CrFwPcktGetNOfAllocated() != 0)
626  return 0;
627 
628  /* Check application errors */
629  if (CrFwGetAppErrCode() != crNoAppErr)
630  return 0;
631 
632  return 1;
633 }
634 
635 /*--------------------------------------------------------------------------------*/
637  FwSmDesc_t outRegistry, outFactory, outCmp1, outCmp2, outCmp3;
638  CrFwCmpData_t* cmpData;
639 
640  /* Instantiate the OutRegistry */
641  outRegistry = CrFwOutRegistryMake();
642  if (outRegistry == NULL)
643  return 0;
644 
645  /* Initialize and configure OutRegistry */
646  CrFwCmpInit(outRegistry);
647  CrFwCmpReset(outRegistry);
648  if (!CrFwCmpIsInConfigured(outRegistry))
649  return 0;
650 
651  /* Instantiate the OutFactory */
652  outFactory = CrFwOutFactoryMake();
653  if (outFactory == NULL)
654  return 0;
655 
656  /* Initialize and configure OutFactory */
657  CrFwCmpInit(outFactory);
658  CrFwCmpReset(outFactory);
659  if (!CrFwCmpIsInConfigured(outFactory))
660  return 0;
661 
662  /* Retrieve three OutComponents from the OutFactory (see CrFwOutRegistryUserPar.h and CrFwOutFactoryUserPar.h) */
663  outCmp1 = CrFwOutFactoryMakeOutCmp(1,1,0,0);
664  outCmp2 = CrFwOutFactoryMakeOutCmp(25,3,0,0);
665  outCmp3 = CrFwOutFactoryMakeOutCmp(5,4,3,0);
666 
670 
671  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp1);
673  return 0;
674  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp2);
676  return 0;
677  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp3);
679  return 0;
680 
681  /* Disable service 1, service (5,1) and service (5,4,3) */
682  CrFwOutRegistrySetEnable(1,0,0,0);
683  CrFwOutRegistrySetEnable(25,3,0,0);
684  CrFwOutRegistrySetEnable(5,4,3,0);
685 
686  if (CrFwOutRegistryIsEnabled(outCmp1) == 1)
687  return 0;
688  if (CrFwOutRegistryIsEnabled(outCmp2) == 1)
689  return 0;
690  if (CrFwOutRegistryIsEnabled(outCmp3) == 1)
691  return 0;
692 
693  /* Reset OutRegistry and check success */
694  CrFwCmpReset(outRegistry);
695  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp1);
697  return 0;
698  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp2);
700  return 0;
701  cmpData = (CrFwCmpData_t*)FwSmGetData(outCmp3);
703  return 0;
704  if (CrFwOutRegistryIsEnabled(outCmp1) != 1)
705  return 0;
706  if (CrFwOutRegistryIsEnabled(outCmp2) != 1)
707  return 0;
708  if (CrFwOutRegistryIsEnabled(outCmp3) != 1)
709  return 0;
710 
711  /* Release all OutComponents */
715 
716  /* Check that there are no allocated packets */
717  if (CrFwPcktGetNOfAllocated() != 0)
718  return 0;
719 
720  /* Check application errors */
721  if (CrFwGetAppErrCode() != crNoAppErr)
722  return 0;
723 
724  return 1;
725 }
726 
Type for the Framework Component Data (FCD).
Definition: CrFwCmpData.h:79
Interface through which framework components access the current time.
CrFwBool_t CrFwOutRegistryTestCase9()
Test the reset service of the OutRegistry.
void CrFwCmpInit(FwSmDesc_t smDesc)
Initialize a framework component.
Definition: CrFwBaseCmp.c:112
Definition of the Framework Component Data (FCD) Type.
CrFwDiscriminant_t CrFwOutRegistryGetLowerDiscriminant(CrFwCmdRepIndex_t cmdRepIndex)
Get the lower bound of the argument command or report index.
CrFwBool_t CrFwOutRegistryTestCase1()
Test the creation and configuration of the OutRegistry singleton component.
static FwSmDesc_t outCmp[CR_FW_OUTFACTORY_MAX_NOF_OUTCMP]
The pre-allocated OutComponent instances.
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).
Out-going command or report is not tracked.
CrFwBool_t CrFwCmpIsInCreated(FwSmDesc_t smDesc)
Return true if the argument component is in state CREATED.
Definition: CrFwBaseCmp.c:167
CrFwOutRegistryCmdRepState_t CrFwOutRegistryGetState(CrFwInstanceId_t cmdRepId)
Query the OutRegistry for the state of an out-going command or report.
unsigned short CrFwCmdRepIndex_t
Type for the index of a command or report in the InRegistry or OutRegistry.
Definition: CrFwConstants.h:35
CrFwBool_t CrFwOutRegistryTestCase4()
Test the functions to set and read the enable status of an OutComponent with a discriminant.
Definition of the OutFactory component.
A framework function was called with an illegal service type.
Interface for creating and accessing a report or command packet.
CrFwBool_t CrFwOutRegistryTestCase5()
Test the non-interference of the setting of the enable status for two different discriminant values...
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
Definition: CrFwConstants.h:32
Definition of the OutRegistry Component.
CrFwBool_t CrFwOutRegistryTestCase6()
Test the response of the OutRegistry to an attempt to disable a non-existent kind of OutComponent...
void CrFwOutRegistryStartTracking(FwSmDesc_t outCmp)
Ask the OutRegistry to start tracking an out-going command or report.
Out-going command or report is pending (waiting to be sent)
CrFwBool_t CrFwOutRegistryIsDiscriminantEnabled(CrFwCmdRepIndex_t cmdRepIndex, CrFwDiscriminant_t disc)
Get the enable status of a discriminant in the argument command or report index.
CrFwBool_t CrFwCmpIsInInitialized(FwSmDesc_t smDesc)
Return true if the argument component is in state INITIALIZED.
Definition: CrFwBaseCmp.c:172
CrFwInstanceId_t instanceId
The instance identifier of the framework component.
Definition: CrFwCmpData.h:81
CrFwCmdRepIndex_t CrFwOutRegistryGetCmdRepIndex(CrFwServType_t servType, CrFwServSubType_t servSubType)
Get the index corresponding to the argument [service type, service sub-type] of an out-going command ...
CrFwBool_t CrFwOutRegistryTestCase2()
Test the functions to manipulate the type, sub-type, discriminant and index of an out-going command o...
static FwSmDesc_t outFactory
The singleton instance of the OutFactory.
Interface for reporting an error detected by a framework component.
void CrFwOutRegistryUpdateState(FwSmDesc_t outCmp, CrFwOutRegistryCmdRepState_t newState)
Ask the OutRegistry to update the state of an out-going command or report.
CrFwBool_t CrFwOutRegistryTestCase3()
Test the functions to set and read the enable status of an OutComponent without a discriminant...
CrFwBool_t CrFwOutRegistryTestCase8()
Test the shutdown service of the OutRegistry.
CrFwServType_t CrFwOutRegistryGetServType(CrFwCmdRepIndex_t cmdRepIndex)
Get the service type of the argument command or report index.
unsigned short CrFwCounterU2_t
Type used for unsigned integers with a "medium" range.
CrFwBool_t CrFwOutRegistryIsEnabled(FwSmDesc_t outCmp)
Query the enable status of an out-going command or report.
A framework function was called with an illegal service sub-type.
CrFwDiscriminant_t CrFwOutRegistryGetUpperDiscriminant(CrFwCmdRepIndex_t cmdRepIndex)
Get the upper bound of the argument command or report index.
static FwSmDesc_t outRegistry
The OutRegistry singleton.
Definition of the utility functions for the CORDET Framework.
FwSmDesc_t CrFwOutRegistryMake()
Factory function for the singleton instance of the OutRegistry.
void CrFwCmpReset(FwSmDesc_t smDesc)
Reset a framework component.
Definition: CrFwBaseCmp.c:117
static CrFwCmpData_t outRegistryData
The data for the OutRegistry singleton.
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
#define CR_FW_OUTREGISTRY_N
The maximum number of out-going commands or reports which can be tracked by the OutRegistry.
void CrFwOutFactoryReleaseOutCmp(FwSmDesc_t outCmpInstance)
Release function for an OutComponent.
Out-going command or report has been aborted.
The CORDET Framework defines an interface for generating error reports (see CrFwRepErr.h).
Out-going command or report has been passed to the OutStream.
CrFwCounterU2_t CrFwPcktGetNOfAllocated()
Return the number of packets which are currently allocated.
Definition: CrFwPckt.c:196
FwSmDesc_t CrFwOutFactoryMake()
Factory function for the singleton instance of the OutFactory.
Declaration of the test cases for the OutRegistry Component (see CrFwOutRegistry.h).
User-modifiable parameters for the OutRegistry component (see CrFwOutRegistry.h). ...
CrFwTypeId_t typeId
The type identifier of the framework component.
Definition: CrFwCmpData.h:83
void CrFwOutRegistrySetEnable(CrFwServType_t servType, CrFwServSubType_t servSubType, CrFwDiscriminant_t discriminant, CrFwBool_t isEnabled)
Set the enable state of a set of out-going commands or reports.
#define CR_FW_OUTREGISTRY_NSERV
The total number of service types/sub-types provided by the application.
CrFwBool_t CrFwOutRegistryTestCase7()
Test the ability of the OutRegistry to track the state of an OutComponent.
void CrFwCmpShutdown(FwSmDesc_t smDesc)
Shutdown a framework component.
Definition: CrFwBaseCmp.c:122
No application errors have been detected.
#define CR_FW_OUTREGISTRY_TYPE
Type identifier for the OutRegistry component.
FwSmDesc_t CrFwOutFactoryMakeOutCmp(CrFwServType_t type, CrFwServSubType_t subType, CrFwDiscriminant_t discriminant, CrFwPcktLength_t length)
Make function for an OutComponent.
A framework function was called with an illegal discriminant.
CrFwServSubType_t CrFwOutRegistryGetServSubType(CrFwCmdRepIndex_t cmdRepIndex)
Get the service sub-type of the argument command or report index.
CrFwAppErrCode_t CrFwGetAppErrCode()
Return the value of the application error code.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved