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