F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DeframerComponentAc.cpp
Go to the documentation of this file.
1// ======================================================================
2// \title DeframerComponentAc.cpp
3// \author Generated by fpp-to-cpp
4// \brief cpp file for Deframer component base class
5// ======================================================================
6
7#include <cstdio>
8
10#include "Fw/Types/Assert.hpp"
11#if FW_ENABLE_TEXT_LOGGING
12#include "Fw/Types/String.hpp"
13#endif
14
15namespace Svc {
16
17 // ----------------------------------------------------------------------
18 // Component initialization
19 // ----------------------------------------------------------------------
20
21 void DeframerComponentBase ::
22 init(NATIVE_INT_TYPE instance)
23 {
24 // Initialize base class
26
27 // Connect input port cmdResponseIn
28 for (
29 PlatformIntType port = 0;
30 port < static_cast<PlatformIntType>(this->getNum_cmdResponseIn_InputPorts());
31 port++
32 ) {
33 this->m_cmdResponseIn_InputPort[port].init();
34 this->m_cmdResponseIn_InputPort[port].addCallComp(
35 this,
36 m_p_cmdResponseIn_in
37 );
38 this->m_cmdResponseIn_InputPort[port].setPortNum(port);
39
40#if FW_OBJECT_NAMES == 1
41 // The port name consists of this->m_objName and some extra info.
42 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
43 // However, the compiler may assume that this->m_objName fills
44 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
45 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
46 // bytes to cover the extra info.
47 char portName[2*FW_OBJ_NAME_MAX_SIZE];
48 (void) snprintf(
49 portName,
50 sizeof(portName),
51 "%s_cmdResponseIn_InputPort[%" PRI_PlatformIntType "]",
52 this->m_objName,
53 port
54 );
55 this->m_cmdResponseIn_InputPort[port].setObjName(portName);
56#endif
57 }
58
59 // Connect input port framedIn
60 for (
61 PlatformIntType port = 0;
62 port < static_cast<PlatformIntType>(this->getNum_framedIn_InputPorts());
63 port++
64 ) {
65 this->m_framedIn_InputPort[port].init();
66 this->m_framedIn_InputPort[port].addCallComp(
67 this,
68 m_p_framedIn_in
69 );
70 this->m_framedIn_InputPort[port].setPortNum(port);
71
72#if FW_OBJECT_NAMES == 1
73 // The port name consists of this->m_objName and some extra info.
74 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
75 // However, the compiler may assume that this->m_objName fills
76 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
77 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
78 // bytes to cover the extra info.
79 char portName[2*FW_OBJ_NAME_MAX_SIZE];
80 (void) snprintf(
81 portName,
82 sizeof(portName),
83 "%s_framedIn_InputPort[%" PRI_PlatformIntType "]",
84 this->m_objName,
85 port
86 );
87 this->m_framedIn_InputPort[port].setObjName(portName);
88#endif
89 }
90
91 // Connect input port schedIn
92 for (
93 PlatformIntType port = 0;
94 port < static_cast<PlatformIntType>(this->getNum_schedIn_InputPorts());
95 port++
96 ) {
97 this->m_schedIn_InputPort[port].init();
98 this->m_schedIn_InputPort[port].addCallComp(
99 this,
100 m_p_schedIn_in
101 );
102 this->m_schedIn_InputPort[port].setPortNum(port);
103
104#if FW_OBJECT_NAMES == 1
105 // The port name consists of this->m_objName and some extra info.
106 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
107 // However, the compiler may assume that this->m_objName fills
108 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
109 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
110 // bytes to cover the extra info.
111 char portName[2*FW_OBJ_NAME_MAX_SIZE];
112 (void) snprintf(
113 portName,
114 sizeof(portName),
115 "%s_schedIn_InputPort[%" PRI_PlatformIntType "]",
116 this->m_objName,
117 port
118 );
119 this->m_schedIn_InputPort[port].setObjName(portName);
120#endif
121 }
122
123 // Connect output port bufferAllocate
124 for (
125 PlatformIntType port = 0;
126 port < static_cast<PlatformIntType>(this->getNum_bufferAllocate_OutputPorts());
127 port++
128 ) {
129 this->m_bufferAllocate_OutputPort[port].init();
130
131#if FW_OBJECT_NAMES == 1
132 // The port name consists of this->m_objName and some extra info.
133 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
134 // However, the compiler may assume that this->m_objName fills
135 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
136 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
137 // bytes to cover the extra info.
138 char portName[2*FW_OBJ_NAME_MAX_SIZE];
139 (void) snprintf(
140 portName,
141 sizeof(portName),
142 "%s_bufferAllocate_OutputPort[%" PRI_PlatformIntType "]",
143 this->m_objName,
144 port
145 );
146 this->m_bufferAllocate_OutputPort[port].setObjName(portName);
147#endif
148 }
149
150 // Connect output port bufferDeallocate
151 for (
152 PlatformIntType port = 0;
153 port < static_cast<PlatformIntType>(this->getNum_bufferDeallocate_OutputPorts());
154 port++
155 ) {
156 this->m_bufferDeallocate_OutputPort[port].init();
157
158#if FW_OBJECT_NAMES == 1
159 // The port name consists of this->m_objName and some extra info.
160 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
161 // However, the compiler may assume that this->m_objName fills
162 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
163 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
164 // bytes to cover the extra info.
165 char portName[2*FW_OBJ_NAME_MAX_SIZE];
166 (void) snprintf(
167 portName,
168 sizeof(portName),
169 "%s_bufferDeallocate_OutputPort[%" PRI_PlatformIntType "]",
170 this->m_objName,
171 port
172 );
173 this->m_bufferDeallocate_OutputPort[port].setObjName(portName);
174#endif
175 }
176
177 // Connect output port bufferOut
178 for (
179 PlatformIntType port = 0;
180 port < static_cast<PlatformIntType>(this->getNum_bufferOut_OutputPorts());
181 port++
182 ) {
183 this->m_bufferOut_OutputPort[port].init();
184
185#if FW_OBJECT_NAMES == 1
186 // The port name consists of this->m_objName and some extra info.
187 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
188 // However, the compiler may assume that this->m_objName fills
189 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
190 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
191 // bytes to cover the extra info.
192 char portName[2*FW_OBJ_NAME_MAX_SIZE];
193 (void) snprintf(
194 portName,
195 sizeof(portName),
196 "%s_bufferOut_OutputPort[%" PRI_PlatformIntType "]",
197 this->m_objName,
198 port
199 );
200 this->m_bufferOut_OutputPort[port].setObjName(portName);
201#endif
202 }
203
204 // Connect output port comOut
205 for (
206 PlatformIntType port = 0;
207 port < static_cast<PlatformIntType>(this->getNum_comOut_OutputPorts());
208 port++
209 ) {
210 this->m_comOut_OutputPort[port].init();
211
212#if FW_OBJECT_NAMES == 1
213 // The port name consists of this->m_objName and some extra info.
214 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
215 // However, the compiler may assume that this->m_objName fills
216 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
217 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
218 // bytes to cover the extra info.
219 char portName[2*FW_OBJ_NAME_MAX_SIZE];
220 (void) snprintf(
221 portName,
222 sizeof(portName),
223 "%s_comOut_OutputPort[%" PRI_PlatformIntType "]",
224 this->m_objName,
225 port
226 );
227 this->m_comOut_OutputPort[port].setObjName(portName);
228#endif
229 }
230
231 // Connect output port framedDeallocate
232 for (
233 PlatformIntType port = 0;
234 port < static_cast<PlatformIntType>(this->getNum_framedDeallocate_OutputPorts());
235 port++
236 ) {
237 this->m_framedDeallocate_OutputPort[port].init();
238
239#if FW_OBJECT_NAMES == 1
240 // The port name consists of this->m_objName and some extra info.
241 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
242 // However, the compiler may assume that this->m_objName fills
243 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
244 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
245 // bytes to cover the extra info.
246 char portName[2*FW_OBJ_NAME_MAX_SIZE];
247 (void) snprintf(
248 portName,
249 sizeof(portName),
250 "%s_framedDeallocate_OutputPort[%" PRI_PlatformIntType "]",
251 this->m_objName,
252 port
253 );
254 this->m_framedDeallocate_OutputPort[port].setObjName(portName);
255#endif
256 }
257
258 // Connect output port framedPoll
259 for (
260 PlatformIntType port = 0;
261 port < static_cast<PlatformIntType>(this->getNum_framedPoll_OutputPorts());
262 port++
263 ) {
264 this->m_framedPoll_OutputPort[port].init();
265
266#if FW_OBJECT_NAMES == 1
267 // The port name consists of this->m_objName and some extra info.
268 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
269 // However, the compiler may assume that this->m_objName fills
270 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
271 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
272 // bytes to cover the extra info.
273 char portName[2*FW_OBJ_NAME_MAX_SIZE];
274 (void) snprintf(
275 portName,
276 sizeof(portName),
277 "%s_framedPoll_OutputPort[%" PRI_PlatformIntType "]",
278 this->m_objName,
279 port
280 );
281 this->m_framedPoll_OutputPort[port].setObjName(portName);
282#endif
283 }
284 }
285
286 // ----------------------------------------------------------------------
287 // Getters for typed input ports
288 // ----------------------------------------------------------------------
289
290 Fw::InputCmdResponsePort* DeframerComponentBase ::
291 get_cmdResponseIn_InputPort(NATIVE_INT_TYPE portNum)
292 {
293 FW_ASSERT(
294 portNum < this->getNum_cmdResponseIn_InputPorts(),
295 static_cast<FwAssertArgType>(portNum)
296 );
297
298 return &this->m_cmdResponseIn_InputPort[portNum];
299 }
300
301 Drv::InputByteStreamRecvPort* DeframerComponentBase ::
302 get_framedIn_InputPort(NATIVE_INT_TYPE portNum)
303 {
304 FW_ASSERT(
305 portNum < this->getNum_framedIn_InputPorts(),
306 static_cast<FwAssertArgType>(portNum)
307 );
308
309 return &this->m_framedIn_InputPort[portNum];
310 }
311
312 Svc::InputSchedPort* DeframerComponentBase ::
313 get_schedIn_InputPort(NATIVE_INT_TYPE portNum)
314 {
315 FW_ASSERT(
316 portNum < this->getNum_schedIn_InputPorts(),
317 static_cast<FwAssertArgType>(portNum)
318 );
319
320 return &this->m_schedIn_InputPort[portNum];
321 }
322
323 // ----------------------------------------------------------------------
324 // Connect typed input ports to typed output ports
325 // ----------------------------------------------------------------------
326
327 void DeframerComponentBase ::
328 set_bufferAllocate_OutputPort(
329 NATIVE_INT_TYPE portNum,
331 )
332 {
333 FW_ASSERT(
334 portNum < this->getNum_bufferAllocate_OutputPorts(),
335 static_cast<FwAssertArgType>(portNum)
336 );
337
338 this->m_bufferAllocate_OutputPort[portNum].addCallPort(port);
339 }
340
341 void DeframerComponentBase ::
342 set_bufferDeallocate_OutputPort(
343 NATIVE_INT_TYPE portNum,
345 )
346 {
347 FW_ASSERT(
348 portNum < this->getNum_bufferDeallocate_OutputPorts(),
349 static_cast<FwAssertArgType>(portNum)
350 );
351
352 this->m_bufferDeallocate_OutputPort[portNum].addCallPort(port);
353 }
354
355 void DeframerComponentBase ::
356 set_bufferOut_OutputPort(
357 NATIVE_INT_TYPE portNum,
359 )
360 {
361 FW_ASSERT(
362 portNum < this->getNum_bufferOut_OutputPorts(),
363 static_cast<FwAssertArgType>(portNum)
364 );
365
366 this->m_bufferOut_OutputPort[portNum].addCallPort(port);
367 }
368
369 void DeframerComponentBase ::
370 set_comOut_OutputPort(
371 NATIVE_INT_TYPE portNum,
372 Fw::InputComPort* port
373 )
374 {
375 FW_ASSERT(
376 portNum < this->getNum_comOut_OutputPorts(),
377 static_cast<FwAssertArgType>(portNum)
378 );
379
380 this->m_comOut_OutputPort[portNum].addCallPort(port);
381 }
382
383 void DeframerComponentBase ::
384 set_framedDeallocate_OutputPort(
385 NATIVE_INT_TYPE portNum,
387 )
388 {
389 FW_ASSERT(
390 portNum < this->getNum_framedDeallocate_OutputPorts(),
391 static_cast<FwAssertArgType>(portNum)
392 );
393
394 this->m_framedDeallocate_OutputPort[portNum].addCallPort(port);
395 }
396
397 void DeframerComponentBase ::
398 set_framedPoll_OutputPort(
399 NATIVE_INT_TYPE portNum,
401 )
402 {
403 FW_ASSERT(
404 portNum < this->getNum_framedPoll_OutputPorts(),
405 static_cast<FwAssertArgType>(portNum)
406 );
407
408 this->m_framedPoll_OutputPort[portNum].addCallPort(port);
409 }
410
411#if FW_PORT_SERIALIZATION
412
413 // ----------------------------------------------------------------------
414 // Connect serial input ports to typed output ports
415 // ----------------------------------------------------------------------
416
417 void DeframerComponentBase ::
418 set_bufferDeallocate_OutputPort(
419 NATIVE_INT_TYPE portNum,
420 Fw::InputSerializePort* port
421 )
422 {
423 FW_ASSERT(
424 portNum < this->getNum_bufferDeallocate_OutputPorts(),
425 static_cast<FwAssertArgType>(portNum)
426 );
427
428 this->m_bufferDeallocate_OutputPort[portNum].registerSerialPort(port);
429 }
430
431 void DeframerComponentBase ::
432 set_bufferOut_OutputPort(
433 NATIVE_INT_TYPE portNum,
434 Fw::InputSerializePort* port
435 )
436 {
437 FW_ASSERT(
438 portNum < this->getNum_bufferOut_OutputPorts(),
439 static_cast<FwAssertArgType>(portNum)
440 );
441
442 this->m_bufferOut_OutputPort[portNum].registerSerialPort(port);
443 }
444
445 void DeframerComponentBase ::
446 set_comOut_OutputPort(
447 NATIVE_INT_TYPE portNum,
448 Fw::InputSerializePort* port
449 )
450 {
451 FW_ASSERT(
452 portNum < this->getNum_comOut_OutputPorts(),
453 static_cast<FwAssertArgType>(portNum)
454 );
455
456 this->m_comOut_OutputPort[portNum].registerSerialPort(port);
457 }
458
459 void DeframerComponentBase ::
460 set_framedDeallocate_OutputPort(
461 NATIVE_INT_TYPE portNum,
462 Fw::InputSerializePort* port
463 )
464 {
465 FW_ASSERT(
466 portNum < this->getNum_framedDeallocate_OutputPorts(),
467 static_cast<FwAssertArgType>(portNum)
468 );
469
470 this->m_framedDeallocate_OutputPort[portNum].registerSerialPort(port);
471 }
472
473#endif
474
475 // ----------------------------------------------------------------------
476 // Component construction and destruction
477 // ----------------------------------------------------------------------
478
479 DeframerComponentBase ::
480 DeframerComponentBase(const char* compName) :
481 Fw::PassiveComponentBase(compName)
482 {
483
484 }
485
486 DeframerComponentBase ::
487 ~DeframerComponentBase()
488 {
489
490 }
491
492 // ----------------------------------------------------------------------
493 // Getters for numbers of typed input ports
494 // ----------------------------------------------------------------------
495
496 NATIVE_INT_TYPE DeframerComponentBase ::
497 getNum_cmdResponseIn_InputPorts() const
498 {
499 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseIn_InputPort));
500 }
501
502 NATIVE_INT_TYPE DeframerComponentBase ::
503 getNum_framedIn_InputPorts() const
504 {
505 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_framedIn_InputPort));
506 }
507
508 NATIVE_INT_TYPE DeframerComponentBase ::
509 getNum_schedIn_InputPorts() const
510 {
511 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_schedIn_InputPort));
512 }
513
514 // ----------------------------------------------------------------------
515 // Getters for numbers of typed output ports
516 // ----------------------------------------------------------------------
517
518 NATIVE_INT_TYPE DeframerComponentBase ::
519 getNum_bufferAllocate_OutputPorts() const
520 {
521 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_bufferAllocate_OutputPort));
522 }
523
524 NATIVE_INT_TYPE DeframerComponentBase ::
525 getNum_bufferDeallocate_OutputPorts() const
526 {
527 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_bufferDeallocate_OutputPort));
528 }
529
530 NATIVE_INT_TYPE DeframerComponentBase ::
531 getNum_bufferOut_OutputPorts() const
532 {
533 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_bufferOut_OutputPort));
534 }
535
536 NATIVE_INT_TYPE DeframerComponentBase ::
537 getNum_comOut_OutputPorts() const
538 {
539 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_comOut_OutputPort));
540 }
541
542 NATIVE_INT_TYPE DeframerComponentBase ::
543 getNum_framedDeallocate_OutputPorts() const
544 {
545 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_framedDeallocate_OutputPort));
546 }
547
548 NATIVE_INT_TYPE DeframerComponentBase ::
549 getNum_framedPoll_OutputPorts() const
550 {
551 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_framedPoll_OutputPort));
552 }
553
554 // ----------------------------------------------------------------------
555 // Connection status queries for typed output ports
556 // ----------------------------------------------------------------------
557
558 bool DeframerComponentBase ::
559 isConnected_bufferAllocate_OutputPort(NATIVE_INT_TYPE portNum)
560 {
561 FW_ASSERT(
562 portNum < this->getNum_bufferAllocate_OutputPorts(),
563 static_cast<FwAssertArgType>(portNum)
564 );
565
566 return this->m_bufferAllocate_OutputPort[portNum].isConnected();
567 }
568
569 bool DeframerComponentBase ::
570 isConnected_bufferDeallocate_OutputPort(NATIVE_INT_TYPE portNum)
571 {
572 FW_ASSERT(
573 portNum < this->getNum_bufferDeallocate_OutputPorts(),
574 static_cast<FwAssertArgType>(portNum)
575 );
576
577 return this->m_bufferDeallocate_OutputPort[portNum].isConnected();
578 }
579
580 bool DeframerComponentBase ::
581 isConnected_bufferOut_OutputPort(NATIVE_INT_TYPE portNum)
582 {
583 FW_ASSERT(
584 portNum < this->getNum_bufferOut_OutputPorts(),
585 static_cast<FwAssertArgType>(portNum)
586 );
587
588 return this->m_bufferOut_OutputPort[portNum].isConnected();
589 }
590
591 bool DeframerComponentBase ::
592 isConnected_comOut_OutputPort(NATIVE_INT_TYPE portNum)
593 {
594 FW_ASSERT(
595 portNum < this->getNum_comOut_OutputPorts(),
596 static_cast<FwAssertArgType>(portNum)
597 );
598
599 return this->m_comOut_OutputPort[portNum].isConnected();
600 }
601
602 bool DeframerComponentBase ::
603 isConnected_framedDeallocate_OutputPort(NATIVE_INT_TYPE portNum)
604 {
605 FW_ASSERT(
606 portNum < this->getNum_framedDeallocate_OutputPorts(),
607 static_cast<FwAssertArgType>(portNum)
608 );
609
610 return this->m_framedDeallocate_OutputPort[portNum].isConnected();
611 }
612
613 bool DeframerComponentBase ::
614 isConnected_framedPoll_OutputPort(NATIVE_INT_TYPE portNum)
615 {
616 FW_ASSERT(
617 portNum < this->getNum_framedPoll_OutputPorts(),
618 static_cast<FwAssertArgType>(portNum)
619 );
620
621 return this->m_framedPoll_OutputPort[portNum].isConnected();
622 }
623
624 // ----------------------------------------------------------------------
625 // Port handler base-class functions for typed input ports
626 //
627 // Call these functions directly to bypass the corresponding ports
628 // ----------------------------------------------------------------------
629
630 void DeframerComponentBase ::
631 cmdResponseIn_handlerBase(
632 NATIVE_INT_TYPE portNum,
633 FwOpcodeType opCode,
634 U32 cmdSeq,
635 const Fw::CmdResponse& response
636 )
637 {
638 // Make sure port number is valid
639 FW_ASSERT(
640 portNum < this->getNum_cmdResponseIn_InputPorts(),
641 static_cast<FwAssertArgType>(portNum)
642 );
643
644 // Call handler function
645 this->cmdResponseIn_handler(
646 portNum,
647 opCode,
648 cmdSeq,
649 response
650 );
651 }
652
653 void DeframerComponentBase ::
654 framedIn_handlerBase(
655 NATIVE_INT_TYPE portNum,
656 Fw::Buffer& recvBuffer,
657 const Drv::RecvStatus& recvStatus
658 )
659 {
660 // Make sure port number is valid
661 FW_ASSERT(
662 portNum < this->getNum_framedIn_InputPorts(),
663 static_cast<FwAssertArgType>(portNum)
664 );
665
666 // Lock guard mutex before calling
667 this->lock();
668
669 // Call handler function
670 this->framedIn_handler(
671 portNum,
672 recvBuffer,
673 recvStatus
674 );
675
676 // Unlock guard mutex
677 this->unLock();
678 }
679
680 void DeframerComponentBase ::
681 schedIn_handlerBase(
682 NATIVE_INT_TYPE portNum,
683 NATIVE_UINT_TYPE context
684 )
685 {
686 // Make sure port number is valid
687 FW_ASSERT(
688 portNum < this->getNum_schedIn_InputPorts(),
689 static_cast<FwAssertArgType>(portNum)
690 );
691
692 // Lock guard mutex before calling
693 this->lock();
694
695 // Call handler function
696 this->schedIn_handler(
697 portNum,
698 context
699 );
700
701 // Unlock guard mutex
702 this->unLock();
703 }
704
705 // ----------------------------------------------------------------------
706 // Invocation functions for typed output ports
707 // ----------------------------------------------------------------------
708
709 Fw::Buffer DeframerComponentBase ::
710 bufferAllocate_out(
711 NATIVE_INT_TYPE portNum,
712 U32 size
713 )
714 {
715 FW_ASSERT(
716 portNum < this->getNum_bufferAllocate_OutputPorts(),
717 static_cast<FwAssertArgType>(portNum)
718 );
719 return this->m_bufferAllocate_OutputPort[portNum].invoke(
720 size
721 );
722 }
723
724 void DeframerComponentBase ::
725 bufferDeallocate_out(
726 NATIVE_INT_TYPE portNum,
727 Fw::Buffer& fwBuffer
728 )
729 {
730 FW_ASSERT(
731 portNum < this->getNum_bufferDeallocate_OutputPorts(),
732 static_cast<FwAssertArgType>(portNum)
733 );
734 this->m_bufferDeallocate_OutputPort[portNum].invoke(
735 fwBuffer
736 );
737 }
738
739 void DeframerComponentBase ::
740 bufferOut_out(
741 NATIVE_INT_TYPE portNum,
742 Fw::Buffer& fwBuffer
743 )
744 {
745 FW_ASSERT(
746 portNum < this->getNum_bufferOut_OutputPorts(),
747 static_cast<FwAssertArgType>(portNum)
748 );
749 this->m_bufferOut_OutputPort[portNum].invoke(
750 fwBuffer
751 );
752 }
753
754 void DeframerComponentBase ::
755 comOut_out(
756 NATIVE_INT_TYPE portNum,
757 Fw::ComBuffer& data,
758 U32 context
759 )
760 {
761 FW_ASSERT(
762 portNum < this->getNum_comOut_OutputPorts(),
763 static_cast<FwAssertArgType>(portNum)
764 );
765 this->m_comOut_OutputPort[portNum].invoke(
766 data,
767 context
768 );
769 }
770
771 void DeframerComponentBase ::
772 framedDeallocate_out(
773 NATIVE_INT_TYPE portNum,
774 Fw::Buffer& fwBuffer
775 )
776 {
777 FW_ASSERT(
778 portNum < this->getNum_framedDeallocate_OutputPorts(),
779 static_cast<FwAssertArgType>(portNum)
780 );
781 this->m_framedDeallocate_OutputPort[portNum].invoke(
782 fwBuffer
783 );
784 }
785
786 Drv::PollStatus DeframerComponentBase ::
787 framedPoll_out(
788 NATIVE_INT_TYPE portNum,
789 Fw::Buffer& pollBuffer
790 )
791 {
792 FW_ASSERT(
793 portNum < this->getNum_framedPoll_OutputPorts(),
794 static_cast<FwAssertArgType>(portNum)
795 );
796 return this->m_framedPoll_OutputPort[portNum].invoke(
797 pollBuffer
798 );
799 }
800
801 // ----------------------------------------------------------------------
802 // Mutex operations for guarded ports
803 //
804 // You can override these operations to provide more sophisticated
805 // synchronization
806 // ----------------------------------------------------------------------
807
808 void DeframerComponentBase ::
809 lock()
810 {
811 this->m_guardedPortMutex.lock();
812 }
813
814 void DeframerComponentBase ::
815 unLock()
816 {
817 this->m_guardedPortMutex.unLock();
818 }
819
820 // ----------------------------------------------------------------------
821 // Calls for messages received on typed input ports
822 // ----------------------------------------------------------------------
823
824 void DeframerComponentBase ::
825 m_p_cmdResponseIn_in(
826 Fw::PassiveComponentBase* callComp,
827 NATIVE_INT_TYPE portNum,
828 FwOpcodeType opCode,
829 U32 cmdSeq,
830 const Fw::CmdResponse& response
831 )
832 {
833 FW_ASSERT(callComp);
834 DeframerComponentBase* compPtr = static_cast<DeframerComponentBase*>(callComp);
836 portNum,
837 opCode,
838 cmdSeq,
839 response
840 );
841 }
842
843 void DeframerComponentBase ::
844 m_p_framedIn_in(
845 Fw::PassiveComponentBase* callComp,
846 NATIVE_INT_TYPE portNum,
847 Fw::Buffer& recvBuffer,
848 const Drv::RecvStatus& recvStatus
849 )
850 {
851 FW_ASSERT(callComp);
852 DeframerComponentBase* compPtr = static_cast<DeframerComponentBase*>(callComp);
853 compPtr->framedIn_handlerBase(
854 portNum,
855 recvBuffer,
856 recvStatus
857 );
858 }
859
860 void DeframerComponentBase ::
861 m_p_schedIn_in(
862 Fw::PassiveComponentBase* callComp,
863 NATIVE_INT_TYPE portNum,
864 NATIVE_UINT_TYPE context
865 )
866 {
867 FW_ASSERT(callComp);
868 DeframerComponentBase* compPtr = static_cast<DeframerComponentBase*>(callComp);
869 compPtr->schedIn_handlerBase(
870 portNum,
871 context
872 );
873 }
874
875}
#define FW_ASSERT(...)
Definition Assert.hpp:14
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition BasicTypes.h:66
PlatformUIntType NATIVE_UINT_TYPE
Definition BasicTypes.h:52
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
#define PRI_PlatformIntType
PlatformAssertArgType FwAssertArgType
Definition FpConfig.h:21
U32 FwOpcodeType
Definition FpConfig.h:56
Input ByteStreamPoll port.
Status associated with the received data.
Enum representing a command response.
void init()
Object initializer.
Definition ObjBase.cpp:27
Auto-generated base for Deframer component.
void framedIn_handlerBase(NATIVE_INT_TYPE portNum, Fw::Buffer &recvBuffer, const Drv::RecvStatus &recvStatus)
Handler base-class function for input port framedIn.
void cmdResponseIn_handlerBase(NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port cmdResponseIn.