F´ Flight Software - C/C++ Documentation NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ActiveTest.cpp
Go to the documentation of this file.
1// ======================================================================
2// \title ActiveTest.cpp
3// \author tiffany
4// \brief cpp file for ActiveTest component implementation class
5// ======================================================================
6
7
8#include "ActiveTest.hpp"
9#include <FpConfig.hpp>
10
11#include "FppTest/component/active/SerialPortIndexEnumAc.hpp"
12
13 // ----------------------------------------------------------------------
14 // Construction, initialization, and destruction
15 // ----------------------------------------------------------------------
16
17 ActiveTest ::
18 ActiveTest(
19 const char *const compName
20 ) : ActiveTestComponentBase(compName)
21 {
22
23 }
24
25 void ActiveTest ::
26 init(
27 NATIVE_INT_TYPE queueDepth,
28 NATIVE_INT_TYPE msgSize,
29 NATIVE_INT_TYPE instance
30 )
31 {
32 ActiveTestComponentBase::init(queueDepth, msgSize, instance);
33 }
34
35 ActiveTest ::
36 ~ActiveTest()
37 {
38
39 }
40
41 // ----------------------------------------------------------------------
42 // Handler implementations for user-defined typed input ports
43 // ----------------------------------------------------------------------
44
45 void ActiveTest ::
46 arrayArgsAsync_handler(
47 const NATIVE_INT_TYPE portNum,
48 const FormalParamArray &a,
49 FormalParamArray &aRef
50 )
51 {
52 this->arrayArgsOut_out(portNum, a, aRef);
53 }
54
55 void ActiveTest ::
56 enumArgsAsync_handler(
57 const NATIVE_INT_TYPE portNum,
58 const FormalParamEnum &en,
59 FormalParamEnum &enRef
60 )
61 {
62 this->enumArgsOut_out(portNum, en, enRef);
63 }
64
65 void ActiveTest ::
66 noArgsAsync_handler(
67 const NATIVE_INT_TYPE portNum
68 )
69 {
70 this->noArgsOut_out(portNum);
71 }
72
73 void ActiveTest ::
74 primitiveArgsAsync_handler(
75 const NATIVE_INT_TYPE portNum,
76 U32 u32,
77 U32 &u32Ref,
78 F32 f32,
79 F32 &f32Ref,
80 bool b,
81 bool &bRef
82 )
83 {
84 this->primitiveArgsOut_out(
85 portNum,
86 u32,
87 u32Ref,
88 f32,
89 f32Ref,
90 b,
91 bRef
92 );
93 }
94
95 void ActiveTest ::
96 structArgsAsync_handler(
97 const NATIVE_INT_TYPE portNum,
98 const FormalParamStruct &s,
99 FormalParamStruct &sRef
100 )
101 {
102 this->structArgsOut_out(portNum, s, sRef);
103 }
104 void ActiveTest ::
105 stringArgsAsync_handler(
106 const NATIVE_INT_TYPE portNum,
107 const str80String &str80,
108 str80RefString &str80Ref,
109 const str100String &str100,
110 str100RefString &str100Ref
111 )
112 {
113 this->stringArgsOut_out(
114 portNum,
115 str80,
116 str80Ref,
117 str100,
118 str100Ref
119 );
120 }
121
122 void ActiveTest ::
123 arrayArgsGuarded_handler(
124 const NATIVE_INT_TYPE portNum,
125 const FormalParamArray &a,
126 FormalParamArray &aRef
127 )
128 {
129 this->arrayArgsOut_out(portNum, a, aRef);
130 }
131
132 void ActiveTest ::
133 arrayArgsSync_handler(
134 const NATIVE_INT_TYPE portNum,
135 const FormalParamArray &a,
136 FormalParamArray &aRef
137 )
138 {
139 this->arrayArgsOut_out(portNum, a, aRef);
140 }
141
142 FormalParamArray ActiveTest ::
143 arrayReturnGuarded_handler(
144 const NATIVE_INT_TYPE portNum,
145 const FormalParamArray &a,
146 FormalParamArray &aRef
147 )
148 {
149 return this->arrayReturnOut_out(portNum, a, aRef);
150 }
151
152 FormalParamArray ActiveTest ::
153 arrayReturnSync_handler(
154 const NATIVE_INT_TYPE portNum,
155 const FormalParamArray &a,
156 FormalParamArray &aRef
157 )
158 {
159 return this->arrayReturnOut_out(portNum, a, aRef);
160 }
161
162 void ActiveTest ::
163 cmdOut_handler(
164 NATIVE_INT_TYPE portNum,
165 FwOpcodeType opCode,
166 U32 cmdSeq,
167 Fw::CmdArgBuffer& args
168 )
169 {
170 }
171
172 void ActiveTest ::
173 enumArgsGuarded_handler(
174 const NATIVE_INT_TYPE portNum,
175 const FormalParamEnum &en,
176 FormalParamEnum &enRef
177 )
178 {
179 this->enumArgsOut_out(portNum, en, enRef);
180 }
181
182 void ActiveTest ::
183 enumArgsSync_handler(
184 const NATIVE_INT_TYPE portNum,
185 const FormalParamEnum &en,
186 FormalParamEnum &enRef
187 )
188 {
189 this->enumArgsOut_out(portNum, en, enRef);
190 }
191
192 FormalParamEnum ActiveTest ::
193 enumReturnGuarded_handler(
194 const NATIVE_INT_TYPE portNum,
195 const FormalParamEnum &en,
196 FormalParamEnum &enRef
197 )
198 {
199 return this->enumReturnOut_out(portNum, en, enRef);
200 }
201
202 FormalParamEnum ActiveTest ::
203 enumReturnSync_handler(
204 const NATIVE_INT_TYPE portNum,
205 const FormalParamEnum &en,
206 FormalParamEnum &enRef
207 )
208 {
209 return this->enumReturnOut_out(portNum, en, enRef);
210 }
211
212 void ActiveTest ::
213 noArgsGuarded_handler(
214 const NATIVE_INT_TYPE portNum
215 )
216 {
217 this->noArgsOut_out(portNum);
218 }
219
220 bool ActiveTest ::
221 noArgsReturnGuarded_handler(
222 const NATIVE_INT_TYPE portNum
223 )
224 {
225 return this->noArgsReturnOut_out(portNum);
226 }
227
228 bool ActiveTest ::
229 noArgsReturnSync_handler(
230 const NATIVE_INT_TYPE portNum
231 )
232 {
233 return this->noArgsReturnOut_out(portNum);
234 }
235
236 void ActiveTest ::
237 noArgsSync_handler(
238 const NATIVE_INT_TYPE portNum
239 )
240 {
241 this->noArgsOut_out(portNum);
242 }
243
244 void ActiveTest ::
245 primitiveArgsGuarded_handler(
246 const NATIVE_INT_TYPE portNum,
247 U32 u32,
248 U32 &u32Ref,
249 F32 f32,
250 F32 &f32Ref,
251 bool b,
252 bool &bRef
253 )
254 {
255 this->primitiveArgsOut_out(
256 portNum,
257 u32,
258 u32Ref,
259 f32,
260 f32Ref,
261 b,
262 bRef
263 );
264 }
265
266 void ActiveTest ::
267 primitiveArgsSync_handler(
268 const NATIVE_INT_TYPE portNum,
269 U32 u32,
270 U32 &u32Ref,
271 F32 f32,
272 F32 &f32Ref,
273 bool b,
274 bool &bRef
275 )
276 {
277 this->primitiveArgsOut_out(
278 portNum,
279 u32,
280 u32Ref,
281 f32,
282 f32Ref,
283 b,
284 bRef
285 );
286 }
287
288 U32 ActiveTest ::
289 primitiveReturnGuarded_handler(
290 const NATIVE_INT_TYPE portNum,
291 U32 u32,
292 U32 &u32Ref,
293 F32 f32,
294 F32 &f32Ref,
295 bool b,
296 bool &bRef
297 )
298 {
299 return this->primitiveReturnOut_out(
300 portNum,
301 u32,
302 u32Ref,
303 f32,
304 f32Ref,
305 b,
306 bRef
307 );
308 }
309
310 U32 ActiveTest ::
311 primitiveReturnSync_handler(
312 const NATIVE_INT_TYPE portNum,
313 U32 u32,
314 U32 &u32Ref,
315 F32 f32,
316 F32 &f32Ref,
317 bool b,
318 bool &bRef
319 )
320 {
321 return this->primitiveReturnOut_out(
322 portNum,
323 u32,
324 u32Ref,
325 f32,
326 f32Ref,
327 b,
328 bRef
329 );
330 }
331
332 void ActiveTest ::
333 stringArgsGuarded_handler(
334 const NATIVE_INT_TYPE portNum,
335 const str80String &str80,
336 str80RefString &str80Ref,
337 const str100String &str100,
338 str100RefString &str100Ref
339 )
340 {
341 this->stringArgsOut_out(
342 portNum,
343 str80,
344 str80Ref,
345 str100,
346 str100Ref
347 );
348 }
349
350 void ActiveTest ::
351 stringArgsSync_handler(
352 const NATIVE_INT_TYPE portNum,
353 const str80String &str80,
354 str80RefString &str80Ref,
355 const str100String &str100,
356 str100RefString &str100Ref
357 )
358 {
359 this->stringArgsOut_out(
360 portNum,
361 str80,
362 str80Ref,
363 str100,
364 str100Ref
365 );
366 }
367
368 void ActiveTest ::
369 structArgsGuarded_handler(
370 const NATIVE_INT_TYPE portNum,
371 const FormalParamStruct &s,
372 FormalParamStruct &sRef
373 )
374 {
375 this->structArgsOut_out(portNum, s, sRef);
376 }
377
378 void ActiveTest ::
379 structArgsSync_handler(
380 const NATIVE_INT_TYPE portNum,
381 const FormalParamStruct &s,
382 FormalParamStruct &sRef
383 )
384 {
385 this->structArgsOut_out(portNum, s, sRef);
386 }
387
388 FormalParamStruct ActiveTest ::
389 structReturnGuarded_handler(
390 const NATIVE_INT_TYPE portNum,
391 const FormalParamStruct &s,
392 FormalParamStruct &sRef
393 )
394 {
395 return this->structReturnOut_out(portNum, s, sRef);
396 }
397
398 FormalParamStruct ActiveTest ::
399 structReturnSync_handler(
400 const NATIVE_INT_TYPE portNum,
401 const FormalParamStruct &s,
402 FormalParamStruct &sRef
403 )
404 {
405 return this->structReturnOut_out(portNum, s, sRef);
406 }
407
408 // ----------------------------------------------------------------------
409 // Handler implementations for user-defined serial input ports
410 // ----------------------------------------------------------------------
411
412 void ActiveTest ::
413 serialAsync_handler(
414 NATIVE_INT_TYPE portNum,
416 )
417 {
418 this->serializeStatus = this->serialOut_out(portNum, Buffer);
419 }
420
421 void ActiveTest ::
422 serialAsyncAssert_handler(
423 NATIVE_INT_TYPE portNum,
425 )
426 {
427 this->serializeStatus = this->serialOut_out(SerialPortIndex::ENUM, Buffer);
428 }
429
430 void ActiveTest ::
431 serialAsyncBlockPriority_handler(
432 NATIVE_INT_TYPE portNum,
434 )
435 {
436 this->serializeStatus = this->serialOut_out(SerialPortIndex::ARRAY, Buffer);
437 }
438
439 void ActiveTest ::
440 serialAsyncDropPriority_handler(
441 NATIVE_INT_TYPE portNum,
443 )
444 {
445 this->serializeStatus = this->serialOut_out(SerialPortIndex::STRUCT, Buffer);
446 }
447
448 void ActiveTest ::
449 serialGuarded_handler(
450 NATIVE_INT_TYPE portNum,
452 )
453 {
454 this->serializeStatus = this->serialOut_out(portNum, Buffer);
455 }
456
457 void ActiveTest ::
458 serialSync_handler(
459 NATIVE_INT_TYPE portNum,
461 )
462 {
463 this->serializeStatus = this->serialOut_out(portNum, Buffer);
464 }
465
466 // ----------------------------------------------------------------------
467 // Command handler implementations
468 // ----------------------------------------------------------------------
469
470 void ActiveTest ::
471 CMD_ASYNC_NO_ARGS_cmdHandler(
472 const FwOpcodeType opCode,
473 const U32 cmdSeq
474 )
475 {
476 this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
477 }
478
479 void ActiveTest ::
480 CMD_ASYNC_PRIMITIVE_cmdHandler(
481 const FwOpcodeType opCode,
482 const U32 cmdSeq,
483 U32 u32_1,
484 U32 u32_2,
485 F32 f32_1,
486 F32 f32_2,
487 bool b1,
488 bool b2
489 )
490 {
491 this->primitiveCmd.args.val1 = u32_1;
492 this->primitiveCmd.args.val2 = u32_2;
493 this->primitiveCmd.args.val3 = f32_1;
494 this->primitiveCmd.args.val4 = f32_2;
495 this->primitiveCmd.args.val5 = b1;
496 this->primitiveCmd.args.val6 = b2;
497
498 this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
499 }
500
501 void ActiveTest ::
502 CMD_ASYNC_STRINGS_cmdHandler(
503 const FwOpcodeType opCode,
504 const U32 cmdSeq,
505 const Fw::CmdStringArg& str1,
506 const Fw::CmdStringArg& str2
507 )
508 {
509 this->stringCmd.args.val1 = str1;
510 this->stringCmd.args.val2 = str2;
511
512 this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
513 }
514
515 void ActiveTest ::
516 CMD_ASYNC_ENUM_cmdHandler(
517 const FwOpcodeType opCode,
518 const U32 cmdSeq,
519 FormalParamEnum en
520 )
521 {
522 this->enumCmd.args.val = en;
523
524 this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
525 }
526
527 void ActiveTest ::
528 CMD_ASYNC_ARRAY_cmdHandler(
529 const FwOpcodeType opCode,
530 const U32 cmdSeq,
531 FormalParamArray arr
532 )
533 {
534 this->arrayCmd.args.val = arr;
535
536 this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
537 }
538
539 void ActiveTest ::
540 CMD_ASYNC_STRUCT_cmdHandler(
541 const FwOpcodeType opCode,
542 const U32 cmdSeq,
543 FormalParamStruct str
544 )
545 {
546 this->structCmd.args.val = str;
547
548 this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
549 }
550
551 void ActiveTest ::
552 CMD_NO_ARGS_cmdHandler(
553 const FwOpcodeType opCode,
554 const U32 cmdSeq
555 )
556 {
557 this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
558 }
559
560 void ActiveTest ::
561 CMD_PRIMITIVE_cmdHandler(
562 const FwOpcodeType opCode,
563 const U32 cmdSeq,
564 U32 u32_1,
565 U32 u32_2,
566 F32 f32_1,
567 F32 f32_2,
568 bool b1,
569 bool b2
570 )
571 {
572 this->primitiveCmd.args.val1 = u32_1;
573 this->primitiveCmd.args.val2 = u32_2;
574 this->primitiveCmd.args.val3 = f32_1;
575 this->primitiveCmd.args.val4 = f32_2;
576 this->primitiveCmd.args.val5 = b1;
577 this->primitiveCmd.args.val6 = b2;
578
579 this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
580 }
581
582 void ActiveTest ::
583 CMD_STRINGS_cmdHandler(
584 const FwOpcodeType opCode,
585 const U32 cmdSeq,
586 const Fw::CmdStringArg& str1,
587 const Fw::CmdStringArg& str2
588 )
589 {
590 this->stringCmd.args.val1 = str1;
591 this->stringCmd.args.val2 = str2;
592
593 this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
594 }
595
596 void ActiveTest ::
597 CMD_ENUM_cmdHandler(
598 const FwOpcodeType opCode,
599 const U32 cmdSeq,
600 FormalParamEnum en
601 )
602 {
603 this->enumCmd.args.val = en;
604
605 this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
606 }
607
608 void ActiveTest ::
609 CMD_ARRAY_cmdHandler(
610 const FwOpcodeType opCode,
611 const U32 cmdSeq,
612 FormalParamArray arr
613 )
614 {
615 this->arrayCmd.args.val = arr;
616
617 this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
618 }
619
620 void ActiveTest ::
621 CMD_STRUCT_cmdHandler(
622 const FwOpcodeType opCode,
623 const U32 cmdSeq,
624 FormalParamStruct str
625 )
626 {
627 this->structCmd.args.val = str;
628
629 this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
630 }
631
632 // ----------------------------------------------------------------------
633 // Internal interface handlers
634 // ----------------------------------------------------------------------
635
637 void ActiveTest ::
638 internalArray_internalInterfaceHandler(
639 const FormalParamArray& arr
640 )
641 {
642 this->arrayInterface.args.val = arr;
643 }
644
646 void ActiveTest ::
647 internalEnum_internalInterfaceHandler(
648 const FormalParamEnum& en
649 )
650 {
651 this->enumInterface.args.val = en;
652 }
653
655 void ActiveTest ::
656 internalNoArgs_internalInterfaceHandler()
657 {
658 }
659
661 void ActiveTest ::
662 internalPrimitive_internalInterfaceHandler(
663 U32 u32_1,
664 U32 u32_2,
665 F32 f32_1,
666 F32 f32_2,
667 bool b1,
668 bool b2
669 )
670 {
671 this->primitiveInterface.args.val1 = u32_1;
672 this->primitiveInterface.args.val2 = u32_2;
673 this->primitiveInterface.args.val3 = f32_1;
674 this->primitiveInterface.args.val4 = f32_2;
675 this->primitiveInterface.args.val5 = b1;
676 this->primitiveInterface.args.val6 = b2;
677 }
678
680 void ActiveTest ::
681 internalString_internalInterfaceHandler(
682 const Fw::InternalInterfaceString& str1,
683 const Fw::InternalInterfaceString& str2
684 )
685 {
686 this->stringInterface.args.val1 = str1;
687 this->stringInterface.args.val2 = str2;
688 }
689
691 void ActiveTest ::
692 internalStruct_internalInterfaceHandler(
693 const FormalParamStruct& str
694 )
695 {
696 this->structInterface.args.val = str;
697 }
698
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
float F32
32-bit floating point
Definition BasicTypes.h:45
U32 FwOpcodeType
Definition FpConfig.h:56
C++-compatible configuration header for fprime configuration.
@ OK
Command successfully executed.