CORDET Framework - C2 Implementation
CrFwSocketTestCases.c
Go to the documentation of this file.
1 
19 #include <stdlib.h>
20 #include "CrFwRepErrStub.h"
21 #include "CrFwInStreamSocket.h"
22 #include "CrFwClientSocket.h"
23 #include "CrFwServerSocket.h"
24 #include "CrFwOutStreamSocket.h"
25 #include "CrFwInStreamTestCases.h"
26 #include "CrFwInStreamStub.h"
27 /* Include FW Profile files */
28 #include "FwSmConstants.h"
29 #include "FwSmConfig.h"
30 #include "FwSmCore.h"
31 #include "FwPrConfig.h"
32 #include "FwPrCore.h"
33 #include "FwPrConstants.h"
34 /* Include configuration files */
35 #include "CrFwInStreamUserPar.h"
36 #include "CrFwCmpData.h"
37 /* Include framework files */
38 #include "InStream/CrFwInStream.h"
39 #include "BaseCmp/CrFwBaseCmp.h"
40 #include "Pckt/CrFwPckt.h"
41 #include "CrFwTime.h"
42 #include "CrFwRepErr.h"
44 /* Include system files */
45 #include <unistd.h>
46 
47 /* ---------------------------------------------------------------------------------------------*/
49  FwSmDesc_t inStream5, outStream5;
50  CrFwPckt_t pcktSend, pcktRec, pcktSend1, pcktRec1, pcktSend2, pcktRec2;
51 
52  /* Instantiate and start the socket-based InStream and OutStream */
53  inStream5 = CrFwInStreamMake(4);
54  if (inStream5 == NULL)
55  return 0;
56  FwSmStart(inStream5);
57  if (!CrFwCmpIsInCreated(inStream5))
58  return 0;
59 
60  outStream5 = CrFwOutStreamMake(4);
61  if (outStream5 == NULL)
62  return 0;
63  FwSmStart(outStream5);
64  if (!CrFwCmpIsInCreated(outStream5))
65  return 0;
66 
67  /* Set port number and host name */
69  CrFwInStreamSocketSetHost("localhost");
71 
72  /* Initialize the OutStream (the server) */
73  CrFwCmpInit(outStream5);
74  if (!CrFwCmpIsInInitialized(outStream5))
75  return 0;
76 
77  /* Wait 1-2 seconds */
78  sleep(1);
79 
80  /* Initialize the InStream (the client) */
81  CrFwCmpInit(inStream5);
82  if (!CrFwCmpIsInInitialized(inStream5))
83  return 0;
84 
85  /* Configure the InStream and OutStream */
86  CrFwCmpReset(inStream5);
87  if (!CrFwCmpIsInConfigured(inStream5)) {
88  CrFwCmpShutdown(inStream5);
89  CrFwCmpShutdown(outStream5);
90  return 0;
91  }
92 
93  /* Wait 1-2 seconds */
94  sleep(1);
95 
96  CrFwCmpReset(outStream5);
97  if (!CrFwCmpIsInConfigured(outStream5)) {
98  CrFwCmpShutdown(inStream5);
99  CrFwCmpShutdown(outStream5);
100  return 0;
101  }
102 
103  /* Send a packet through the OutStream */
104  pcktSend = CrFwPcktMake(100);
105  pcktSend[90] = 99; /* marker */
107  CrFwOutStreamSend(outStream5, pcktSend);
108  CrFwPcktRelease(pcktSend);
109 
110  /* Wait 1-2 seconds */
111  sleep(1);
112 
113  /* Poll the InStream and check that packet was received */
114  CrFwInStreamSocketPoll(inStream5);
115  pcktRec = CrFwInStreamGetPckt(inStream5);
116  if (pcktRec[90] != 99) {
117  CrFwCmpShutdown(inStream5);
118  CrFwCmpShutdown(outStream5);
119  return 0;
120  }
121  CrFwPcktRelease(pcktRec);
122 
123  /* Send two packets through the OutStream */
124  pcktSend1 = CrFwPcktMake(100);
125  pcktSend1[90] = 11; /* marker */
126  CrFwPcktSetSrc(pcktSend1, CR_FW_HOST_APP_ID);
127  CrFwOutStreamSend(outStream5, pcktSend1);
128  CrFwPcktRelease(pcktSend1);
129 
130  pcktSend2 = CrFwPcktMake(100);
131  pcktSend2[90] = 22; /* marker */
132  CrFwPcktSetSrc(pcktSend2, CR_FW_HOST_APP_ID);
133  CrFwOutStreamSend(outStream5, pcktSend2);
134  CrFwPcktRelease(pcktSend2);
135 
136  /* Wait 1-2 seconds */
137  sleep(1);
138 
139  /* Poll the InStream and check that both packets are received */
140  CrFwInStreamSocketPoll(inStream5);
141  pcktRec1 = CrFwInStreamGetPckt(inStream5);
142  if (pcktRec1[90] != 11) {
143  CrFwCmpShutdown(inStream5);
144  CrFwCmpShutdown(outStream5);
145  return 0;
146  }
147  pcktRec2 = CrFwInStreamGetPckt(inStream5);
148  if (pcktRec2[90] != 22) {
149  CrFwCmpShutdown(inStream5);
150  CrFwCmpShutdown(outStream5);
151  return 0;
152  }
153  if (CrFwInStreamGetPckt(inStream5) != NULL) {
154  CrFwCmpShutdown(inStream5);
155  CrFwCmpShutdown(outStream5);
156  return 0;
157  }
158  CrFwPcktRelease(pcktRec1);
159  CrFwPcktRelease(pcktRec2);
160 
161  /* Poll the InStream and check that nothing is returned */
162  CrFwInStreamSocketPoll(inStream5);
163  if (CrFwInStreamGetPckt(inStream5) != NULL) {
164  CrFwCmpShutdown(inStream5);
165  CrFwCmpShutdown(outStream5);
166  return 0;
167  }
168 
169  /* Wait 1-2 seconds */
170  sleep(1);
171 
172  /* Shutdown the InStream and OutStream (this will close the sockets) */
173  CrFwCmpShutdown(inStream5);
174  CrFwCmpShutdown(outStream5);
175 
176  /* Check that all packets have been de-allocated */
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 inStream6, inStream7, outStream6, outStream7;
190  CrFwPckt_t pcktSend, pcktRec;
191 
192  /* Instantiate and start the socket-based InStreams and OutStreams */
193  inStream6 = CrFwInStreamMake(5);
194  if (inStream6 == NULL)
195  return 0;
196  FwSmStart(inStream6);
197  if (!CrFwCmpIsInCreated(inStream6))
198  return 0;
199 
200  inStream7 = CrFwInStreamMake(6);
201  if (inStream7 == NULL)
202  return 0;
203  FwSmStart(inStream7);
204  if (!CrFwCmpIsInCreated(inStream7))
205  return 0;
206 
207  outStream6 = CrFwOutStreamMake(5);
208  if (outStream6 == NULL)
209  return 0;
210  FwSmStart(outStream6);
211  if (!CrFwCmpIsInCreated(outStream6))
212  return 0;
213 
214  outStream7 = CrFwOutStreamMake(6);
215  if (outStream7 == NULL)
216  return 0;
217  FwSmStart(outStream7);
218  if (!CrFwCmpIsInCreated(outStream7))
219  return 0;
220 
221  /* Set port number and host name */
223  CrFwClientSocketSetHost("localhost");
225 
226  /* Initialize the server socket */
227  CrFwCmpInit(outStream7);
228  if (!CrFwCmpIsInInitialized(outStream7))
229  return 0;
230  CrFwCmpInit(inStream7);
231  if (!CrFwCmpIsInInitialized(inStream7))
232  return 0;
233 
234  /* Wait 1-2 seconds */
235  sleep(1);
236 
237  /* Initialize the client socket */
238  CrFwCmpInit(inStream6);
239  if (!CrFwCmpIsInInitialized(inStream6))
240  return 0;
241  CrFwCmpInit(outStream6);
242  if (!CrFwCmpIsInInitialized(outStream6))
243  return 0;
244 
245  /* Configure the two sockets and their InStreams/OutStreams */
246  CrFwCmpReset(inStream6);
247  if (!CrFwCmpIsInConfigured(inStream6))
248  return 0;
249  CrFwCmpReset(outStream6);
250  if (!CrFwCmpIsInConfigured(outStream6))
251  return 0;
252  sleep(1);
253  CrFwCmpReset(inStream7);
254  if (!CrFwCmpIsInConfigured(inStream7))
255  return 0;
256  CrFwCmpReset(outStream7);
257  if (!CrFwCmpIsInConfigured(outStream7))
258  return 0;
259 
260  /* Send a packet from the server socket to the client socket */
261  pcktSend = CrFwPcktMake(100);
262  CrFwPcktSetSrc(pcktSend,CrFwInStreamGetSrc(inStream6));
263  pcktSend[90] = 99; /* marker */
264  CrFwOutStreamSend(outStream7, pcktSend);
265  CrFwPcktRelease(pcktSend);
266 
267  /* Wait 1-2 seconds */
268  sleep(1);
269 
270  /* Poll the client socket and check that packet was received */
272  pcktRec = CrFwInStreamGetPckt(inStream6);
273  if (pcktRec[90] != 99)
274  return 0;
275  CrFwPcktRelease(pcktRec);
276 
277  /* Send a packet from the client socket to the server socket */
278  pcktSend = CrFwPcktMake(100);
279  CrFwPcktSetSrc(pcktSend,CrFwInStreamGetSrc(inStream7));
280  pcktSend[90] = 11; /* marker */
281  CrFwOutStreamSend(outStream6, pcktSend);
282  CrFwPcktRelease(pcktSend);
283 
284  /* Wait 1-2 seconds */
285  sleep(1);
286 
287  /* Poll the server socket and check that packet was received */
289  pcktRec = CrFwInStreamGetPckt(inStream7);
290  if (pcktRec[90] != 11)
291  return 0;
292  CrFwPcktRelease(pcktRec);
293 
294  /* Shutdown the InStreams and OutStreams (this will close the sockets) */
295  CrFwCmpShutdown(inStream6);
296  CrFwCmpShutdown(outStream6);
297  CrFwCmpShutdown(inStream7);
298  CrFwCmpShutdown(outStream7);
299 
300  /* Check that all packets have been de-allocated */
301  if (CrFwPcktGetNOfAllocated() != 0)
302  return 0;
303 
304  /* Check application errors */
305  if (CrFwGetAppErrCode() != crNoAppErr)
306  return 0;
307 
308  return 1;
309 }
310 
311 /* ---------------------------------------------------------------------------------------------*/
313  FwSmDesc_t inStream6, inStream7, outStream6, outStream7;
314  CrFwPckt_t pckt1, pckt2, pckt3, pcktRec;
315 
316  /* Reset error reporting interface */
318 
319  /* Instantiate and start the socket-based InStreams and OutStreams */
320  inStream6 = CrFwInStreamMake(5);
321  if (inStream6 == NULL)
322  return 0;
323  FwSmStart(inStream6);
324  if (!CrFwCmpIsInCreated(inStream6))
325  return 0;
326 
327  inStream7 = CrFwInStreamMake(6);
328  if (inStream7 == NULL)
329  return 0;
330  FwSmStart(inStream7);
331  if (!CrFwCmpIsInCreated(inStream7))
332  return 0;
333 
334  outStream6 = CrFwOutStreamMake(5);
335  if (outStream6 == NULL)
336  return 0;
337  FwSmStart(outStream6);
338  if (!CrFwCmpIsInCreated(outStream6))
339  return 0;
340 
341  outStream7 = CrFwOutStreamMake(6);
342  if (outStream7 == NULL)
343  return 0;
344  FwSmStart(outStream7);
345  if (!CrFwCmpIsInCreated(outStream7))
346  return 0;
347 
348  /* Set port number and host name */
350  CrFwClientSocketSetHost("localhost");
352 
353  /* Initialize the server socket */
354  CrFwCmpInit(outStream7);
355  if (!CrFwCmpIsInInitialized(outStream7))
356  return 0;
357  CrFwCmpInit(inStream7);
358  if (!CrFwCmpIsInInitialized(inStream7))
359  return 0;
360 
361  /* Wait 1-2 seconds */
362  sleep(1);
363 
364  /* Initialize the client socket */
365  CrFwCmpInit(inStream6);
366  if (!CrFwCmpIsInInitialized(inStream6))
367  return 0;
368  CrFwCmpInit(outStream6);
369  if (!CrFwCmpIsInInitialized(outStream6))
370  return 0;
371 
372  /* Configure the two sockets and their InStreams/OutStreams */
373  CrFwCmpReset(inStream6);
374  if (!CrFwCmpIsInConfigured(inStream6))
375  return 0;
376  CrFwCmpReset(outStream6);
377  if (!CrFwCmpIsInConfigured(outStream6))
378  return 0;
379  sleep(1);
380  CrFwCmpReset(inStream7);
381  if (!CrFwCmpIsInConfigured(inStream7))
382  return 0;
383  CrFwCmpReset(outStream7);
384  if (!CrFwCmpIsInConfigured(outStream7))
385  return 0;
386 
387  /* Send three packets from the server socket to the client socket */
388  pckt1 = CrFwPcktMake(100);
389  pckt2 = CrFwPcktMake(100);
390  pckt3 = CrFwPcktMake(100);
391  pckt1[90] = 99; /* marker */
392  pckt2[90] = 98; /* marker */
393  pckt3[90] = 97; /* marker */
397  CrFwPcktSetGroup(pckt1,0);
398  CrFwPcktSetGroup(pckt2,0);
399  CrFwPcktSetGroup(pckt3,0);
400  CrFwOutStreamSend(outStream7, pckt1);
401  CrFwOutStreamSend(outStream7, pckt2);
402  CrFwOutStreamSend(outStream7, pckt3);
403  CrFwPcktRelease(pckt1);
404  CrFwPcktRelease(pckt2);
405  CrFwPcktRelease(pckt3);
406 
407  /* Wait 1-2 seconds */
408  sleep(1);
409 
410  /* Poll the client socket and check that packets were received */
412  pcktRec = CrFwInStreamGetPckt(inStream6);
413  if (pcktRec[90] != 99)
414  return 0;
415  CrFwPcktRelease(pcktRec);
416  pcktRec = CrFwInStreamGetPckt(inStream6);
417  if (pcktRec[90] != 98)
418  return 0;
419  CrFwPcktRelease(pcktRec);
420  pcktRec = CrFwInStreamGetPckt(inStream6);
421  if (pcktRec[90] != 97)
422  return 0;
423  CrFwPcktRelease(pcktRec);
424 
425  /* Send a packet from the client socket to the server socket */
426  pckt1 = CrFwPcktMake(100);
427  pckt2 = CrFwPcktMake(100);
428  pckt3 = CrFwPcktMake(100);
429  pckt1[90] = 10; /* marker */
430  pckt2[90] = 11; /* marker */
431  pckt3[90] = 12; /* marker */
435  CrFwPcktSetGroup(pckt1,0);
436  CrFwPcktSetGroup(pckt2,0);
437  CrFwPcktSetGroup(pckt3,0);
438  CrFwOutStreamSend(outStream6, pckt1);
439  CrFwOutStreamSend(outStream6, pckt2);
440  CrFwOutStreamSend(outStream6, pckt3);
441  CrFwPcktRelease(pckt1);
442  CrFwPcktRelease(pckt2);
443  CrFwPcktRelease(pckt3);
444 
445  /* Wait 1-2 seconds */
446  sleep(1);
447 
448  /* Poll the server socket and check that packets were received */
450  pcktRec = CrFwInStreamGetPckt(inStream7);
451  if (pcktRec[90] != 10)
452  return 0;
453  CrFwPcktRelease(pcktRec);
454  pcktRec = CrFwInStreamGetPckt(inStream7);
455  if (pcktRec[90] != 11)
456  return 0;
457  CrFwPcktRelease(pcktRec);
458  pcktRec = CrFwInStreamGetPckt(inStream7);
459  if (pcktRec[90] != 12)
460  return 0;
461  CrFwPcktRelease(pcktRec);
462 
463  /* Shutdown the InStreams and OutStreams (this will close the sockets) */
464  CrFwCmpShutdown(inStream6);
465  CrFwCmpShutdown(outStream6);
466  CrFwCmpShutdown(inStream7);
467  CrFwCmpShutdown(outStream7);
468 
469  /* Check that no errors have been reported */
470  if (CrFwRepErrStubGetPos() != 0)
471  return 0;
472 
473  /* Check that all packets have been de-allocated */
474  if (CrFwPcktGetNOfAllocated() != 0)
475  return 0;
476 
477  /* Check application errors */
478  if (CrFwGetAppErrCode() != crNoAppErr)
479  return 0;
480 
481  return 1;
482 }
483 
484 /* ---------------------------------------------------------------------------------------------*/
486  FwSmDesc_t inStream6, inStream7, outStream6, outStream7;
487  CrFwPckt_t sPckt1, sPckt2, sPckt3, cPckt1, cPckt2, cPckt3, pcktRec;
488 
489  /* Reset error reporting interface */
491 
492  /* Instantiate and start the socket-based InStreams and OutStreams */
493  inStream6 = CrFwInStreamMake(5);
494  if (inStream6 == NULL)
495  return 0;
496  FwSmStart(inStream6);
497  if (!CrFwCmpIsInCreated(inStream6))
498  return 0;
499 
500  inStream7 = CrFwInStreamMake(6);
501  if (inStream7 == NULL)
502  return 0;
503  FwSmStart(inStream7);
504  if (!CrFwCmpIsInCreated(inStream7))
505  return 0;
506 
507  outStream6 = CrFwOutStreamMake(5);
508  if (outStream6 == NULL)
509  return 0;
510  FwSmStart(outStream6);
511  if (!CrFwCmpIsInCreated(outStream6))
512  return 0;
513 
514  outStream7 = CrFwOutStreamMake(6);
515  if (outStream7 == NULL)
516  return 0;
517  FwSmStart(outStream7);
518  if (!CrFwCmpIsInCreated(outStream7))
519  return 0;
520 
521  /* Set port number and host name */
523  CrFwClientSocketSetHost("localhost");
525 
526  /* Initialize the server socket */
527  CrFwCmpInit(outStream7);
528  if (!CrFwCmpIsInInitialized(outStream7))
529  return 0;
530  CrFwCmpInit(inStream7);
531  if (!CrFwCmpIsInInitialized(inStream7))
532  return 0;
533 
534  /* Wait 1-2 seconds */
535  sleep(1);
536 
537  /* Initialize the client socket */
538  CrFwCmpInit(inStream6);
539  if (!CrFwCmpIsInInitialized(inStream6))
540  return 0;
541  CrFwCmpInit(outStream6);
542  if (!CrFwCmpIsInInitialized(outStream6))
543  return 0;
544 
545  /* Configure the two sockets and their InStreams/OutStreams */
546  CrFwCmpReset(inStream6);
547  if (!CrFwCmpIsInConfigured(inStream6))
548  return 0;
549  CrFwCmpReset(outStream6);
550  if (!CrFwCmpIsInConfigured(outStream6))
551  return 0;
552  sleep(1);
553  CrFwCmpReset(inStream7);
554  if (!CrFwCmpIsInConfigured(inStream7))
555  return 0;
556  CrFwCmpReset(outStream7);
557  if (!CrFwCmpIsInConfigured(outStream7))
558  return 0;
559 
560  /* Send packets from one socket the other */
561  sPckt1 = CrFwPcktMake(100);
562  sPckt2 = CrFwPcktMake(100);
563  sPckt3 = CrFwPcktMake(100);
564  sPckt1[90] = 99; /* marker */
565  sPckt2[90] = 98; /* marker */
566  sPckt3[90] = 97; /* marker */
570  CrFwPcktSetGroup(sPckt1,0);
571  CrFwPcktSetGroup(sPckt2,0);
572  CrFwPcktSetGroup(sPckt3,0);
573  cPckt1 = CrFwPcktMake(100);
574  cPckt2 = CrFwPcktMake(100);
575  cPckt3 = CrFwPcktMake(100);
576  cPckt1[90] = 10; /* marker */
577  cPckt2[90] = 11; /* marker */
578  cPckt3[90] = 12; /* marker */
582  CrFwPcktSetGroup(cPckt1,0);
583  CrFwPcktSetGroup(cPckt2,0);
584  CrFwPcktSetGroup(cPckt3,0);
585 
586  CrFwOutStreamSend(outStream7, sPckt1);
587  CrFwOutStreamSend(outStream7, sPckt2);
588  CrFwOutStreamSend(outStream7, sPckt3);
589  CrFwOutStreamSend(outStream6, cPckt1);
590  CrFwOutStreamSend(outStream6, cPckt2);
591  CrFwOutStreamSend(outStream6, cPckt3);
592  CrFwPcktRelease(sPckt1);
593  CrFwPcktRelease(sPckt2);
594  CrFwPcktRelease(sPckt3);
595  CrFwPcktRelease(cPckt1);
596  CrFwPcktRelease(cPckt2);
597  CrFwPcktRelease(cPckt3);
598 
599  /* Wait 1-2 seconds */
600  sleep(1);
601 
602  /* Poll the client socket and check that packets were received */
604  pcktRec = CrFwInStreamGetPckt(inStream6);
605  if (pcktRec[90] != 99)
606  return 0;
607  CrFwPcktRelease(pcktRec);
608  pcktRec = CrFwInStreamGetPckt(inStream6);
609  if (pcktRec[90] != 98)
610  return 0;
611  CrFwPcktRelease(pcktRec);
612  pcktRec = CrFwInStreamGetPckt(inStream6);
613  if (pcktRec[90] != 97)
614  return 0;
615  CrFwPcktRelease(pcktRec);
616 
617  /* Poll the server socket and check that packets were received */
619  pcktRec = CrFwInStreamGetPckt(inStream7);
620  if (pcktRec[90] != 10)
621  return 0;
622  CrFwPcktRelease(pcktRec);
623  pcktRec = CrFwInStreamGetPckt(inStream7);
624  if (pcktRec[90] != 11)
625  return 0;
626  CrFwPcktRelease(pcktRec);
627  pcktRec = CrFwInStreamGetPckt(inStream7);
628  if (pcktRec[90] != 12)
629  return 0;
630  CrFwPcktRelease(pcktRec);
631 
632  /* Shutdown the InStreams and OutStreams (this will close the sockets) */
633  CrFwCmpShutdown(inStream6);
634  CrFwCmpShutdown(outStream6);
635  CrFwCmpShutdown(inStream7);
636  CrFwCmpShutdown(outStream7);
637 
638  /* Check that no errors have been reported */
639  if (CrFwRepErrStubGetPos() != 0)
640  return 0;
641 
642  /* Check that all packets have been de-allocated */
643  if (CrFwPcktGetNOfAllocated() != 0)
644  return 0;
645 
646  /* Check application errors */
647  if (CrFwGetAppErrCode() != crNoAppErr)
648  return 0;
649 
650  return 1;
651 }
Interface through which framework components access the current time.
Declaration of the test cases for the InStream Component (see CrFwInStream.h).
void CrFwOutStreamSend(FwSmDesc_t smDesc, CrFwPckt_t pckt)
Send a packet to the OutStream.
void CrFwPcktSetSrc(CrFwPckt_t pckt, CrFwDestSrc_t src)
Set the source of the command or report encapsulated in a packet.
Definition: CrFwPckt.c:321
void CrFwPcktSetGroup(CrFwPckt_t pckt, CrFwGroup_t group)
Set the group of the command/report encapsulated in a packet.
Definition: CrFwPckt.c:392
void CrFwCmpInit(FwSmDesc_t smDesc)
Initialize a framework component.
Definition: CrFwBaseCmp.c:112
Definition of the Framework Component Data (FCD) Type.
CrFwDestSrc_t CrFwInStreamGetSrc(FwSmDesc_t smDesc)
Get the currently defined packet source of an InStream.
Definition: CrFwInStream.c:246
CrFwBool_t CrFwSocketTestCase2()
Test the initialization and configuration of the client and server sockets of CrFwClientSocket.h and CrFwServerSocket.h.
Interface for a server socket to be used by InStreams and OutStreams.
CrFwBool_t CrFwCmpIsInConfigured(FwSmDesc_t smDesc)
Return true if the argument component is in state CONFIGURED.
Definition: CrFwBaseCmp.c:177
#define CR_FW_HOST_APP_ID
The identifier of the host application.
unsigned char * CrFwPckt_t
Type for packets (see CrFwPckt.h).
Definition: CrFwConstants.h:38
CrFwBool_t CrFwCmpIsInCreated(FwSmDesc_t smDesc)
Return true if the argument component is in state CREATED.
Definition: CrFwBaseCmp.c:167
CrFwPckt_t CrFwPcktMake(CrFwPcktLength_t pcktLength)
Make function for command or report packets.
Definition: CrFwPckt.c:129
Interface for creating and accessing a report or command packet.
Definition of the InStream component.
Interface for a client socket to be used by InStreams and OutStreams.
int CrFwBool_t
Type used for boolean values (1 represent "true" and 0 represents "false").
Definition: CrFwConstants.h:32
void CrFwServerSocketPoll()
Poll the server socket to check whether a new packet has arrived.
void CrFwClientSocketPoll()
Poll the client socket to check whether a new packet has arrived.
void CrFwPcktRelease(CrFwPckt_t pckt)
Release function for command or report packets.
Definition: CrFwPckt.c:156
void CrFwRepErrStubReset()
Reset the error reporting interface.
Definition: CrFwRepErr.c:76
CrFwBool_t CrFwCmpIsInInitialized(FwSmDesc_t smDesc)
Return true if the argument component is in state INITIALIZED.
Definition: CrFwBaseCmp.c:172
CrFwBool_t CrFwSocketTestCase3()
Test the sending and receiving of multiple packets through client and server sockets of CrFwClientSoc...
void CrFwInStreamSocketSetPort(unsigned short n)
Set the port number for the socket.
CrFwBool_t CrFwSocketTestCase1()
Test the initialization and configuration of the socket-based InStream and OutStream.
Interface for reporting an error detected by a framework component.
Definition of the utility functions for the CORDET Framework.
void CrFwClientSocketSetHost(char *name)
Set the host name of the server.
Interface for the Socket-Based InStream.
void CrFwCmpReset(FwSmDesc_t smDesc)
Reset a framework component.
Definition: CrFwBaseCmp.c:117
void CrFwInStreamSocketPoll(FwSmDesc_t inStream)
Poll the socket to check whether a new packet has arrived.
Interface for the InStream stub.
Definition of Base Component.
The CORDET Framework defines an interface for generating error reports (see CrFwRepErr.h).
CrFwCounterU2_t CrFwPcktGetNOfAllocated()
Return the number of packets which are currently allocated.
Definition: CrFwPckt.c:196
void CrFwInStreamSocketSetHost(char *name)
Set the host name of the server.
FwSmDesc_t CrFwOutStreamMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th OutStream State Machine instance.
CrFwBool_t CrFwSocketTestCase4()
Test the interleaved sending and receiving of multiple packets through client and server sockets of C...
CrFwCounterU2_t CrFwRepErrStubGetPos()
Return the position in the error report array at which the next error report will be written...
Definition: CrFwRepErr.c:71
FwSmDesc_t CrFwInStreamMake(CrFwInstanceId_t i)
Factory function to retrieve the i-th InStream State Machine instance.
Definition: CrFwInStream.c:121
void CrFwClientSocketSetPort(unsigned short n)
Set the port number for the socket.
CrFwPckt_t CrFwInStreamGetPckt(FwSmDesc_t smDesc)
Retrieve a packet from the InStream.
Definition: CrFwInStream.c:232
void CrFwServerSocketSetPort(unsigned short n)
Set the port number for the socket.
User-modifiable parameters for the InStream components (see CrFwInStream.h).
void CrFwCmpShutdown(FwSmDesc_t smDesc)
Shutdown a framework component.
Definition: CrFwBaseCmp.c:122
void CrFwOutStreamSocketSetPort(unsigned short n)
Set the port number for the socket.
No application errors have been detected.
Interface for the Socket-Based OutStream.
CrFwAppErrCode_t CrFwGetAppErrCode()
Return the value of the application error code.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved