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
FileDownlinkComponentAc.cpp
Go to the documentation of this file.
1// ======================================================================
2// \title FileDownlinkComponentAc.cpp
3// \author Generated by fpp-to-cpp
4// \brief cpp file for FileDownlink 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 enum MsgTypeEnum {
19 FILEDOWNLINK_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
20 RUN_SCHED,
21 BUFFERRETURN_BUFFERSEND,
22 PINGIN_PING,
23 CMD_SENDFILE,
24 CMD_CANCEL,
25 CMD_SENDPARTIAL,
26 };
27
28 // Get the max size by constructing a union of the async input, command, and
29 // internal port serialization sizes
30 union BuffUnion {
35 };
36
37 // Define a message buffer class large enough to handle all the
38 // asynchronous inputs to the component
39 class ComponentIpcSerializableBuffer :
41 {
42
43 public:
44
45 enum {
46 // Max. message size = size of data + message id + port
47 SERIALIZATION_SIZE =
48 sizeof(BuffUnion) +
49 sizeof(NATIVE_INT_TYPE) +
50 sizeof(NATIVE_INT_TYPE)
51 };
52
53 NATIVE_UINT_TYPE getBuffCapacity() const {
54 return sizeof(m_buff);
55 }
56
57 U8* getBuffAddr() {
58 return m_buff;
59 }
60
61 const U8* getBuffAddr() const {
62 return m_buff;
63 }
64
65 private:
66 // Should be the max of all the input ports serialized sizes...
67 U8 m_buff[SERIALIZATION_SIZE];
68
69 };
70 }
71
72 // ----------------------------------------------------------------------
73 // Component initialization
74 // ----------------------------------------------------------------------
75
76 void FileDownlinkComponentBase ::
77 init(
78 NATIVE_INT_TYPE queueDepth,
79 NATIVE_INT_TYPE instance
80 )
81 {
82 // Initialize base class
84
85 // Connect input port cmdIn
86 for (
87 PlatformIntType port = 0;
88 port < static_cast<PlatformIntType>(this->getNum_cmdIn_InputPorts());
89 port++
90 ) {
91 this->m_cmdIn_InputPort[port].init();
92 this->m_cmdIn_InputPort[port].addCallComp(
93 this,
94 m_p_cmdIn_in
95 );
96 this->m_cmdIn_InputPort[port].setPortNum(port);
97
98#if FW_OBJECT_NAMES == 1
99 char portName[120];
100 (void) snprintf(
101 portName,
102 sizeof(portName),
103 "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]",
104 this->m_objName,
105 port
106 );
107 this->m_cmdIn_InputPort[port].setObjName(portName);
108#endif
109 }
110
111 // Connect input port Run
112 for (
113 PlatformIntType port = 0;
114 port < static_cast<PlatformIntType>(this->getNum_Run_InputPorts());
115 port++
116 ) {
117 this->m_Run_InputPort[port].init();
118 this->m_Run_InputPort[port].addCallComp(
119 this,
120 m_p_Run_in
121 );
122 this->m_Run_InputPort[port].setPortNum(port);
123
124#if FW_OBJECT_NAMES == 1
125 char portName[120];
126 (void) snprintf(
127 portName,
128 sizeof(portName),
129 "%s_Run_InputPort[%" PRI_PlatformIntType "]",
130 this->m_objName,
131 port
132 );
133 this->m_Run_InputPort[port].setObjName(portName);
134#endif
135 }
136
137 // Connect input port SendFile
138 for (
139 PlatformIntType port = 0;
140 port < static_cast<PlatformIntType>(this->getNum_SendFile_InputPorts());
141 port++
142 ) {
143 this->m_SendFile_InputPort[port].init();
144 this->m_SendFile_InputPort[port].addCallComp(
145 this,
146 m_p_SendFile_in
147 );
148 this->m_SendFile_InputPort[port].setPortNum(port);
149
150#if FW_OBJECT_NAMES == 1
151 char portName[120];
152 (void) snprintf(
153 portName,
154 sizeof(portName),
155 "%s_SendFile_InputPort[%" PRI_PlatformIntType "]",
156 this->m_objName,
157 port
158 );
159 this->m_SendFile_InputPort[port].setObjName(portName);
160#endif
161 }
162
163 // Connect input port bufferReturn
164 for (
165 PlatformIntType port = 0;
166 port < static_cast<PlatformIntType>(this->getNum_bufferReturn_InputPorts());
167 port++
168 ) {
169 this->m_bufferReturn_InputPort[port].init();
170 this->m_bufferReturn_InputPort[port].addCallComp(
171 this,
172 m_p_bufferReturn_in
173 );
174 this->m_bufferReturn_InputPort[port].setPortNum(port);
175
176#if FW_OBJECT_NAMES == 1
177 char portName[120];
178 (void) snprintf(
179 portName,
180 sizeof(portName),
181 "%s_bufferReturn_InputPort[%" PRI_PlatformIntType "]",
182 this->m_objName,
183 port
184 );
185 this->m_bufferReturn_InputPort[port].setObjName(portName);
186#endif
187 }
188
189 // Connect input port pingIn
190 for (
191 PlatformIntType port = 0;
192 port < static_cast<PlatformIntType>(this->getNum_pingIn_InputPorts());
193 port++
194 ) {
195 this->m_pingIn_InputPort[port].init();
196 this->m_pingIn_InputPort[port].addCallComp(
197 this,
198 m_p_pingIn_in
199 );
200 this->m_pingIn_InputPort[port].setPortNum(port);
201
202#if FW_OBJECT_NAMES == 1
203 char portName[120];
204 (void) snprintf(
205 portName,
206 sizeof(portName),
207 "%s_pingIn_InputPort[%" PRI_PlatformIntType "]",
208 this->m_objName,
209 port
210 );
211 this->m_pingIn_InputPort[port].setObjName(portName);
212#endif
213 }
214
215 // Connect output port cmdRegOut
216 for (
217 PlatformIntType port = 0;
218 port < static_cast<PlatformIntType>(this->getNum_cmdRegOut_OutputPorts());
219 port++
220 ) {
221 this->m_cmdRegOut_OutputPort[port].init();
222
223#if FW_OBJECT_NAMES == 1
224 char portName[120];
225 (void) snprintf(
226 portName,
227 sizeof(portName),
228 "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]",
229 this->m_objName,
230 port
231 );
232 this->m_cmdRegOut_OutputPort[port].setObjName(portName);
233#endif
234 }
235
236 // Connect output port cmdResponseOut
237 for (
238 PlatformIntType port = 0;
239 port < static_cast<PlatformIntType>(this->getNum_cmdResponseOut_OutputPorts());
240 port++
241 ) {
242 this->m_cmdResponseOut_OutputPort[port].init();
243
244#if FW_OBJECT_NAMES == 1
245 char portName[120];
246 (void) snprintf(
247 portName,
248 sizeof(portName),
249 "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]",
250 this->m_objName,
251 port
252 );
253 this->m_cmdResponseOut_OutputPort[port].setObjName(portName);
254#endif
255 }
256
257 // Connect output port eventOut
258 for (
259 PlatformIntType port = 0;
260 port < static_cast<PlatformIntType>(this->getNum_eventOut_OutputPorts());
261 port++
262 ) {
263 this->m_eventOut_OutputPort[port].init();
264
265#if FW_OBJECT_NAMES == 1
266 char portName[120];
267 (void) snprintf(
268 portName,
269 sizeof(portName),
270 "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]",
271 this->m_objName,
272 port
273 );
274 this->m_eventOut_OutputPort[port].setObjName(portName);
275#endif
276 }
277
278#if FW_ENABLE_TEXT_LOGGING == 1
279 // Connect output port textEventOut
280 for (
281 PlatformIntType port = 0;
282 port < static_cast<PlatformIntType>(this->getNum_textEventOut_OutputPorts());
283 port++
284 ) {
285 this->m_textEventOut_OutputPort[port].init();
286
287#if FW_OBJECT_NAMES == 1
288 char portName[120];
289 (void) snprintf(
290 portName,
291 sizeof(portName),
292 "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]",
293 this->m_objName,
294 port
295 );
296 this->m_textEventOut_OutputPort[port].setObjName(portName);
297#endif
298 }
299#endif
300
301 // Connect output port timeCaller
302 for (
303 PlatformIntType port = 0;
304 port < static_cast<PlatformIntType>(this->getNum_timeCaller_OutputPorts());
305 port++
306 ) {
307 this->m_timeCaller_OutputPort[port].init();
308
309#if FW_OBJECT_NAMES == 1
310 char portName[120];
311 (void) snprintf(
312 portName,
313 sizeof(portName),
314 "%s_timeCaller_OutputPort[%" PRI_PlatformIntType "]",
315 this->m_objName,
316 port
317 );
318 this->m_timeCaller_OutputPort[port].setObjName(portName);
319#endif
320 }
321
322 // Connect output port tlmOut
323 for (
324 PlatformIntType port = 0;
325 port < static_cast<PlatformIntType>(this->getNum_tlmOut_OutputPorts());
326 port++
327 ) {
328 this->m_tlmOut_OutputPort[port].init();
329
330#if FW_OBJECT_NAMES == 1
331 char portName[120];
332 (void) snprintf(
333 portName,
334 sizeof(portName),
335 "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]",
336 this->m_objName,
337 port
338 );
339 this->m_tlmOut_OutputPort[port].setObjName(portName);
340#endif
341 }
342
343 // Connect output port FileComplete
344 for (
345 PlatformIntType port = 0;
346 port < static_cast<PlatformIntType>(this->getNum_FileComplete_OutputPorts());
347 port++
348 ) {
349 this->m_FileComplete_OutputPort[port].init();
350
351#if FW_OBJECT_NAMES == 1
352 char portName[120];
353 (void) snprintf(
354 portName,
355 sizeof(portName),
356 "%s_FileComplete_OutputPort[%" PRI_PlatformIntType "]",
357 this->m_objName,
358 port
359 );
360 this->m_FileComplete_OutputPort[port].setObjName(portName);
361#endif
362 }
363
364 // Connect output port bufferSendOut
365 for (
366 PlatformIntType port = 0;
367 port < static_cast<PlatformIntType>(this->getNum_bufferSendOut_OutputPorts());
368 port++
369 ) {
370 this->m_bufferSendOut_OutputPort[port].init();
371
372#if FW_OBJECT_NAMES == 1
373 char portName[120];
374 (void) snprintf(
375 portName,
376 sizeof(portName),
377 "%s_bufferSendOut_OutputPort[%" PRI_PlatformIntType "]",
378 this->m_objName,
379 port
380 );
381 this->m_bufferSendOut_OutputPort[port].setObjName(portName);
382#endif
383 }
384
385 // Connect output port pingOut
386 for (
387 PlatformIntType port = 0;
388 port < static_cast<PlatformIntType>(this->getNum_pingOut_OutputPorts());
389 port++
390 ) {
391 this->m_pingOut_OutputPort[port].init();
392
393#if FW_OBJECT_NAMES == 1
394 char portName[120];
395 (void) snprintf(
396 portName,
397 sizeof(portName),
398 "%s_pingOut_OutputPort[%" PRI_PlatformIntType "]",
399 this->m_objName,
400 port
401 );
402 this->m_pingOut_OutputPort[port].setObjName(portName);
403#endif
404 }
405
406 Os::Queue::QueueStatus qStat = this->createQueue(
407 queueDepth,
408 ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
409 );
410 FW_ASSERT(
411 Os::Queue::QUEUE_OK == qStat,
412 static_cast<FwAssertArgType>(qStat)
413 );
414 }
415
416 // ----------------------------------------------------------------------
417 // Getters for special input ports
418 // ----------------------------------------------------------------------
419
420 Fw::InputCmdPort* FileDownlinkComponentBase ::
421 get_cmdIn_InputPort(NATIVE_INT_TYPE portNum)
422 {
423 FW_ASSERT(
424 portNum < this->getNum_cmdIn_InputPorts(),
425 static_cast<FwAssertArgType>(portNum)
426 );
427
428 return &this->m_cmdIn_InputPort[portNum];
429 }
430
431 // ----------------------------------------------------------------------
432 // Getters for typed input ports
433 // ----------------------------------------------------------------------
434
435 Svc::InputSchedPort* FileDownlinkComponentBase ::
436 get_Run_InputPort(NATIVE_INT_TYPE portNum)
437 {
438 FW_ASSERT(
439 portNum < this->getNum_Run_InputPorts(),
440 static_cast<FwAssertArgType>(portNum)
441 );
442
443 return &this->m_Run_InputPort[portNum];
444 }
445
446 Svc::InputSendFileRequestPort* FileDownlinkComponentBase ::
447 get_SendFile_InputPort(NATIVE_INT_TYPE portNum)
448 {
449 FW_ASSERT(
450 portNum < this->getNum_SendFile_InputPorts(),
451 static_cast<FwAssertArgType>(portNum)
452 );
453
454 return &this->m_SendFile_InputPort[portNum];
455 }
456
457 Fw::InputBufferSendPort* FileDownlinkComponentBase ::
458 get_bufferReturn_InputPort(NATIVE_INT_TYPE portNum)
459 {
460 FW_ASSERT(
461 portNum < this->getNum_bufferReturn_InputPorts(),
462 static_cast<FwAssertArgType>(portNum)
463 );
464
465 return &this->m_bufferReturn_InputPort[portNum];
466 }
467
468 Svc::InputPingPort* FileDownlinkComponentBase ::
469 get_pingIn_InputPort(NATIVE_INT_TYPE portNum)
470 {
471 FW_ASSERT(
472 portNum < this->getNum_pingIn_InputPorts(),
473 static_cast<FwAssertArgType>(portNum)
474 );
475
476 return &this->m_pingIn_InputPort[portNum];
477 }
478
479 // ----------------------------------------------------------------------
480 // Connect input ports to special output ports
481 // ----------------------------------------------------------------------
482
483 void FileDownlinkComponentBase ::
484 set_cmdRegOut_OutputPort(
485 NATIVE_INT_TYPE portNum,
487 )
488 {
489 FW_ASSERT(
490 portNum < this->getNum_cmdRegOut_OutputPorts(),
491 static_cast<FwAssertArgType>(portNum)
492 );
493
494 this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
495 }
496
497 void FileDownlinkComponentBase ::
498 set_cmdResponseOut_OutputPort(
499 NATIVE_INT_TYPE portNum,
501 )
502 {
503 FW_ASSERT(
504 portNum < this->getNum_cmdResponseOut_OutputPorts(),
505 static_cast<FwAssertArgType>(portNum)
506 );
507
508 this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
509 }
510
511 void FileDownlinkComponentBase ::
512 set_eventOut_OutputPort(
513 NATIVE_INT_TYPE portNum,
514 Fw::InputLogPort* port
515 )
516 {
517 FW_ASSERT(
518 portNum < this->getNum_eventOut_OutputPorts(),
519 static_cast<FwAssertArgType>(portNum)
520 );
521
522 this->m_eventOut_OutputPort[portNum].addCallPort(port);
523 }
524
525#if FW_ENABLE_TEXT_LOGGING == 1
526
527 void FileDownlinkComponentBase ::
528 set_textEventOut_OutputPort(
529 NATIVE_INT_TYPE portNum,
531 )
532 {
533 FW_ASSERT(
534 portNum < this->getNum_textEventOut_OutputPorts(),
535 static_cast<FwAssertArgType>(portNum)
536 );
537
538 this->m_textEventOut_OutputPort[portNum].addCallPort(port);
539 }
540
541#endif
542
543 void FileDownlinkComponentBase ::
544 set_timeCaller_OutputPort(
545 NATIVE_INT_TYPE portNum,
547 )
548 {
549 FW_ASSERT(
550 portNum < this->getNum_timeCaller_OutputPorts(),
551 static_cast<FwAssertArgType>(portNum)
552 );
553
554 this->m_timeCaller_OutputPort[portNum].addCallPort(port);
555 }
556
557 void FileDownlinkComponentBase ::
558 set_tlmOut_OutputPort(
559 NATIVE_INT_TYPE portNum,
560 Fw::InputTlmPort* port
561 )
562 {
563 FW_ASSERT(
564 portNum < this->getNum_tlmOut_OutputPorts(),
565 static_cast<FwAssertArgType>(portNum)
566 );
567
568 this->m_tlmOut_OutputPort[portNum].addCallPort(port);
569 }
570
571 // ----------------------------------------------------------------------
572 // Connect typed input ports to typed output ports
573 // ----------------------------------------------------------------------
574
575 void FileDownlinkComponentBase ::
576 set_FileComplete_OutputPort(
577 NATIVE_INT_TYPE portNum,
579 )
580 {
581 FW_ASSERT(
582 portNum < this->getNum_FileComplete_OutputPorts(),
583 static_cast<FwAssertArgType>(portNum)
584 );
585
586 this->m_FileComplete_OutputPort[portNum].addCallPort(port);
587 }
588
589 void FileDownlinkComponentBase ::
590 set_bufferSendOut_OutputPort(
591 NATIVE_INT_TYPE portNum,
593 )
594 {
595 FW_ASSERT(
596 portNum < this->getNum_bufferSendOut_OutputPorts(),
597 static_cast<FwAssertArgType>(portNum)
598 );
599
600 this->m_bufferSendOut_OutputPort[portNum].addCallPort(port);
601 }
602
603 void FileDownlinkComponentBase ::
604 set_pingOut_OutputPort(
605 NATIVE_INT_TYPE portNum,
607 )
608 {
609 FW_ASSERT(
610 portNum < this->getNum_pingOut_OutputPorts(),
611 static_cast<FwAssertArgType>(portNum)
612 );
613
614 this->m_pingOut_OutputPort[portNum].addCallPort(port);
615 }
616
617#if FW_PORT_SERIALIZATION
618
619 // ----------------------------------------------------------------------
620 // Connect serial input ports to special output ports
621 // ----------------------------------------------------------------------
622
623 void FileDownlinkComponentBase ::
624 set_cmdRegOut_OutputPort(
625 NATIVE_INT_TYPE portNum,
626 Fw::InputSerializePort* port
627 )
628 {
629 FW_ASSERT(
630 portNum < this->getNum_cmdRegOut_OutputPorts(),
631 static_cast<FwAssertArgType>(portNum)
632 );
633
634 this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
635 }
636
637 void FileDownlinkComponentBase ::
638 set_cmdResponseOut_OutputPort(
639 NATIVE_INT_TYPE portNum,
640 Fw::InputSerializePort* port
641 )
642 {
643 FW_ASSERT(
644 portNum < this->getNum_cmdResponseOut_OutputPorts(),
645 static_cast<FwAssertArgType>(portNum)
646 );
647
648 this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
649 }
650
651 void FileDownlinkComponentBase ::
652 set_eventOut_OutputPort(
653 NATIVE_INT_TYPE portNum,
654 Fw::InputSerializePort* port
655 )
656 {
657 FW_ASSERT(
658 portNum < this->getNum_eventOut_OutputPorts(),
659 static_cast<FwAssertArgType>(portNum)
660 );
661
662 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
663 }
664
665#if FW_ENABLE_TEXT_LOGGING == 1
666
667 void FileDownlinkComponentBase ::
668 set_textEventOut_OutputPort(
669 NATIVE_INT_TYPE portNum,
670 Fw::InputSerializePort* port
671 )
672 {
673 FW_ASSERT(
674 portNum < this->getNum_textEventOut_OutputPorts(),
675 static_cast<FwAssertArgType>(portNum)
676 );
677
678 this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
679 }
680
681#endif
682
683 void FileDownlinkComponentBase ::
684 set_timeCaller_OutputPort(
685 NATIVE_INT_TYPE portNum,
686 Fw::InputSerializePort* port
687 )
688 {
689 FW_ASSERT(
690 portNum < this->getNum_timeCaller_OutputPorts(),
691 static_cast<FwAssertArgType>(portNum)
692 );
693
694 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
695 }
696
697 void FileDownlinkComponentBase ::
698 set_tlmOut_OutputPort(
699 NATIVE_INT_TYPE portNum,
700 Fw::InputSerializePort* port
701 )
702 {
703 FW_ASSERT(
704 portNum < this->getNum_tlmOut_OutputPorts(),
705 static_cast<FwAssertArgType>(portNum)
706 );
707
708 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
709 }
710
711#endif
712
713#if FW_PORT_SERIALIZATION
714
715 // ----------------------------------------------------------------------
716 // Connect serial input ports to typed output ports
717 // ----------------------------------------------------------------------
718
719 void FileDownlinkComponentBase ::
720 set_FileComplete_OutputPort(
721 NATIVE_INT_TYPE portNum,
722 Fw::InputSerializePort* port
723 )
724 {
725 FW_ASSERT(
726 portNum < this->getNum_FileComplete_OutputPorts(),
727 static_cast<FwAssertArgType>(portNum)
728 );
729
730 this->m_FileComplete_OutputPort[portNum].registerSerialPort(port);
731 }
732
733 void FileDownlinkComponentBase ::
734 set_bufferSendOut_OutputPort(
735 NATIVE_INT_TYPE portNum,
736 Fw::InputSerializePort* port
737 )
738 {
739 FW_ASSERT(
740 portNum < this->getNum_bufferSendOut_OutputPorts(),
741 static_cast<FwAssertArgType>(portNum)
742 );
743
744 this->m_bufferSendOut_OutputPort[portNum].registerSerialPort(port);
745 }
746
747 void FileDownlinkComponentBase ::
748 set_pingOut_OutputPort(
749 NATIVE_INT_TYPE portNum,
750 Fw::InputSerializePort* port
751 )
752 {
753 FW_ASSERT(
754 portNum < this->getNum_pingOut_OutputPorts(),
755 static_cast<FwAssertArgType>(portNum)
756 );
757
758 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
759 }
760
761#endif
762
763 // ----------------------------------------------------------------------
764 // Command registration
765 // ----------------------------------------------------------------------
766
767 void FileDownlinkComponentBase ::
768 regCommands()
769 {
770 FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
771
772 this->m_cmdRegOut_OutputPort[0].invoke(
773 this->getIdBase() + OPCODE_SENDFILE
774 );
775
776 this->m_cmdRegOut_OutputPort[0].invoke(
777 this->getIdBase() + OPCODE_CANCEL
778 );
779
780 this->m_cmdRegOut_OutputPort[0].invoke(
781 this->getIdBase() + OPCODE_SENDPARTIAL
782 );
783 }
784
785 // ----------------------------------------------------------------------
786 // Component construction and destruction
787 // ----------------------------------------------------------------------
788
789 FileDownlinkComponentBase ::
790 FileDownlinkComponentBase(const char* compName) :
791 Fw::ActiveComponentBase(compName)
792 {
793
794 }
795
796 FileDownlinkComponentBase ::
797 ~FileDownlinkComponentBase()
798 {
799
800 }
801
802 // ----------------------------------------------------------------------
803 // Getters for numbers of special input ports
804 // ----------------------------------------------------------------------
805
806 NATIVE_INT_TYPE FileDownlinkComponentBase ::
807 getNum_cmdIn_InputPorts() const
808 {
809 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
810 }
811
812 // ----------------------------------------------------------------------
813 // Getters for numbers of typed input ports
814 // ----------------------------------------------------------------------
815
816 NATIVE_INT_TYPE FileDownlinkComponentBase ::
817 getNum_Run_InputPorts() const
818 {
819 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_Run_InputPort));
820 }
821
822 NATIVE_INT_TYPE FileDownlinkComponentBase ::
823 getNum_SendFile_InputPorts() const
824 {
825 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_SendFile_InputPort));
826 }
827
828 NATIVE_INT_TYPE FileDownlinkComponentBase ::
829 getNum_bufferReturn_InputPorts() const
830 {
831 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_bufferReturn_InputPort));
832 }
833
834 NATIVE_INT_TYPE FileDownlinkComponentBase ::
835 getNum_pingIn_InputPorts() const
836 {
837 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_pingIn_InputPort));
838 }
839
840 // ----------------------------------------------------------------------
841 // Getters for numbers of special output ports
842 // ----------------------------------------------------------------------
843
844 NATIVE_INT_TYPE FileDownlinkComponentBase ::
845 getNum_cmdRegOut_OutputPorts() const
846 {
847 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
848 }
849
850 NATIVE_INT_TYPE FileDownlinkComponentBase ::
851 getNum_cmdResponseOut_OutputPorts() const
852 {
853 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
854 }
855
856 NATIVE_INT_TYPE FileDownlinkComponentBase ::
857 getNum_eventOut_OutputPorts() const
858 {
859 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_eventOut_OutputPort));
860 }
861
862#if FW_ENABLE_TEXT_LOGGING == 1
863
864 NATIVE_INT_TYPE FileDownlinkComponentBase ::
865 getNum_textEventOut_OutputPorts() const
866 {
867 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_textEventOut_OutputPort));
868 }
869
870#endif
871
872 NATIVE_INT_TYPE FileDownlinkComponentBase ::
873 getNum_timeCaller_OutputPorts() const
874 {
875 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_timeCaller_OutputPort));
876 }
877
878 NATIVE_INT_TYPE FileDownlinkComponentBase ::
879 getNum_tlmOut_OutputPorts() const
880 {
881 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
882 }
883
884 // ----------------------------------------------------------------------
885 // Getters for numbers of typed output ports
886 // ----------------------------------------------------------------------
887
888 NATIVE_INT_TYPE FileDownlinkComponentBase ::
889 getNum_FileComplete_OutputPorts() const
890 {
891 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_FileComplete_OutputPort));
892 }
893
894 NATIVE_INT_TYPE FileDownlinkComponentBase ::
895 getNum_bufferSendOut_OutputPorts() const
896 {
897 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_bufferSendOut_OutputPort));
898 }
899
900 NATIVE_INT_TYPE FileDownlinkComponentBase ::
901 getNum_pingOut_OutputPorts() const
902 {
903 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_pingOut_OutputPort));
904 }
905
906 // ----------------------------------------------------------------------
907 // Connection status queries for special output ports
908 // ----------------------------------------------------------------------
909
910 bool FileDownlinkComponentBase ::
911 isConnected_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum)
912 {
913 FW_ASSERT(
914 portNum < this->getNum_cmdRegOut_OutputPorts(),
915 static_cast<FwAssertArgType>(portNum)
916 );
917
918 return this->m_cmdRegOut_OutputPort[portNum].isConnected();
919 }
920
921 bool FileDownlinkComponentBase ::
922 isConnected_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum)
923 {
924 FW_ASSERT(
925 portNum < this->getNum_cmdResponseOut_OutputPorts(),
926 static_cast<FwAssertArgType>(portNum)
927 );
928
929 return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
930 }
931
932 bool FileDownlinkComponentBase ::
933 isConnected_eventOut_OutputPort(NATIVE_INT_TYPE portNum)
934 {
935 FW_ASSERT(
936 portNum < this->getNum_eventOut_OutputPorts(),
937 static_cast<FwAssertArgType>(portNum)
938 );
939
940 return this->m_eventOut_OutputPort[portNum].isConnected();
941 }
942
943#if FW_ENABLE_TEXT_LOGGING == 1
944
945 bool FileDownlinkComponentBase ::
946 isConnected_textEventOut_OutputPort(NATIVE_INT_TYPE portNum)
947 {
948 FW_ASSERT(
949 portNum < this->getNum_textEventOut_OutputPorts(),
950 static_cast<FwAssertArgType>(portNum)
951 );
952
953 return this->m_textEventOut_OutputPort[portNum].isConnected();
954 }
955
956#endif
957
958 bool FileDownlinkComponentBase ::
959 isConnected_timeCaller_OutputPort(NATIVE_INT_TYPE portNum)
960 {
961 FW_ASSERT(
962 portNum < this->getNum_timeCaller_OutputPorts(),
963 static_cast<FwAssertArgType>(portNum)
964 );
965
966 return this->m_timeCaller_OutputPort[portNum].isConnected();
967 }
968
969 bool FileDownlinkComponentBase ::
970 isConnected_tlmOut_OutputPort(NATIVE_INT_TYPE portNum)
971 {
972 FW_ASSERT(
973 portNum < this->getNum_tlmOut_OutputPorts(),
974 static_cast<FwAssertArgType>(portNum)
975 );
976
977 return this->m_tlmOut_OutputPort[portNum].isConnected();
978 }
979
980 // ----------------------------------------------------------------------
981 // Connection status queries for typed output ports
982 // ----------------------------------------------------------------------
983
984 bool FileDownlinkComponentBase ::
985 isConnected_FileComplete_OutputPort(NATIVE_INT_TYPE portNum)
986 {
987 FW_ASSERT(
988 portNum < this->getNum_FileComplete_OutputPorts(),
989 static_cast<FwAssertArgType>(portNum)
990 );
991
992 return this->m_FileComplete_OutputPort[portNum].isConnected();
993 }
994
995 bool FileDownlinkComponentBase ::
996 isConnected_bufferSendOut_OutputPort(NATIVE_INT_TYPE portNum)
997 {
998 FW_ASSERT(
999 portNum < this->getNum_bufferSendOut_OutputPorts(),
1000 static_cast<FwAssertArgType>(portNum)
1001 );
1002
1003 return this->m_bufferSendOut_OutputPort[portNum].isConnected();
1004 }
1005
1006 bool FileDownlinkComponentBase ::
1007 isConnected_pingOut_OutputPort(NATIVE_INT_TYPE portNum)
1008 {
1009 FW_ASSERT(
1010 portNum < this->getNum_pingOut_OutputPorts(),
1011 static_cast<FwAssertArgType>(portNum)
1012 );
1013
1014 return this->m_pingOut_OutputPort[portNum].isConnected();
1015 }
1016
1017 // ----------------------------------------------------------------------
1018 // Port handler base-class functions for typed input ports
1019 //
1020 // Call these functions directly to bypass the corresponding ports
1021 // ----------------------------------------------------------------------
1022
1023 void FileDownlinkComponentBase ::
1024 Run_handlerBase(
1025 NATIVE_INT_TYPE portNum,
1026 NATIVE_UINT_TYPE context
1027 )
1028 {
1029 // Make sure port number is valid
1030 FW_ASSERT(
1031 portNum < this->getNum_Run_InputPorts(),
1032 static_cast<FwAssertArgType>(portNum)
1033 );
1034
1035 // Call pre-message hook
1036 Run_preMsgHook(
1037 portNum,
1038 context
1039 );
1040 ComponentIpcSerializableBuffer msg;
1042
1043 // Serialize message ID
1044 _status = msg.serialize(
1045 static_cast<NATIVE_INT_TYPE>(RUN_SCHED)
1046 );
1047 FW_ASSERT(
1048 _status == Fw::FW_SERIALIZE_OK,
1049 static_cast<FwAssertArgType>(_status)
1050 );
1051
1052 // Serialize port number
1053 _status = msg.serialize(portNum);
1054 FW_ASSERT(
1055 _status == Fw::FW_SERIALIZE_OK,
1056 static_cast<FwAssertArgType>(_status)
1057 );
1058
1059 // Serialize argument context
1060 _status = msg.serialize(context);
1061 FW_ASSERT(
1062 _status == Fw::FW_SERIALIZE_OK,
1063 static_cast<FwAssertArgType>(_status)
1064 );
1065
1066 // Send message
1068 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1069
1070 FW_ASSERT(
1071 qStatus == Os::Queue::QUEUE_OK,
1072 static_cast<FwAssertArgType>(qStatus)
1073 );
1074 }
1075
1076 Svc::SendFileResponse FileDownlinkComponentBase ::
1077 SendFile_handlerBase(
1078 NATIVE_INT_TYPE portNum,
1081 U32 offset,
1082 U32 length
1083 )
1084 {
1085 // Make sure port number is valid
1086 FW_ASSERT(
1087 portNum < this->getNum_SendFile_InputPorts(),
1088 static_cast<FwAssertArgType>(portNum)
1089 );
1090
1091 Svc::SendFileResponse retVal;
1092
1093 // Lock guard mutex before calling
1094 this->lock();
1095
1096 // Down call to pure virtual handler method implemented in Impl class
1097 retVal = this->SendFile_handler(
1098 portNum,
1099 sourceFileName,
1100 destFileName,
1101 offset,
1102 length
1103 );
1104
1105 // Unlock guard mutex
1106 this->unLock();
1107
1108 return retVal;
1109 }
1110
1111 void FileDownlinkComponentBase ::
1112 bufferReturn_handlerBase(
1113 NATIVE_INT_TYPE portNum,
1114 Fw::Buffer& fwBuffer
1115 )
1116 {
1117 // Make sure port number is valid
1118 FW_ASSERT(
1119 portNum < this->getNum_bufferReturn_InputPorts(),
1120 static_cast<FwAssertArgType>(portNum)
1121 );
1122
1123 // Call pre-message hook
1124 bufferReturn_preMsgHook(
1125 portNum,
1126 fwBuffer
1127 );
1128 ComponentIpcSerializableBuffer msg;
1130
1131 // Serialize message ID
1132 _status = msg.serialize(
1133 static_cast<NATIVE_INT_TYPE>(BUFFERRETURN_BUFFERSEND)
1134 );
1135 FW_ASSERT(
1136 _status == Fw::FW_SERIALIZE_OK,
1137 static_cast<FwAssertArgType>(_status)
1138 );
1139
1140 // Serialize port number
1141 _status = msg.serialize(portNum);
1142 FW_ASSERT(
1143 _status == Fw::FW_SERIALIZE_OK,
1144 static_cast<FwAssertArgType>(_status)
1145 );
1146
1147 // Serialize argument fwBuffer
1148 _status = msg.serialize(fwBuffer);
1149 FW_ASSERT(
1150 _status == Fw::FW_SERIALIZE_OK,
1151 static_cast<FwAssertArgType>(_status)
1152 );
1153
1154 // Send message
1156 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1157
1158 FW_ASSERT(
1159 qStatus == Os::Queue::QUEUE_OK,
1160 static_cast<FwAssertArgType>(qStatus)
1161 );
1162 }
1163
1164 void FileDownlinkComponentBase ::
1165 pingIn_handlerBase(
1166 NATIVE_INT_TYPE portNum,
1167 U32 key
1168 )
1169 {
1170 // Make sure port number is valid
1171 FW_ASSERT(
1172 portNum < this->getNum_pingIn_InputPorts(),
1173 static_cast<FwAssertArgType>(portNum)
1174 );
1175
1176 // Call pre-message hook
1177 pingIn_preMsgHook(
1178 portNum,
1179 key
1180 );
1181 ComponentIpcSerializableBuffer msg;
1183
1184 // Serialize message ID
1185 _status = msg.serialize(
1186 static_cast<NATIVE_INT_TYPE>(PINGIN_PING)
1187 );
1188 FW_ASSERT(
1189 _status == Fw::FW_SERIALIZE_OK,
1190 static_cast<FwAssertArgType>(_status)
1191 );
1192
1193 // Serialize port number
1194 _status = msg.serialize(portNum);
1195 FW_ASSERT(
1196 _status == Fw::FW_SERIALIZE_OK,
1197 static_cast<FwAssertArgType>(_status)
1198 );
1199
1200 // Serialize argument key
1201 _status = msg.serialize(key);
1202 FW_ASSERT(
1203 _status == Fw::FW_SERIALIZE_OK,
1204 static_cast<FwAssertArgType>(_status)
1205 );
1206
1207 // Send message
1209 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1210
1211 FW_ASSERT(
1212 qStatus == Os::Queue::QUEUE_OK,
1213 static_cast<FwAssertArgType>(qStatus)
1214 );
1215 }
1216
1217 // ----------------------------------------------------------------------
1218 // Pre-message hooks for typed async input ports
1219 //
1220 // Each of these functions is invoked just before processing a message
1221 // on the corresponding port. By default, they do nothing. You can
1222 // override them to provide specific pre-message behavior.
1223 // ----------------------------------------------------------------------
1224
1225 void FileDownlinkComponentBase ::
1226 Run_preMsgHook(
1227 NATIVE_INT_TYPE portNum,
1228 NATIVE_UINT_TYPE context
1229 )
1230 {
1231 // Default: no-op
1232 }
1233
1234 void FileDownlinkComponentBase ::
1235 bufferReturn_preMsgHook(
1236 NATIVE_INT_TYPE portNum,
1237 Fw::Buffer& fwBuffer
1238 )
1239 {
1240 // Default: no-op
1241 }
1242
1243 void FileDownlinkComponentBase ::
1244 pingIn_preMsgHook(
1245 NATIVE_INT_TYPE portNum,
1246 U32 key
1247 )
1248 {
1249 // Default: no-op
1250 }
1251
1252 // ----------------------------------------------------------------------
1253 // Invocation functions for typed output ports
1254 // ----------------------------------------------------------------------
1255
1256 void FileDownlinkComponentBase ::
1257 FileComplete_out(
1258 NATIVE_INT_TYPE portNum,
1259 const Svc::SendFileResponse& resp
1260 )
1261 {
1262 FW_ASSERT(
1263 portNum < this->getNum_FileComplete_OutputPorts(),
1264 static_cast<FwAssertArgType>(portNum)
1265 );
1266 this->m_FileComplete_OutputPort[portNum].invoke(
1267 resp
1268 );
1269 }
1270
1271 void FileDownlinkComponentBase ::
1272 bufferSendOut_out(
1273 NATIVE_INT_TYPE portNum,
1274 Fw::Buffer& fwBuffer
1275 )
1276 {
1277 FW_ASSERT(
1278 portNum < this->getNum_bufferSendOut_OutputPorts(),
1279 static_cast<FwAssertArgType>(portNum)
1280 );
1281 this->m_bufferSendOut_OutputPort[portNum].invoke(
1282 fwBuffer
1283 );
1284 }
1285
1286 void FileDownlinkComponentBase ::
1287 pingOut_out(
1288 NATIVE_INT_TYPE portNum,
1289 U32 key
1290 )
1291 {
1292 FW_ASSERT(
1293 portNum < this->getNum_pingOut_OutputPorts(),
1294 static_cast<FwAssertArgType>(portNum)
1295 );
1296 this->m_pingOut_OutputPort[portNum].invoke(
1297 key
1298 );
1299 }
1300
1301 // ----------------------------------------------------------------------
1302 // Command response
1303 // ----------------------------------------------------------------------
1304
1305 void FileDownlinkComponentBase ::
1306 cmdResponse_out(
1307 FwOpcodeType opCode,
1308 U32 cmdSeq,
1309 Fw::CmdResponse response
1310 )
1311 {
1312 FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
1313 this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
1314 }
1315
1316 // ----------------------------------------------------------------------
1317 // Command handler base-class functions
1318 //
1319 // Call these functions directly to bypass the command input port
1320 // ----------------------------------------------------------------------
1321
1322 void FileDownlinkComponentBase ::
1323 SendFile_cmdHandlerBase(
1324 FwOpcodeType opCode,
1325 U32 cmdSeq,
1326 Fw::CmdArgBuffer& args
1327 )
1328 {
1329 // Call pre-message hook
1330 this->SendFile_preMsgHook(opCode,cmdSeq);
1331
1332 // Defer deserializing arguments to the message dispatcher
1333 // to avoid deserializing and reserializing just for IPC
1334 ComponentIpcSerializableBuffer msg;
1336
1337 // Serialize for IPC
1338 _status = msg.serialize(static_cast<NATIVE_INT_TYPE>(CMD_SENDFILE));
1339 FW_ASSERT (
1340 _status == Fw::FW_SERIALIZE_OK,
1341 static_cast<FwAssertArgType>(_status)
1342 );
1343
1344 // Fake port number to make message dequeue work
1345 NATIVE_INT_TYPE port = 0;
1346
1347 _status = msg.serialize(port);
1348 FW_ASSERT (
1349 _status == Fw::FW_SERIALIZE_OK,
1350 static_cast<FwAssertArgType>(_status)
1351 );
1352
1353 _status = msg.serialize(opCode);
1354 FW_ASSERT (
1355 _status == Fw::FW_SERIALIZE_OK,
1356 static_cast<FwAssertArgType>(_status)
1357 );
1358
1359 _status = msg.serialize(cmdSeq);
1360 FW_ASSERT (
1361 _status == Fw::FW_SERIALIZE_OK,
1362 static_cast<FwAssertArgType>(_status)
1363 );
1364
1365 _status = msg.serialize(args);
1366 FW_ASSERT (
1367 _status == Fw::FW_SERIALIZE_OK,
1368 static_cast<FwAssertArgType>(_status)
1369 );
1370
1371 // Send message
1373 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1374
1375 FW_ASSERT(
1376 qStatus == Os::Queue::QUEUE_OK,
1377 static_cast<FwAssertArgType>(qStatus)
1378 );
1379 }
1380
1381 void FileDownlinkComponentBase ::
1382 Cancel_cmdHandlerBase(
1383 FwOpcodeType opCode,
1384 U32 cmdSeq,
1385 Fw::CmdArgBuffer& args
1386 )
1387 {
1388 // Call pre-message hook
1389 this->Cancel_preMsgHook(opCode,cmdSeq);
1390
1391 // Defer deserializing arguments to the message dispatcher
1392 // to avoid deserializing and reserializing just for IPC
1393 ComponentIpcSerializableBuffer msg;
1395
1396 // Serialize for IPC
1397 _status = msg.serialize(static_cast<NATIVE_INT_TYPE>(CMD_CANCEL));
1398 FW_ASSERT (
1399 _status == Fw::FW_SERIALIZE_OK,
1400 static_cast<FwAssertArgType>(_status)
1401 );
1402
1403 // Fake port number to make message dequeue work
1404 NATIVE_INT_TYPE port = 0;
1405
1406 _status = msg.serialize(port);
1407 FW_ASSERT (
1408 _status == Fw::FW_SERIALIZE_OK,
1409 static_cast<FwAssertArgType>(_status)
1410 );
1411
1412 _status = msg.serialize(opCode);
1413 FW_ASSERT (
1414 _status == Fw::FW_SERIALIZE_OK,
1415 static_cast<FwAssertArgType>(_status)
1416 );
1417
1418 _status = msg.serialize(cmdSeq);
1419 FW_ASSERT (
1420 _status == Fw::FW_SERIALIZE_OK,
1421 static_cast<FwAssertArgType>(_status)
1422 );
1423
1424 _status = msg.serialize(args);
1425 FW_ASSERT (
1426 _status == Fw::FW_SERIALIZE_OK,
1427 static_cast<FwAssertArgType>(_status)
1428 );
1429
1430 // Send message
1432 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1433
1434 FW_ASSERT(
1435 qStatus == Os::Queue::QUEUE_OK,
1436 static_cast<FwAssertArgType>(qStatus)
1437 );
1438 }
1439
1440 void FileDownlinkComponentBase ::
1441 SendPartial_cmdHandlerBase(
1442 FwOpcodeType opCode,
1443 U32 cmdSeq,
1444 Fw::CmdArgBuffer& args
1445 )
1446 {
1447 // Call pre-message hook
1448 this->SendPartial_preMsgHook(opCode,cmdSeq);
1449
1450 // Defer deserializing arguments to the message dispatcher
1451 // to avoid deserializing and reserializing just for IPC
1452 ComponentIpcSerializableBuffer msg;
1454
1455 // Serialize for IPC
1456 _status = msg.serialize(static_cast<NATIVE_INT_TYPE>(CMD_SENDPARTIAL));
1457 FW_ASSERT (
1458 _status == Fw::FW_SERIALIZE_OK,
1459 static_cast<FwAssertArgType>(_status)
1460 );
1461
1462 // Fake port number to make message dequeue work
1463 NATIVE_INT_TYPE port = 0;
1464
1465 _status = msg.serialize(port);
1466 FW_ASSERT (
1467 _status == Fw::FW_SERIALIZE_OK,
1468 static_cast<FwAssertArgType>(_status)
1469 );
1470
1471 _status = msg.serialize(opCode);
1472 FW_ASSERT (
1473 _status == Fw::FW_SERIALIZE_OK,
1474 static_cast<FwAssertArgType>(_status)
1475 );
1476
1477 _status = msg.serialize(cmdSeq);
1478 FW_ASSERT (
1479 _status == Fw::FW_SERIALIZE_OK,
1480 static_cast<FwAssertArgType>(_status)
1481 );
1482
1483 _status = msg.serialize(args);
1484 FW_ASSERT (
1485 _status == Fw::FW_SERIALIZE_OK,
1486 static_cast<FwAssertArgType>(_status)
1487 );
1488
1489 // Send message
1491 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1492
1493 FW_ASSERT(
1494 qStatus == Os::Queue::QUEUE_OK,
1495 static_cast<FwAssertArgType>(qStatus)
1496 );
1497 }
1498
1499 // ----------------------------------------------------------------------
1500 // Pre-message hooks for async commands
1501 //
1502 // Each of these functions is invoked just before processing the
1503 // corresponding command. By default they do nothing. You can
1504 // override them to provide specific pre-command behavior.
1505 // ----------------------------------------------------------------------
1506
1507 void FileDownlinkComponentBase ::
1508 SendFile_preMsgHook(
1509 FwOpcodeType opCode,
1510 U32 cmdSeq
1511 )
1512 {
1513 // Defaults to no-op; can be overridden
1514 }
1515
1516 void FileDownlinkComponentBase ::
1517 Cancel_preMsgHook(
1518 FwOpcodeType opCode,
1519 U32 cmdSeq
1520 )
1521 {
1522 // Defaults to no-op; can be overridden
1523 }
1524
1525 void FileDownlinkComponentBase ::
1526 SendPartial_preMsgHook(
1527 FwOpcodeType opCode,
1528 U32 cmdSeq
1529 )
1530 {
1531 // Defaults to no-op; can be overridden
1532 }
1533
1534 // ----------------------------------------------------------------------
1535 // Event logging functions
1536 // ----------------------------------------------------------------------
1537
1538 void FileDownlinkComponentBase ::
1539 log_WARNING_HI_FileOpenError(const Fw::LogStringArg& fileName)
1540 {
1541 // Get the time
1542 Fw::Time _logTime;
1543 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1544 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1545 }
1546
1547 FwEventIdType _id = static_cast<FwEventIdType>(0);
1548
1549 _id = this->getIdBase() + EVENTID_FILEOPENERROR;
1550
1551 // Emit the event on the log port
1552 if (this->m_eventOut_OutputPort[0].isConnected()) {
1553 Fw::LogBuffer _logBuff;
1555
1556#if FW_AMPCS_COMPATIBLE
1557 // Serialize the number of arguments
1558 _status = _logBuff.serialize(static_cast<U8>(1));
1559 FW_ASSERT(
1560 _status == Fw::FW_SERIALIZE_OK,
1561 static_cast<FwAssertArgType>(_status)
1562 );
1563#endif
1564
1565 _status = fileName.serialize(_logBuff, 100);
1566 FW_ASSERT(
1567 _status == Fw::FW_SERIALIZE_OK,
1568 static_cast<FwAssertArgType>(_status)
1569 );
1570
1571 this->m_eventOut_OutputPort[0].invoke(
1572 _id,
1573 _logTime,
1575 _logBuff
1576 );
1577 }
1578
1579 // Emit the event on the text log port
1580#if FW_ENABLE_TEXT_LOGGING
1581 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1582#if FW_OBJECT_NAMES == 1
1583 const char* _formatString =
1584 "(%s) %s: Could not open file %s";
1585#else
1586 const char* _formatString =
1587 "%s: Could not open file %s";
1588#endif
1589
1590 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1591
1592 (void) snprintf(
1593 _textBuffer,
1595 _formatString,
1596#if FW_OBJECT_NAMES == 1
1597 this->m_objName,
1598#endif
1599 "FileOpenError ",
1600 fileName.toChar()
1601 );
1602
1603 // Null terminate
1604 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1605 Fw::TextLogString _logString = _textBuffer;
1606 this->m_textEventOut_OutputPort[0].invoke(
1607 _id,
1608 _logTime,
1610 _logString
1611 );
1612 }
1613#endif
1614 }
1615
1616 void FileDownlinkComponentBase ::
1617 log_WARNING_HI_FileReadError(
1618 const Fw::LogStringArg& fileName,
1619 I32 status
1620 )
1621 {
1622 // Get the time
1623 Fw::Time _logTime;
1624 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1625 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1626 }
1627
1628 FwEventIdType _id = static_cast<FwEventIdType>(0);
1629
1630 _id = this->getIdBase() + EVENTID_FILEREADERROR;
1631
1632 // Emit the event on the log port
1633 if (this->m_eventOut_OutputPort[0].isConnected()) {
1634 Fw::LogBuffer _logBuff;
1636
1637#if FW_AMPCS_COMPATIBLE
1638 // Serialize the number of arguments
1639 _status = _logBuff.serialize(static_cast<U8>(2));
1640 FW_ASSERT(
1641 _status == Fw::FW_SERIALIZE_OK,
1642 static_cast<FwAssertArgType>(_status)
1643 );
1644#endif
1645
1646 _status = fileName.serialize(_logBuff, 100);
1647 FW_ASSERT(
1648 _status == Fw::FW_SERIALIZE_OK,
1649 static_cast<FwAssertArgType>(_status)
1650 );
1651
1652#if FW_AMPCS_COMPATIBLE
1653 // Serialize the argument size
1654 _status = _logBuff.serialize(
1655 static_cast<U8>(sizeof(I32))
1656 );
1657 FW_ASSERT(
1658 _status == Fw::FW_SERIALIZE_OK,
1659 static_cast<FwAssertArgType>(_status)
1660 );
1661#endif
1662 _status = _logBuff.serialize(status);
1663 FW_ASSERT(
1664 _status == Fw::FW_SERIALIZE_OK,
1665 static_cast<FwAssertArgType>(_status)
1666 );
1667
1668 this->m_eventOut_OutputPort[0].invoke(
1669 _id,
1670 _logTime,
1672 _logBuff
1673 );
1674 }
1675
1676 // Emit the event on the text log port
1677#if FW_ENABLE_TEXT_LOGGING
1678 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1679#if FW_OBJECT_NAMES == 1
1680 const char* _formatString =
1681 "(%s) %s: Could not read file %s with status %" PRIi32 "";
1682#else
1683 const char* _formatString =
1684 "%s: Could not read file %s with status %" PRIi32 "";
1685#endif
1686
1687 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1688
1689 (void) snprintf(
1690 _textBuffer,
1692 _formatString,
1693#if FW_OBJECT_NAMES == 1
1694 this->m_objName,
1695#endif
1696 "FileReadError ",
1697 fileName.toChar(),
1698 status
1699 );
1700
1701 // Null terminate
1702 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1703 Fw::TextLogString _logString = _textBuffer;
1704 this->m_textEventOut_OutputPort[0].invoke(
1705 _id,
1706 _logTime,
1708 _logString
1709 );
1710 }
1711#endif
1712 }
1713
1714 void FileDownlinkComponentBase ::
1715 log_ACTIVITY_HI_FileSent(
1716 const Fw::LogStringArg& sourceFileName,
1717 const Fw::LogStringArg& destFileName
1718 )
1719 {
1720 // Get the time
1721 Fw::Time _logTime;
1722 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1723 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1724 }
1725
1726 FwEventIdType _id = static_cast<FwEventIdType>(0);
1727
1728 _id = this->getIdBase() + EVENTID_FILESENT;
1729
1730 // Emit the event on the log port
1731 if (this->m_eventOut_OutputPort[0].isConnected()) {
1732 Fw::LogBuffer _logBuff;
1734
1735#if FW_AMPCS_COMPATIBLE
1736 // Serialize the number of arguments
1737 _status = _logBuff.serialize(static_cast<U8>(2));
1738 FW_ASSERT(
1739 _status == Fw::FW_SERIALIZE_OK,
1740 static_cast<FwAssertArgType>(_status)
1741 );
1742#endif
1743
1744 _status = sourceFileName.serialize(_logBuff, 100);
1745 FW_ASSERT(
1746 _status == Fw::FW_SERIALIZE_OK,
1747 static_cast<FwAssertArgType>(_status)
1748 );
1749
1750 _status = destFileName.serialize(_logBuff, 100);
1751 FW_ASSERT(
1752 _status == Fw::FW_SERIALIZE_OK,
1753 static_cast<FwAssertArgType>(_status)
1754 );
1755
1756 this->m_eventOut_OutputPort[0].invoke(
1757 _id,
1758 _logTime,
1760 _logBuff
1761 );
1762 }
1763
1764 // Emit the event on the text log port
1765#if FW_ENABLE_TEXT_LOGGING
1766 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1767#if FW_OBJECT_NAMES == 1
1768 const char* _formatString =
1769 "(%s) %s: Sent file %s to file %s";
1770#else
1771 const char* _formatString =
1772 "%s: Sent file %s to file %s";
1773#endif
1774
1775 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1776
1777 (void) snprintf(
1778 _textBuffer,
1780 _formatString,
1781#if FW_OBJECT_NAMES == 1
1782 this->m_objName,
1783#endif
1784 "FileSent ",
1785 sourceFileName.toChar(),
1786 destFileName.toChar()
1787 );
1788
1789 // Null terminate
1790 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1791 Fw::TextLogString _logString = _textBuffer;
1792 this->m_textEventOut_OutputPort[0].invoke(
1793 _id,
1794 _logTime,
1796 _logString
1797 );
1798 }
1799#endif
1800 }
1801
1802 void FileDownlinkComponentBase ::
1803 log_ACTIVITY_HI_DownlinkCanceled(
1804 const Fw::LogStringArg& sourceFileName,
1805 const Fw::LogStringArg& destFileName
1806 )
1807 {
1808 // Get the time
1809 Fw::Time _logTime;
1810 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1811 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1812 }
1813
1814 FwEventIdType _id = static_cast<FwEventIdType>(0);
1815
1816 _id = this->getIdBase() + EVENTID_DOWNLINKCANCELED;
1817
1818 // Emit the event on the log port
1819 if (this->m_eventOut_OutputPort[0].isConnected()) {
1820 Fw::LogBuffer _logBuff;
1822
1823#if FW_AMPCS_COMPATIBLE
1824 // Serialize the number of arguments
1825 _status = _logBuff.serialize(static_cast<U8>(2));
1826 FW_ASSERT(
1827 _status == Fw::FW_SERIALIZE_OK,
1828 static_cast<FwAssertArgType>(_status)
1829 );
1830#endif
1831
1832 _status = sourceFileName.serialize(_logBuff, 100);
1833 FW_ASSERT(
1834 _status == Fw::FW_SERIALIZE_OK,
1835 static_cast<FwAssertArgType>(_status)
1836 );
1837
1838 _status = destFileName.serialize(_logBuff, 100);
1839 FW_ASSERT(
1840 _status == Fw::FW_SERIALIZE_OK,
1841 static_cast<FwAssertArgType>(_status)
1842 );
1843
1844 this->m_eventOut_OutputPort[0].invoke(
1845 _id,
1846 _logTime,
1848 _logBuff
1849 );
1850 }
1851
1852 // Emit the event on the text log port
1853#if FW_ENABLE_TEXT_LOGGING
1854 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1855#if FW_OBJECT_NAMES == 1
1856 const char* _formatString =
1857 "(%s) %s: Canceled downlink of file %s to file %s";
1858#else
1859 const char* _formatString =
1860 "%s: Canceled downlink of file %s to file %s";
1861#endif
1862
1863 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1864
1865 (void) snprintf(
1866 _textBuffer,
1868 _formatString,
1869#if FW_OBJECT_NAMES == 1
1870 this->m_objName,
1871#endif
1872 "DownlinkCanceled ",
1873 sourceFileName.toChar(),
1874 destFileName.toChar()
1875 );
1876
1877 // Null terminate
1878 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1879 Fw::TextLogString _logString = _textBuffer;
1880 this->m_textEventOut_OutputPort[0].invoke(
1881 _id,
1882 _logTime,
1884 _logString
1885 );
1886 }
1887#endif
1888 }
1889
1890 void FileDownlinkComponentBase ::
1891 log_WARNING_HI_DownlinkTimeout(
1892 const Fw::LogStringArg& sourceFileName,
1893 const Fw::LogStringArg& destFileName
1894 )
1895 {
1896 // Get the time
1897 Fw::Time _logTime;
1898 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1899 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1900 }
1901
1902 FwEventIdType _id = static_cast<FwEventIdType>(0);
1903
1904 _id = this->getIdBase() + EVENTID_DOWNLINKTIMEOUT;
1905
1906 // Emit the event on the log port
1907 if (this->m_eventOut_OutputPort[0].isConnected()) {
1908 Fw::LogBuffer _logBuff;
1910
1911#if FW_AMPCS_COMPATIBLE
1912 // Serialize the number of arguments
1913 _status = _logBuff.serialize(static_cast<U8>(2));
1914 FW_ASSERT(
1915 _status == Fw::FW_SERIALIZE_OK,
1916 static_cast<FwAssertArgType>(_status)
1917 );
1918#endif
1919
1920 _status = sourceFileName.serialize(_logBuff, 100);
1921 FW_ASSERT(
1922 _status == Fw::FW_SERIALIZE_OK,
1923 static_cast<FwAssertArgType>(_status)
1924 );
1925
1926 _status = destFileName.serialize(_logBuff, 100);
1927 FW_ASSERT(
1928 _status == Fw::FW_SERIALIZE_OK,
1929 static_cast<FwAssertArgType>(_status)
1930 );
1931
1932 this->m_eventOut_OutputPort[0].invoke(
1933 _id,
1934 _logTime,
1936 _logBuff
1937 );
1938 }
1939
1940 // Emit the event on the text log port
1941#if FW_ENABLE_TEXT_LOGGING
1942 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1943#if FW_OBJECT_NAMES == 1
1944 const char* _formatString =
1945 "(%s) %s: Timeout occurred during downlink of file %s to file %s. Downlink has been canceled.";
1946#else
1947 const char* _formatString =
1948 "%s: Timeout occurred during downlink of file %s to file %s. Downlink has been canceled.";
1949#endif
1950
1951 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1952
1953 (void) snprintf(
1954 _textBuffer,
1956 _formatString,
1957#if FW_OBJECT_NAMES == 1
1958 this->m_objName,
1959#endif
1960 "DownlinkTimeout ",
1961 sourceFileName.toChar(),
1962 destFileName.toChar()
1963 );
1964
1965 // Null terminate
1966 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1967 Fw::TextLogString _logString = _textBuffer;
1968 this->m_textEventOut_OutputPort[0].invoke(
1969 _id,
1970 _logTime,
1972 _logString
1973 );
1974 }
1975#endif
1976 }
1977
1978 void FileDownlinkComponentBase ::
1979 log_WARNING_LO_DownlinkPartialWarning(
1980 U32 startOffset,
1981 U32 length,
1982 U32 filesize,
1983 const Fw::LogStringArg& sourceFileName,
1984 const Fw::LogStringArg& destFileName
1985 )
1986 {
1987 // Get the time
1988 Fw::Time _logTime;
1989 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1990 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1991 }
1992
1993 FwEventIdType _id = static_cast<FwEventIdType>(0);
1994
1995 _id = this->getIdBase() + EVENTID_DOWNLINKPARTIALWARNING;
1996
1997 // Emit the event on the log port
1998 if (this->m_eventOut_OutputPort[0].isConnected()) {
1999 Fw::LogBuffer _logBuff;
2001
2002#if FW_AMPCS_COMPATIBLE
2003 // Serialize the number of arguments
2004 _status = _logBuff.serialize(static_cast<U8>(5));
2005 FW_ASSERT(
2006 _status == Fw::FW_SERIALIZE_OK,
2007 static_cast<FwAssertArgType>(_status)
2008 );
2009#endif
2010
2011#if FW_AMPCS_COMPATIBLE
2012 // Serialize the argument size
2013 _status = _logBuff.serialize(
2014 static_cast<U8>(sizeof(U32))
2015 );
2016 FW_ASSERT(
2017 _status == Fw::FW_SERIALIZE_OK,
2018 static_cast<FwAssertArgType>(_status)
2019 );
2020#endif
2021 _status = _logBuff.serialize(startOffset);
2022 FW_ASSERT(
2023 _status == Fw::FW_SERIALIZE_OK,
2024 static_cast<FwAssertArgType>(_status)
2025 );
2026
2027#if FW_AMPCS_COMPATIBLE
2028 // Serialize the argument size
2029 _status = _logBuff.serialize(
2030 static_cast<U8>(sizeof(U32))
2031 );
2032 FW_ASSERT(
2033 _status == Fw::FW_SERIALIZE_OK,
2034 static_cast<FwAssertArgType>(_status)
2035 );
2036#endif
2037 _status = _logBuff.serialize(length);
2038 FW_ASSERT(
2039 _status == Fw::FW_SERIALIZE_OK,
2040 static_cast<FwAssertArgType>(_status)
2041 );
2042
2043#if FW_AMPCS_COMPATIBLE
2044 // Serialize the argument size
2045 _status = _logBuff.serialize(
2046 static_cast<U8>(sizeof(U32))
2047 );
2048 FW_ASSERT(
2049 _status == Fw::FW_SERIALIZE_OK,
2050 static_cast<FwAssertArgType>(_status)
2051 );
2052#endif
2053 _status = _logBuff.serialize(filesize);
2054 FW_ASSERT(
2055 _status == Fw::FW_SERIALIZE_OK,
2056 static_cast<FwAssertArgType>(_status)
2057 );
2058
2059 _status = sourceFileName.serialize(_logBuff, 100);
2060 FW_ASSERT(
2061 _status == Fw::FW_SERIALIZE_OK,
2062 static_cast<FwAssertArgType>(_status)
2063 );
2064
2065 _status = destFileName.serialize(_logBuff, 100);
2066 FW_ASSERT(
2067 _status == Fw::FW_SERIALIZE_OK,
2068 static_cast<FwAssertArgType>(_status)
2069 );
2070
2071 this->m_eventOut_OutputPort[0].invoke(
2072 _id,
2073 _logTime,
2075 _logBuff
2076 );
2077 }
2078
2079 // Emit the event on the text log port
2080#if FW_ENABLE_TEXT_LOGGING
2081 if (this->m_textEventOut_OutputPort[0].isConnected()) {
2082#if FW_OBJECT_NAMES == 1
2083 const char* _formatString =
2084 "(%s) %s: Offset %" PRIu32 " plus length %" PRIu32 " is greater than source size %" PRIu32 " for partial downlink of file %s to file %s. ";
2085#else
2086 const char* _formatString =
2087 "%s: Offset %" PRIu32 " plus length %" PRIu32 " is greater than source size %" PRIu32 " for partial downlink of file %s to file %s. ";
2088#endif
2089
2090 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2091
2092 (void) snprintf(
2093 _textBuffer,
2095 _formatString,
2096#if FW_OBJECT_NAMES == 1
2097 this->m_objName,
2098#endif
2099 "DownlinkPartialWarning ",
2100 startOffset,
2101 length,
2102 filesize,
2103 sourceFileName.toChar(),
2104 destFileName.toChar()
2105 );
2106
2107 // Null terminate
2108 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2109 Fw::TextLogString _logString = _textBuffer;
2110 this->m_textEventOut_OutputPort[0].invoke(
2111 _id,
2112 _logTime,
2114 _logString
2115 );
2116 }
2117#endif
2118 }
2119
2120 void FileDownlinkComponentBase ::
2121 log_WARNING_HI_DownlinkPartialFail(
2122 const Fw::LogStringArg& sourceFileName,
2123 const Fw::LogStringArg& destFileName,
2124 U32 startOffset,
2125 U32 filesize
2126 )
2127 {
2128 // Get the time
2129 Fw::Time _logTime;
2130 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2131 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2132 }
2133
2134 FwEventIdType _id = static_cast<FwEventIdType>(0);
2135
2136 _id = this->getIdBase() + EVENTID_DOWNLINKPARTIALFAIL;
2137
2138 // Emit the event on the log port
2139 if (this->m_eventOut_OutputPort[0].isConnected()) {
2140 Fw::LogBuffer _logBuff;
2142
2143#if FW_AMPCS_COMPATIBLE
2144 // Serialize the number of arguments
2145 _status = _logBuff.serialize(static_cast<U8>(4));
2146 FW_ASSERT(
2147 _status == Fw::FW_SERIALIZE_OK,
2148 static_cast<FwAssertArgType>(_status)
2149 );
2150#endif
2151
2152 _status = sourceFileName.serialize(_logBuff, 100);
2153 FW_ASSERT(
2154 _status == Fw::FW_SERIALIZE_OK,
2155 static_cast<FwAssertArgType>(_status)
2156 );
2157
2158 _status = destFileName.serialize(_logBuff, 100);
2159 FW_ASSERT(
2160 _status == Fw::FW_SERIALIZE_OK,
2161 static_cast<FwAssertArgType>(_status)
2162 );
2163
2164#if FW_AMPCS_COMPATIBLE
2165 // Serialize the argument size
2166 _status = _logBuff.serialize(
2167 static_cast<U8>(sizeof(U32))
2168 );
2169 FW_ASSERT(
2170 _status == Fw::FW_SERIALIZE_OK,
2171 static_cast<FwAssertArgType>(_status)
2172 );
2173#endif
2174 _status = _logBuff.serialize(startOffset);
2175 FW_ASSERT(
2176 _status == Fw::FW_SERIALIZE_OK,
2177 static_cast<FwAssertArgType>(_status)
2178 );
2179
2180#if FW_AMPCS_COMPATIBLE
2181 // Serialize the argument size
2182 _status = _logBuff.serialize(
2183 static_cast<U8>(sizeof(U32))
2184 );
2185 FW_ASSERT(
2186 _status == Fw::FW_SERIALIZE_OK,
2187 static_cast<FwAssertArgType>(_status)
2188 );
2189#endif
2190 _status = _logBuff.serialize(filesize);
2191 FW_ASSERT(
2192 _status == Fw::FW_SERIALIZE_OK,
2193 static_cast<FwAssertArgType>(_status)
2194 );
2195
2196 this->m_eventOut_OutputPort[0].invoke(
2197 _id,
2198 _logTime,
2200 _logBuff
2201 );
2202 }
2203
2204 // Emit the event on the text log port
2205#if FW_ENABLE_TEXT_LOGGING
2206 if (this->m_textEventOut_OutputPort[0].isConnected()) {
2207#if FW_OBJECT_NAMES == 1
2208 const char* _formatString =
2209 "(%s) %s: Error occurred during partial downlink of file %s to file %s. Offset %" PRIu32 " greater than or equal to source filesize %" PRIu32 ".";
2210#else
2211 const char* _formatString =
2212 "%s: Error occurred during partial downlink of file %s to file %s. Offset %" PRIu32 " greater than or equal to source filesize %" PRIu32 ".";
2213#endif
2214
2215 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2216
2217 (void) snprintf(
2218 _textBuffer,
2220 _formatString,
2221#if FW_OBJECT_NAMES == 1
2222 this->m_objName,
2223#endif
2224 "DownlinkPartialFail ",
2225 sourceFileName.toChar(),
2226 destFileName.toChar(),
2227 startOffset,
2228 filesize
2229 );
2230
2231 // Null terminate
2232 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2233 Fw::TextLogString _logString = _textBuffer;
2234 this->m_textEventOut_OutputPort[0].invoke(
2235 _id,
2236 _logTime,
2238 _logString
2239 );
2240 }
2241#endif
2242 }
2243
2244 void FileDownlinkComponentBase ::
2245 log_WARNING_HI_SendDataFail(
2246 const Fw::LogStringArg& sourceFileName,
2247 U32 byteOffset
2248 )
2249 {
2250 // Get the time
2251 Fw::Time _logTime;
2252 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2253 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2254 }
2255
2256 FwEventIdType _id = static_cast<FwEventIdType>(0);
2257
2258 _id = this->getIdBase() + EVENTID_SENDDATAFAIL;
2259
2260 // Emit the event on the log port
2261 if (this->m_eventOut_OutputPort[0].isConnected()) {
2262 Fw::LogBuffer _logBuff;
2264
2265#if FW_AMPCS_COMPATIBLE
2266 // Serialize the number of arguments
2267 _status = _logBuff.serialize(static_cast<U8>(2));
2268 FW_ASSERT(
2269 _status == Fw::FW_SERIALIZE_OK,
2270 static_cast<FwAssertArgType>(_status)
2271 );
2272#endif
2273
2274 _status = sourceFileName.serialize(_logBuff, 100);
2275 FW_ASSERT(
2276 _status == Fw::FW_SERIALIZE_OK,
2277 static_cast<FwAssertArgType>(_status)
2278 );
2279
2280#if FW_AMPCS_COMPATIBLE
2281 // Serialize the argument size
2282 _status = _logBuff.serialize(
2283 static_cast<U8>(sizeof(U32))
2284 );
2285 FW_ASSERT(
2286 _status == Fw::FW_SERIALIZE_OK,
2287 static_cast<FwAssertArgType>(_status)
2288 );
2289#endif
2290 _status = _logBuff.serialize(byteOffset);
2291 FW_ASSERT(
2292 _status == Fw::FW_SERIALIZE_OK,
2293 static_cast<FwAssertArgType>(_status)
2294 );
2295
2296 this->m_eventOut_OutputPort[0].invoke(
2297 _id,
2298 _logTime,
2300 _logBuff
2301 );
2302 }
2303
2304 // Emit the event on the text log port
2305#if FW_ENABLE_TEXT_LOGGING
2306 if (this->m_textEventOut_OutputPort[0].isConnected()) {
2307#if FW_OBJECT_NAMES == 1
2308 const char* _formatString =
2309 "(%s) %s: Failed to send data packet from file %s at byte offset %" PRIu32 ".";
2310#else
2311 const char* _formatString =
2312 "%s: Failed to send data packet from file %s at byte offset %" PRIu32 ".";
2313#endif
2314
2315 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2316
2317 (void) snprintf(
2318 _textBuffer,
2320 _formatString,
2321#if FW_OBJECT_NAMES == 1
2322 this->m_objName,
2323#endif
2324 "SendDataFail ",
2325 sourceFileName.toChar(),
2326 byteOffset
2327 );
2328
2329 // Null terminate
2330 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2331 Fw::TextLogString _logString = _textBuffer;
2332 this->m_textEventOut_OutputPort[0].invoke(
2333 _id,
2334 _logTime,
2336 _logString
2337 );
2338 }
2339#endif
2340 }
2341
2342 void FileDownlinkComponentBase ::
2343 log_ACTIVITY_HI_SendStarted(
2344 U32 fileSize,
2345 const Fw::LogStringArg& sourceFileName,
2346 const Fw::LogStringArg& destFileName
2347 )
2348 {
2349 // Get the time
2350 Fw::Time _logTime;
2351 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2352 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2353 }
2354
2355 FwEventIdType _id = static_cast<FwEventIdType>(0);
2356
2357 _id = this->getIdBase() + EVENTID_SENDSTARTED;
2358
2359 // Emit the event on the log port
2360 if (this->m_eventOut_OutputPort[0].isConnected()) {
2361 Fw::LogBuffer _logBuff;
2363
2364#if FW_AMPCS_COMPATIBLE
2365 // Serialize the number of arguments
2366 _status = _logBuff.serialize(static_cast<U8>(3));
2367 FW_ASSERT(
2368 _status == Fw::FW_SERIALIZE_OK,
2369 static_cast<FwAssertArgType>(_status)
2370 );
2371#endif
2372
2373#if FW_AMPCS_COMPATIBLE
2374 // Serialize the argument size
2375 _status = _logBuff.serialize(
2376 static_cast<U8>(sizeof(U32))
2377 );
2378 FW_ASSERT(
2379 _status == Fw::FW_SERIALIZE_OK,
2380 static_cast<FwAssertArgType>(_status)
2381 );
2382#endif
2383 _status = _logBuff.serialize(fileSize);
2384 FW_ASSERT(
2385 _status == Fw::FW_SERIALIZE_OK,
2386 static_cast<FwAssertArgType>(_status)
2387 );
2388
2389 _status = sourceFileName.serialize(_logBuff, 100);
2390 FW_ASSERT(
2391 _status == Fw::FW_SERIALIZE_OK,
2392 static_cast<FwAssertArgType>(_status)
2393 );
2394
2395 _status = destFileName.serialize(_logBuff, 100);
2396 FW_ASSERT(
2397 _status == Fw::FW_SERIALIZE_OK,
2398 static_cast<FwAssertArgType>(_status)
2399 );
2400
2401 this->m_eventOut_OutputPort[0].invoke(
2402 _id,
2403 _logTime,
2405 _logBuff
2406 );
2407 }
2408
2409 // Emit the event on the text log port
2410#if FW_ENABLE_TEXT_LOGGING
2411 if (this->m_textEventOut_OutputPort[0].isConnected()) {
2412#if FW_OBJECT_NAMES == 1
2413 const char* _formatString =
2414 "(%s) %s: Downlink of %" PRIu32 " bytes started from %s to %s";
2415#else
2416 const char* _formatString =
2417 "%s: Downlink of %" PRIu32 " bytes started from %s to %s";
2418#endif
2419
2420 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2421
2422 (void) snprintf(
2423 _textBuffer,
2425 _formatString,
2426#if FW_OBJECT_NAMES == 1
2427 this->m_objName,
2428#endif
2429 "SendStarted ",
2430 fileSize,
2431 sourceFileName.toChar(),
2432 destFileName.toChar()
2433 );
2434
2435 // Null terminate
2436 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2437 Fw::TextLogString _logString = _textBuffer;
2438 this->m_textEventOut_OutputPort[0].invoke(
2439 _id,
2440 _logTime,
2442 _logString
2443 );
2444 }
2445#endif
2446 }
2447
2448 // ----------------------------------------------------------------------
2449 // Telemetry write functions
2450 // ----------------------------------------------------------------------
2451
2452 void FileDownlinkComponentBase ::
2453 tlmWrite_FilesSent(
2454 U32 arg,
2455 Fw::Time _tlmTime
2456 )
2457 {
2458 if (this->m_tlmOut_OutputPort[0].isConnected()) {
2459 if (
2460 this->m_timeCaller_OutputPort[0].isConnected() &&
2461 (_tlmTime == Fw::ZERO_TIME)
2462 ) {
2463 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
2464 }
2465
2466 Fw::TlmBuffer _tlmBuff;
2467 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
2468 FW_ASSERT(
2469 _stat == Fw::FW_SERIALIZE_OK,
2470 static_cast<FwAssertArgType>(_stat)
2471 );
2472
2473 FwChanIdType _id;
2474
2475 _id = this->getIdBase() + CHANNELID_FILESSENT;
2476
2477 this->m_tlmOut_OutputPort[0].invoke(
2478 _id,
2479 _tlmTime,
2480 _tlmBuff
2481 );
2482 }
2483 }
2484
2485 void FileDownlinkComponentBase ::
2486 tlmWrite_PacketsSent(
2487 U32 arg,
2488 Fw::Time _tlmTime
2489 )
2490 {
2491 if (this->m_tlmOut_OutputPort[0].isConnected()) {
2492 if (
2493 this->m_timeCaller_OutputPort[0].isConnected() &&
2494 (_tlmTime == Fw::ZERO_TIME)
2495 ) {
2496 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
2497 }
2498
2499 Fw::TlmBuffer _tlmBuff;
2500 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
2501 FW_ASSERT(
2502 _stat == Fw::FW_SERIALIZE_OK,
2503 static_cast<FwAssertArgType>(_stat)
2504 );
2505
2506 FwChanIdType _id;
2507
2508 _id = this->getIdBase() + CHANNELID_PACKETSSENT;
2509
2510 this->m_tlmOut_OutputPort[0].invoke(
2511 _id,
2512 _tlmTime,
2513 _tlmBuff
2514 );
2515 }
2516 }
2517
2518 void FileDownlinkComponentBase ::
2519 tlmWrite_Warnings(
2520 U32 arg,
2521 Fw::Time _tlmTime
2522 )
2523 {
2524 if (this->m_tlmOut_OutputPort[0].isConnected()) {
2525 if (
2526 this->m_timeCaller_OutputPort[0].isConnected() &&
2527 (_tlmTime == Fw::ZERO_TIME)
2528 ) {
2529 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
2530 }
2531
2532 Fw::TlmBuffer _tlmBuff;
2533 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
2534 FW_ASSERT(
2535 _stat == Fw::FW_SERIALIZE_OK,
2536 static_cast<FwAssertArgType>(_stat)
2537 );
2538
2539 FwChanIdType _id;
2540
2541 _id = this->getIdBase() + CHANNELID_WARNINGS;
2542
2543 this->m_tlmOut_OutputPort[0].invoke(
2544 _id,
2545 _tlmTime,
2546 _tlmBuff
2547 );
2548 }
2549 }
2550
2551 // ----------------------------------------------------------------------
2552 // Time
2553 // ----------------------------------------------------------------------
2554
2555 Fw::Time FileDownlinkComponentBase ::
2556 getTime()
2557 {
2558 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2559 Fw::Time _time;
2560 this->m_timeCaller_OutputPort[0].invoke(_time);
2561 return _time;
2562 }
2563 else {
2564 return Fw::Time(TB_NONE, 0, 0);
2565 }
2566 }
2567
2568 // ----------------------------------------------------------------------
2569 // Mutex operations for guarded ports
2570 //
2571 // You can override these operations to provide more sophisticated
2572 // synchronization
2573 // ----------------------------------------------------------------------
2574
2575 void FileDownlinkComponentBase ::
2576 lock()
2577 {
2578 this->m_guardedPortMutex.lock();
2579 }
2580
2581 void FileDownlinkComponentBase ::
2582 unLock()
2583 {
2584 this->m_guardedPortMutex.unLock();
2585 }
2586
2587 // ----------------------------------------------------------------------
2588 // Message dispatch functions
2589 // ----------------------------------------------------------------------
2590
2591 Fw::QueuedComponentBase::MsgDispatchStatus FileDownlinkComponentBase ::
2592 doDispatch()
2593 {
2594 ComponentIpcSerializableBuffer msg;
2595 NATIVE_INT_TYPE priority = 0;
2596
2597 Os::Queue::QueueStatus msgStatus = this->m_queue.receive(
2598 msg,
2599 priority,
2601 );
2602 FW_ASSERT(
2603 msgStatus == Os::Queue::QUEUE_OK,
2604 static_cast<FwAssertArgType>(msgStatus)
2605 );
2606
2607 // Reset to beginning of buffer
2608 msg.resetDeser();
2609
2610 NATIVE_INT_TYPE desMsg = 0;
2611 Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
2612 FW_ASSERT(
2613 deserStatus == Fw::FW_SERIALIZE_OK,
2614 static_cast<FwAssertArgType>(deserStatus)
2615 );
2616
2617 MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
2618
2619 if (msgType == FILEDOWNLINK_COMPONENT_EXIT) {
2620 return MSG_DISPATCH_EXIT;
2621 }
2622
2623 NATIVE_INT_TYPE portNum = 0;
2624 deserStatus = msg.deserialize(portNum);
2625 FW_ASSERT(
2626 deserStatus == Fw::FW_SERIALIZE_OK,
2627 static_cast<FwAssertArgType>(deserStatus)
2628 );
2629
2630 switch (msgType) {
2631 // Handle async input port Run
2632 case RUN_SCHED: {
2633 // Deserialize argument context
2634 NATIVE_UINT_TYPE context;
2635 deserStatus = msg.deserialize(context);
2636 FW_ASSERT(
2637 deserStatus == Fw::FW_SERIALIZE_OK,
2638 static_cast<FwAssertArgType>(deserStatus)
2639 );
2640 // Call handler function
2641 this->Run_handler(
2642 portNum,
2643 context
2644 );
2645
2646 break;
2647 }
2648
2649 // Handle async input port bufferReturn
2650 case BUFFERRETURN_BUFFERSEND: {
2651 // Deserialize argument fwBuffer
2652 Fw::Buffer fwBuffer;
2653 deserStatus = msg.deserialize(fwBuffer);
2654 FW_ASSERT(
2655 deserStatus == Fw::FW_SERIALIZE_OK,
2656 static_cast<FwAssertArgType>(deserStatus)
2657 );
2658 // Call handler function
2659 this->bufferReturn_handler(
2660 portNum,
2661 fwBuffer
2662 );
2663
2664 break;
2665 }
2666
2667 // Handle async input port pingIn
2668 case PINGIN_PING: {
2669 // Deserialize argument key
2670 U32 key;
2671 deserStatus = msg.deserialize(key);
2672 FW_ASSERT(
2673 deserStatus == Fw::FW_SERIALIZE_OK,
2674 static_cast<FwAssertArgType>(deserStatus)
2675 );
2676 // Call handler function
2677 this->pingIn_handler(
2678 portNum,
2679 key
2680 );
2681
2682 break;
2683 }
2684
2685 // Handle command SendFile
2686 case CMD_SENDFILE: {
2687 // Deserialize opcode
2688 FwOpcodeType opCode = 0;
2689 deserStatus = msg.deserialize(opCode);
2690 FW_ASSERT (
2691 deserStatus == Fw::FW_SERIALIZE_OK,
2692 static_cast<FwAssertArgType>(deserStatus)
2693 );
2694
2695 // Deserialize command sequence
2696 U32 cmdSeq = 0;
2697 deserStatus = msg.deserialize(cmdSeq);
2698 FW_ASSERT (
2699 deserStatus == Fw::FW_SERIALIZE_OK,
2700 static_cast<FwAssertArgType>(deserStatus)
2701 );
2702
2703 // Deserialize command argument buffer
2704 Fw::CmdArgBuffer args;
2705 deserStatus = msg.deserialize(args);
2706 FW_ASSERT (
2707 deserStatus == Fw::FW_SERIALIZE_OK,
2708 static_cast<FwAssertArgType>(deserStatus)
2709 );
2710
2711 // Reset buffer
2712 args.resetDeser();
2713
2714 // Deserialize argument sourceFileName
2715 Fw::CmdStringArg sourceFileName;
2716 deserStatus = args.deserialize(sourceFileName);
2717 if (deserStatus != Fw::FW_SERIALIZE_OK) {
2718 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2719 this->cmdResponse_out(
2720 opCode,
2721 cmdSeq,
2723 );
2724 }
2725 // Don't crash the task if bad arguments were passed from the ground
2726 break;
2727 }
2728
2729 // Deserialize argument destFileName
2730 Fw::CmdStringArg destFileName;
2731 deserStatus = args.deserialize(destFileName);
2732 if (deserStatus != Fw::FW_SERIALIZE_OK) {
2733 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2734 this->cmdResponse_out(
2735 opCode,
2736 cmdSeq,
2738 );
2739 }
2740 // Don't crash the task if bad arguments were passed from the ground
2741 break;
2742 }
2743
2744 // Make sure there was no data left over.
2745 // That means the argument buffer size was incorrect.
2746#if FW_CMD_CHECK_RESIDUAL
2747 if (args.getBuffLeft() != 0) {
2748 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2749 this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2750 }
2751 // Don't crash the task if bad arguments were passed from the ground
2752 break;
2753 }
2754#endif
2755
2756 // Call handler function
2757 this->SendFile_cmdHandler(
2758 opCode, cmdSeq,
2759 sourceFileName,
2760 destFileName
2761 );
2762
2763 break;
2764 }
2765
2766 // Handle command Cancel
2767 case CMD_CANCEL: {
2768 // Deserialize opcode
2769 FwOpcodeType opCode = 0;
2770 deserStatus = msg.deserialize(opCode);
2771 FW_ASSERT (
2772 deserStatus == Fw::FW_SERIALIZE_OK,
2773 static_cast<FwAssertArgType>(deserStatus)
2774 );
2775
2776 // Deserialize command sequence
2777 U32 cmdSeq = 0;
2778 deserStatus = msg.deserialize(cmdSeq);
2779 FW_ASSERT (
2780 deserStatus == Fw::FW_SERIALIZE_OK,
2781 static_cast<FwAssertArgType>(deserStatus)
2782 );
2783
2784 // Deserialize command argument buffer
2785 Fw::CmdArgBuffer args;
2786 deserStatus = msg.deserialize(args);
2787 FW_ASSERT (
2788 deserStatus == Fw::FW_SERIALIZE_OK,
2789 static_cast<FwAssertArgType>(deserStatus)
2790 );
2791
2792 // Reset buffer
2793 args.resetDeser();
2794
2795 // Make sure there was no data left over.
2796 // That means the argument buffer size was incorrect.
2797#if FW_CMD_CHECK_RESIDUAL
2798 if (args.getBuffLeft() != 0) {
2799 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2800 this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2801 }
2802 // Don't crash the task if bad arguments were passed from the ground
2803 break;
2804 }
2805#endif
2806
2807 // Call handler function
2808 this->Cancel_cmdHandler(opCode, cmdSeq);
2809
2810 break;
2811 }
2812
2813 // Handle command SendPartial
2814 case CMD_SENDPARTIAL: {
2815 // Deserialize opcode
2816 FwOpcodeType opCode = 0;
2817 deserStatus = msg.deserialize(opCode);
2818 FW_ASSERT (
2819 deserStatus == Fw::FW_SERIALIZE_OK,
2820 static_cast<FwAssertArgType>(deserStatus)
2821 );
2822
2823 // Deserialize command sequence
2824 U32 cmdSeq = 0;
2825 deserStatus = msg.deserialize(cmdSeq);
2826 FW_ASSERT (
2827 deserStatus == Fw::FW_SERIALIZE_OK,
2828 static_cast<FwAssertArgType>(deserStatus)
2829 );
2830
2831 // Deserialize command argument buffer
2832 Fw::CmdArgBuffer args;
2833 deserStatus = msg.deserialize(args);
2834 FW_ASSERT (
2835 deserStatus == Fw::FW_SERIALIZE_OK,
2836 static_cast<FwAssertArgType>(deserStatus)
2837 );
2838
2839 // Reset buffer
2840 args.resetDeser();
2841
2842 // Deserialize argument sourceFileName
2843 Fw::CmdStringArg sourceFileName;
2844 deserStatus = args.deserialize(sourceFileName);
2845 if (deserStatus != Fw::FW_SERIALIZE_OK) {
2846 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2847 this->cmdResponse_out(
2848 opCode,
2849 cmdSeq,
2851 );
2852 }
2853 // Don't crash the task if bad arguments were passed from the ground
2854 break;
2855 }
2856
2857 // Deserialize argument destFileName
2858 Fw::CmdStringArg destFileName;
2859 deserStatus = args.deserialize(destFileName);
2860 if (deserStatus != Fw::FW_SERIALIZE_OK) {
2861 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2862 this->cmdResponse_out(
2863 opCode,
2864 cmdSeq,
2866 );
2867 }
2868 // Don't crash the task if bad arguments were passed from the ground
2869 break;
2870 }
2871
2872 // Deserialize argument startOffset
2873 U32 startOffset;
2874 deserStatus = args.deserialize(startOffset);
2875 if (deserStatus != Fw::FW_SERIALIZE_OK) {
2876 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2877 this->cmdResponse_out(
2878 opCode,
2879 cmdSeq,
2881 );
2882 }
2883 // Don't crash the task if bad arguments were passed from the ground
2884 break;
2885 }
2886
2887 // Deserialize argument length
2888 U32 length;
2889 deserStatus = args.deserialize(length);
2890 if (deserStatus != Fw::FW_SERIALIZE_OK) {
2891 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2892 this->cmdResponse_out(
2893 opCode,
2894 cmdSeq,
2896 );
2897 }
2898 // Don't crash the task if bad arguments were passed from the ground
2899 break;
2900 }
2901
2902 // Make sure there was no data left over.
2903 // That means the argument buffer size was incorrect.
2904#if FW_CMD_CHECK_RESIDUAL
2905 if (args.getBuffLeft() != 0) {
2906 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2907 this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2908 }
2909 // Don't crash the task if bad arguments were passed from the ground
2910 break;
2911 }
2912#endif
2913
2914 // Call handler function
2915 this->SendPartial_cmdHandler(
2916 opCode, cmdSeq,
2917 sourceFileName,
2918 destFileName,
2919 startOffset,
2920 length
2921 );
2922
2923 break;
2924 }
2925
2926 default:
2927 return MSG_DISPATCH_ERROR;
2928 }
2929
2930 return MSG_DISPATCH_OK;
2931 }
2932
2933 // ----------------------------------------------------------------------
2934 // Calls for messages received on special input ports
2935 // ----------------------------------------------------------------------
2936
2937 void FileDownlinkComponentBase ::
2938 m_p_cmdIn_in(
2939 Fw::PassiveComponentBase* callComp,
2940 NATIVE_INT_TYPE portNum,
2941 FwOpcodeType opCode,
2942 U32 cmdSeq,
2943 Fw::CmdArgBuffer& args
2944 )
2945 {
2946 FW_ASSERT(callComp);
2947 FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
2948
2949 const U32 idBase = callComp->getIdBase();
2950 FW_ASSERT(opCode >= idBase, opCode, idBase);
2951
2952 // Select base class function based on opcode
2953 switch (opCode - idBase) {
2954 case OPCODE_SENDFILE: {
2955 compPtr->SendFile_cmdHandlerBase(
2956 opCode,
2957 cmdSeq,
2958 args
2959 );
2960 break;
2961 }
2962
2963 case OPCODE_CANCEL: {
2964 compPtr->Cancel_cmdHandlerBase(
2965 opCode,
2966 cmdSeq,
2967 args
2968 );
2969 break;
2970 }
2971
2972 case OPCODE_SENDPARTIAL: {
2973 compPtr->SendPartial_cmdHandlerBase(
2974 opCode,
2975 cmdSeq,
2976 args
2977 );
2978 break;
2979 }
2980 }
2981 }
2982
2983 // ----------------------------------------------------------------------
2984 // Calls for messages received on typed input ports
2985 // ----------------------------------------------------------------------
2986
2987 void FileDownlinkComponentBase ::
2988 m_p_Run_in(
2989 Fw::PassiveComponentBase* callComp,
2990 NATIVE_INT_TYPE portNum,
2991 NATIVE_UINT_TYPE context
2992 )
2993 {
2994 FW_ASSERT(callComp);
2995 FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
2996 compPtr->Run_handlerBase(
2997 portNum,
2998 context
2999 );
3000 }
3001
3002 Svc::SendFileResponse FileDownlinkComponentBase ::
3003 m_p_SendFile_in(
3004 Fw::PassiveComponentBase* callComp,
3005 NATIVE_INT_TYPE portNum,
3008 U32 offset,
3009 U32 length
3010 )
3011 {
3012 FW_ASSERT(callComp);
3013 FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
3014 return compPtr->SendFile_handlerBase(
3015 portNum,
3016 sourceFileName,
3017 destFileName,
3018 offset,
3019 length
3020 );
3021 }
3022
3023 void FileDownlinkComponentBase ::
3024 m_p_bufferReturn_in(
3025 Fw::PassiveComponentBase* callComp,
3026 NATIVE_INT_TYPE portNum,
3027 Fw::Buffer& fwBuffer
3028 )
3029 {
3030 FW_ASSERT(callComp);
3031 FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
3032 compPtr->bufferReturn_handlerBase(
3033 portNum,
3034 fwBuffer
3035 );
3036 }
3037
3038 void FileDownlinkComponentBase ::
3039 m_p_pingIn_in(
3040 Fw::PassiveComponentBase* callComp,
3041 NATIVE_INT_TYPE portNum,
3042 U32 key
3043 )
3044 {
3045 FW_ASSERT(callComp);
3046 FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
3047 compPtr->pingIn_handlerBase(
3048 portNum,
3049 key
3050 );
3051 }
3052
3053}
#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
@ TB_NONE
No time base has been established.
Definition FpConfig.h:39
PlatformAssertArgType FwAssertArgType
Definition FpConfig.h:21
U32 FwChanIdType
Definition FpConfig.h:59
U32 FwEventIdType
Definition FpConfig.h:62
U32 FwOpcodeType
Definition FpConfig.h:56
#define FW_LOG_TEXT_BUFFER_SIZE
Max size of string for text log message.
Definition FpConfig.h:291
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
Definition FpConfig.h:82
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
Enum representing a command response.
@ FORMAT_ERROR
Command failed to deserialize.
Input BufferSend port.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition CmdPortAc.hpp:37
@ WARNING_HI
A serious but recoverable event.
@ ACTIVITY_HI
Important informational events.
@ WARNING_LO
A less serious but recoverable event.
const char * toChar() const override
Definition LogString.cpp:49
SerializeStatus serialize(SerializeBufferBase &buffer) const override
serialization function
Definition LogString.cpp:57
void init()
Object initializer.
Definition ObjBase.cpp:27
NATIVE_UINT_TYPE getBuffLeft() const
returns how much deserialization buffer is left
void resetDeser()
reset deserialization to beginning
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
@ QUEUE_OK
message sent/received okay
Definition Queue.hpp:28
QueueBlocking
Definition Queue.hpp:40
@ QUEUE_BLOCKING
Queue receive blocks until a message arrives.
Definition Queue.hpp:41
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
Definition Queue.hpp:42
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
const Time ZERO_TIME
Definition Time.cpp:5