F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
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 "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #endif
13 
14 namespace Svc {
15 
16  namespace {
17  enum MsgTypeEnum {
18  FILEDOWNLINK_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  RUN_SCHED,
20  BUFFERRETURN_BUFFERSEND,
21  PINGIN_PING,
22  CMD_SENDFILE,
23  CMD_CANCEL,
24  CMD_SENDPARTIAL,
25  };
26 
27  // Get the max size by constructing a union of the async input, command, and
28  // internal port serialization sizes
29  union BuffUnion {
31  BYTE bufferReturnPortSize[Fw::BufferSendPortBuffer::CAPACITY];
34  };
35 
36  // Define a message buffer class large enough to handle all the
37  // asynchronous inputs to the component
38  class ComponentIpcSerializableBuffer :
40  {
41 
42  public:
43 
44  enum {
45  // Offset into data in buffer: Size of message ID and port number
46  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
47  // Max data size
48  MAX_DATA_SIZE = sizeof(BuffUnion),
49  // Max message size: Size of message id + size of port + max data size
50  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
51  };
52 
53  ComponentIpcSerializableBuffer() : Fw::LinearBufferBase(m_buff, sizeof(m_buff)) {
54 
55  }
56 
57  private:
58  // Should be the max of all the input ports serialized sizes...
59  U8 m_buff[SERIALIZATION_SIZE];
60 
61  };
62  }
63 
64  // ----------------------------------------------------------------------
65  // Component initialization
66  // ----------------------------------------------------------------------
67 
70  FwSizeType queueDepth,
71  FwEnumStoreType instance
72  )
73  {
74  // Initialize base class
76 
77 #if !FW_DIRECT_PORT_CALLS
78  // Connect input port cmdIn
79  for (
80  FwIndexType port = 0;
81  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
82  port++
83  ) {
84  this->m_cmdIn_InputPort[port].init();
85  this->m_cmdIn_InputPort[port].addCallComp(
86  this,
87  m_p_cmdIn_in
88  );
89  this->m_cmdIn_InputPort[port].setPortNum(port);
90 
91 #if FW_OBJECT_NAMES == 1
92  Fw::ObjectName portName;
93  portName.format(
94  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
95  this->m_objName.toChar(),
96  port
97  );
98  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
99 #endif
100  }
101 #endif
102 
103 #if !FW_DIRECT_PORT_CALLS
104  // Connect input port Run
105  for (
106  FwIndexType port = 0;
107  port < static_cast<FwIndexType>(this->getNum_Run_InputPorts());
108  port++
109  ) {
110  this->m_Run_InputPort[port].init();
111  this->m_Run_InputPort[port].addCallComp(
112  this,
113  m_p_Run_in
114  );
115  this->m_Run_InputPort[port].setPortNum(port);
116 
117 #if FW_OBJECT_NAMES == 1
118  Fw::ObjectName portName;
119  portName.format(
120  "%s_Run_InputPort[%" PRI_FwIndexType "]",
121  this->m_objName.toChar(),
122  port
123  );
124  this->m_Run_InputPort[port].setObjName(portName.toChar());
125 #endif
126  }
127 #endif
128 
129 #if !FW_DIRECT_PORT_CALLS
130  // Connect input port SendFile
131  for (
132  FwIndexType port = 0;
133  port < static_cast<FwIndexType>(this->getNum_SendFile_InputPorts());
134  port++
135  ) {
136  this->m_SendFile_InputPort[port].init();
137  this->m_SendFile_InputPort[port].addCallComp(
138  this,
139  m_p_SendFile_in
140  );
141  this->m_SendFile_InputPort[port].setPortNum(port);
142 
143 #if FW_OBJECT_NAMES == 1
144  Fw::ObjectName portName;
145  portName.format(
146  "%s_SendFile_InputPort[%" PRI_FwIndexType "]",
147  this->m_objName.toChar(),
148  port
149  );
150  this->m_SendFile_InputPort[port].setObjName(portName.toChar());
151 #endif
152  }
153 #endif
154 
155 #if !FW_DIRECT_PORT_CALLS
156  // Connect input port bufferReturn
157  for (
158  FwIndexType port = 0;
159  port < static_cast<FwIndexType>(this->getNum_bufferReturn_InputPorts());
160  port++
161  ) {
162  this->m_bufferReturn_InputPort[port].init();
163  this->m_bufferReturn_InputPort[port].addCallComp(
164  this,
165  m_p_bufferReturn_in
166  );
167  this->m_bufferReturn_InputPort[port].setPortNum(port);
168 
169 #if FW_OBJECT_NAMES == 1
170  Fw::ObjectName portName;
171  portName.format(
172  "%s_bufferReturn_InputPort[%" PRI_FwIndexType "]",
173  this->m_objName.toChar(),
174  port
175  );
176  this->m_bufferReturn_InputPort[port].setObjName(portName.toChar());
177 #endif
178  }
179 #endif
180 
181 #if !FW_DIRECT_PORT_CALLS
182  // Connect input port pingIn
183  for (
184  FwIndexType port = 0;
185  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
186  port++
187  ) {
188  this->m_pingIn_InputPort[port].init();
189  this->m_pingIn_InputPort[port].addCallComp(
190  this,
191  m_p_pingIn_in
192  );
193  this->m_pingIn_InputPort[port].setPortNum(port);
194 
195 #if FW_OBJECT_NAMES == 1
196  Fw::ObjectName portName;
197  portName.format(
198  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
199  this->m_objName.toChar(),
200  port
201  );
202  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
203 #endif
204  }
205 #endif
206 
207 #if !FW_DIRECT_PORT_CALLS
208  // Connect output port cmdRegOut
209  for (
210  FwIndexType port = 0;
211  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
212  port++
213  ) {
214  this->m_cmdRegOut_OutputPort[port].init();
215 
216 #if FW_OBJECT_NAMES == 1
217  Fw::ObjectName portName;
218  portName.format(
219  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
220  this->m_objName.toChar(),
221  port
222  );
223  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
224 #endif
225  }
226 #endif
227 
228 #if !FW_DIRECT_PORT_CALLS
229  // Connect output port cmdResponseOut
230  for (
231  FwIndexType port = 0;
232  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
233  port++
234  ) {
235  this->m_cmdResponseOut_OutputPort[port].init();
236 
237 #if FW_OBJECT_NAMES == 1
238  Fw::ObjectName portName;
239  portName.format(
240  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
241  this->m_objName.toChar(),
242  port
243  );
244  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
245 #endif
246  }
247 #endif
248 
249 #if !FW_DIRECT_PORT_CALLS
250  // Connect output port eventOut
251  for (
252  FwIndexType port = 0;
253  port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
254  port++
255  ) {
256  this->m_eventOut_OutputPort[port].init();
257 
258 #if FW_OBJECT_NAMES == 1
259  Fw::ObjectName portName;
260  portName.format(
261  "%s_eventOut_OutputPort[%" PRI_FwIndexType "]",
262  this->m_objName.toChar(),
263  port
264  );
265  this->m_eventOut_OutputPort[port].setObjName(portName.toChar());
266 #endif
267  }
268 #endif
269 
270 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
271  // Connect output port textEventOut
272  for (
273  FwIndexType port = 0;
274  port < static_cast<FwIndexType>(this->getNum_textEventOut_OutputPorts());
275  port++
276  ) {
277  this->m_textEventOut_OutputPort[port].init();
278 
279 #if FW_OBJECT_NAMES == 1
280  Fw::ObjectName portName;
281  portName.format(
282  "%s_textEventOut_OutputPort[%" PRI_FwIndexType "]",
283  this->m_objName.toChar(),
284  port
285  );
286  this->m_textEventOut_OutputPort[port].setObjName(portName.toChar());
287 #endif
288  }
289 #endif
290 
291 #if !FW_DIRECT_PORT_CALLS
292  // Connect output port timeCaller
293  for (
294  FwIndexType port = 0;
295  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
296  port++
297  ) {
298  this->m_timeCaller_OutputPort[port].init();
299 
300 #if FW_OBJECT_NAMES == 1
301  Fw::ObjectName portName;
302  portName.format(
303  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
304  this->m_objName.toChar(),
305  port
306  );
307  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
308 #endif
309  }
310 #endif
311 
312 #if !FW_DIRECT_PORT_CALLS
313  // Connect output port tlmOut
314  for (
315  FwIndexType port = 0;
316  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
317  port++
318  ) {
319  this->m_tlmOut_OutputPort[port].init();
320 
321 #if FW_OBJECT_NAMES == 1
322  Fw::ObjectName portName;
323  portName.format(
324  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
325  this->m_objName.toChar(),
326  port
327  );
328  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
329 #endif
330  }
331 #endif
332 
333 #if !FW_DIRECT_PORT_CALLS
334  // Connect output port FileComplete
335  for (
336  FwIndexType port = 0;
337  port < static_cast<FwIndexType>(this->getNum_FileComplete_OutputPorts());
338  port++
339  ) {
340  this->m_FileComplete_OutputPort[port].init();
341 
342 #if FW_OBJECT_NAMES == 1
343  Fw::ObjectName portName;
344  portName.format(
345  "%s_FileComplete_OutputPort[%" PRI_FwIndexType "]",
346  this->m_objName.toChar(),
347  port
348  );
349  this->m_FileComplete_OutputPort[port].setObjName(portName.toChar());
350 #endif
351  }
352 #endif
353 
354 #if !FW_DIRECT_PORT_CALLS
355  // Connect output port bufferSendOut
356  for (
357  FwIndexType port = 0;
358  port < static_cast<FwIndexType>(this->getNum_bufferSendOut_OutputPorts());
359  port++
360  ) {
361  this->m_bufferSendOut_OutputPort[port].init();
362 
363 #if FW_OBJECT_NAMES == 1
364  Fw::ObjectName portName;
365  portName.format(
366  "%s_bufferSendOut_OutputPort[%" PRI_FwIndexType "]",
367  this->m_objName.toChar(),
368  port
369  );
370  this->m_bufferSendOut_OutputPort[port].setObjName(portName.toChar());
371 #endif
372  }
373 #endif
374 
375 #if !FW_DIRECT_PORT_CALLS
376  // Connect output port pingOut
377  for (
378  FwIndexType port = 0;
379  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
380  port++
381  ) {
382  this->m_pingOut_OutputPort[port].init();
383 
384 #if FW_OBJECT_NAMES == 1
385  Fw::ObjectName portName;
386  portName.format(
387  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
388  this->m_objName.toChar(),
389  port
390  );
391  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
392 #endif
393  }
394 #endif
395 
396  // Create the queue
397  Os::Queue::Status qStat = this->createQueue(
398  queueDepth,
399  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
400  );
401  FW_ASSERT(
402  Os::Queue::Status::OP_OK == qStat,
403  static_cast<FwAssertArgType>(qStat)
404  );
405  }
406 
407 #if !FW_DIRECT_PORT_CALLS
408 
409  // ----------------------------------------------------------------------
410  // Getters for special input ports
411  // ----------------------------------------------------------------------
412 
415  {
416  FW_ASSERT(
417  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
418  static_cast<FwAssertArgType>(portNum)
419  );
420 
421  return &this->m_cmdIn_InputPort[portNum];
422  }
423 
424 #endif
425 
426 #if !FW_DIRECT_PORT_CALLS
427 
428  // ----------------------------------------------------------------------
429  // Getters for typed input ports
430  // ----------------------------------------------------------------------
431 
434  {
435  FW_ASSERT(
436  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
437  static_cast<FwAssertArgType>(portNum)
438  );
439 
440  return &this->m_Run_InputPort[portNum];
441  }
442 
445  {
446  FW_ASSERT(
447  (0 <= portNum) && (portNum < this->getNum_SendFile_InputPorts()),
448  static_cast<FwAssertArgType>(portNum)
449  );
450 
451  return &this->m_SendFile_InputPort[portNum];
452  }
453 
456  {
457  FW_ASSERT(
458  (0 <= portNum) && (portNum < this->getNum_bufferReturn_InputPorts()),
459  static_cast<FwAssertArgType>(portNum)
460  );
461 
462  return &this->m_bufferReturn_InputPort[portNum];
463  }
464 
467  {
468  FW_ASSERT(
469  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
470  static_cast<FwAssertArgType>(portNum)
471  );
472 
473  return &this->m_pingIn_InputPort[portNum];
474  }
475 
476 #endif
477 
478 #if !FW_DIRECT_PORT_CALLS
479 
480  // ----------------------------------------------------------------------
481  // Connect input ports to special output ports
482  // ----------------------------------------------------------------------
483 
486  FwIndexType portNum,
487  Fw::InputCmdRegPort* port
488  )
489  {
490  FW_ASSERT(
491  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
492  static_cast<FwAssertArgType>(portNum)
493  );
494 
495  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
496  }
497 
500  FwIndexType portNum,
502  )
503  {
504  FW_ASSERT(
505  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
506  static_cast<FwAssertArgType>(portNum)
507  );
508 
509  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
510  }
511 
514  FwIndexType portNum,
515  Fw::InputLogPort* port
516  )
517  {
518  FW_ASSERT(
519  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
520  static_cast<FwAssertArgType>(portNum)
521  );
522 
523  this->m_eventOut_OutputPort[portNum].addCallPort(port);
524  }
525 
526 #if FW_ENABLE_TEXT_LOGGING == 1
527 
528  void FileDownlinkComponentBase ::
529  set_textEventOut_OutputPort(
530  FwIndexType portNum,
532  )
533  {
534  FW_ASSERT(
535  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
536  static_cast<FwAssertArgType>(portNum)
537  );
538 
539  this->m_textEventOut_OutputPort[portNum].addCallPort(port);
540  }
541 
542 #endif
543 
546  FwIndexType portNum,
547  Fw::InputTimePort* port
548  )
549  {
550  FW_ASSERT(
551  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
552  static_cast<FwAssertArgType>(portNum)
553  );
554 
555  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
556  }
557 
560  FwIndexType portNum,
561  Fw::InputTlmPort* port
562  )
563  {
564  FW_ASSERT(
565  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
566  static_cast<FwAssertArgType>(portNum)
567  );
568 
569  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
570  }
571 
572 #endif
573 
574 #if !FW_DIRECT_PORT_CALLS
575 
576  // ----------------------------------------------------------------------
577  // Connect typed input ports to typed output ports
578  // ----------------------------------------------------------------------
579 
582  FwIndexType portNum,
584  )
585  {
586  FW_ASSERT(
587  (0 <= portNum) && (portNum < this->getNum_FileComplete_OutputPorts()),
588  static_cast<FwAssertArgType>(portNum)
589  );
590 
591  this->m_FileComplete_OutputPort[portNum].addCallPort(port);
592  }
593 
596  FwIndexType portNum,
598  )
599  {
600  FW_ASSERT(
601  (0 <= portNum) && (portNum < this->getNum_bufferSendOut_OutputPorts()),
602  static_cast<FwAssertArgType>(portNum)
603  );
604 
605  this->m_bufferSendOut_OutputPort[portNum].addCallPort(port);
606  }
607 
610  FwIndexType portNum,
611  Svc::InputPingPort* port
612  )
613  {
614  FW_ASSERT(
615  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
616  static_cast<FwAssertArgType>(portNum)
617  );
618 
619  this->m_pingOut_OutputPort[portNum].addCallPort(port);
620  }
621 
622 #endif
623 
624 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
625 
626  // ----------------------------------------------------------------------
627  // Connect serial input ports to special output ports
628  // ----------------------------------------------------------------------
629 
632  FwIndexType portNum,
633  Fw::InputSerializePort* port
634  )
635  {
636  FW_ASSERT(
637  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
638  static_cast<FwAssertArgType>(portNum)
639  );
640 
641  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
642  }
643 
646  FwIndexType portNum,
647  Fw::InputSerializePort* port
648  )
649  {
650  FW_ASSERT(
651  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
652  static_cast<FwAssertArgType>(portNum)
653  );
654 
655  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
656  }
657 
660  FwIndexType portNum,
661  Fw::InputSerializePort* port
662  )
663  {
664  FW_ASSERT(
665  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
666  static_cast<FwAssertArgType>(portNum)
667  );
668 
669  this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
670  }
671 
672 #if FW_ENABLE_TEXT_LOGGING == 1
673 
674  void FileDownlinkComponentBase ::
675  set_textEventOut_OutputPort(
676  FwIndexType portNum,
677  Fw::InputSerializePort* port
678  )
679  {
680  FW_ASSERT(
681  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
682  static_cast<FwAssertArgType>(portNum)
683  );
684 
685  this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
686  }
687 
688 #endif
689 
692  FwIndexType portNum,
693  Fw::InputSerializePort* port
694  )
695  {
696  FW_ASSERT(
697  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
698  static_cast<FwAssertArgType>(portNum)
699  );
700 
701  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
702  }
703 
706  FwIndexType portNum,
707  Fw::InputSerializePort* port
708  )
709  {
710  FW_ASSERT(
711  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
712  static_cast<FwAssertArgType>(portNum)
713  );
714 
715  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
716  }
717 
718 #endif
719 
720 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
721 
722  // ----------------------------------------------------------------------
723  // Connect serial input ports to typed output ports
724  // ----------------------------------------------------------------------
725 
728  FwIndexType portNum,
729  Fw::InputSerializePort* port
730  )
731  {
732  FW_ASSERT(
733  (0 <= portNum) && (portNum < this->getNum_FileComplete_OutputPorts()),
734  static_cast<FwAssertArgType>(portNum)
735  );
736 
737  this->m_FileComplete_OutputPort[portNum].registerSerialPort(port);
738  }
739 
742  FwIndexType portNum,
743  Fw::InputSerializePort* port
744  )
745  {
746  FW_ASSERT(
747  (0 <= portNum) && (portNum < this->getNum_bufferSendOut_OutputPorts()),
748  static_cast<FwAssertArgType>(portNum)
749  );
750 
751  this->m_bufferSendOut_OutputPort[portNum].registerSerialPort(port);
752  }
753 
756  FwIndexType portNum,
757  Fw::InputSerializePort* port
758  )
759  {
760  FW_ASSERT(
761  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
762  static_cast<FwAssertArgType>(portNum)
763  );
764 
765  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
766  }
767 
768 #endif
769 
770  // ----------------------------------------------------------------------
771  // Command registration
772  // ----------------------------------------------------------------------
773 
776  {
778 
779  this->cmdRegOut_out(
780  0,
781  this->getIdBase() + OPCODE_SENDFILE
782  );
783 
784  this->cmdRegOut_out(
785  0,
786  this->getIdBase() + OPCODE_CANCEL
787  );
788 
789  this->cmdRegOut_out(
790  0,
791  this->getIdBase() + OPCODE_SENDPARTIAL
792  );
793  }
794 
795  // ----------------------------------------------------------------------
796  // Component construction and destruction
797  // ----------------------------------------------------------------------
798 
800  FileDownlinkComponentBase(const char* compName) :
801  Fw::ActiveComponentBase(compName)
802  {
803 
804  }
805 
808  {
809 
810  }
811 
812 #if !FW_DIRECT_PORT_CALLS
813 
814  // ----------------------------------------------------------------------
815  // Connection status queries for special output ports
816  // ----------------------------------------------------------------------
817 
820  {
821  FW_ASSERT(
822  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
823  static_cast<FwAssertArgType>(portNum)
824  );
825 
826  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
827  }
828 
831  {
832  FW_ASSERT(
833  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
834  static_cast<FwAssertArgType>(portNum)
835  );
836 
837  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
838  }
839 
842  {
843  FW_ASSERT(
844  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
845  static_cast<FwAssertArgType>(portNum)
846  );
847 
848  return this->m_eventOut_OutputPort[portNum].isConnected();
849  }
850 
851 #if FW_ENABLE_TEXT_LOGGING == 1
852 
853  bool FileDownlinkComponentBase ::
854  isConnected_textEventOut_OutputPort(FwIndexType portNum) const
855  {
856  FW_ASSERT(
857  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
858  static_cast<FwAssertArgType>(portNum)
859  );
860 
861  return this->m_textEventOut_OutputPort[portNum].isConnected();
862  }
863 
864 #endif
865 
868  {
869  FW_ASSERT(
870  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
871  static_cast<FwAssertArgType>(portNum)
872  );
873 
874  return this->m_timeCaller_OutputPort[portNum].isConnected();
875  }
876 
879  {
880  FW_ASSERT(
881  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
882  static_cast<FwAssertArgType>(portNum)
883  );
884 
885  return this->m_tlmOut_OutputPort[portNum].isConnected();
886  }
887 
888 #endif
889 
890 #if !FW_DIRECT_PORT_CALLS
891 
892  // ----------------------------------------------------------------------
893  // Connection status queries for typed output ports
894  // ----------------------------------------------------------------------
895 
898  {
899  FW_ASSERT(
900  (0 <= portNum) && (portNum < this->getNum_FileComplete_OutputPorts()),
901  static_cast<FwAssertArgType>(portNum)
902  );
903 
904  return this->m_FileComplete_OutputPort[portNum].isConnected();
905  }
906 
909  {
910  FW_ASSERT(
911  (0 <= portNum) && (portNum < this->getNum_bufferSendOut_OutputPorts()),
912  static_cast<FwAssertArgType>(portNum)
913  );
914 
915  return this->m_bufferSendOut_OutputPort[portNum].isConnected();
916  }
917 
920  {
921  FW_ASSERT(
922  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
923  static_cast<FwAssertArgType>(portNum)
924  );
925 
926  return this->m_pingOut_OutputPort[portNum].isConnected();
927  }
928 
929 #endif
930 
931  // ----------------------------------------------------------------------
932  // Port handler base-class functions for special input ports
933  //
934  // Call these functions directly to bypass the corresponding ports
935  // ----------------------------------------------------------------------
936 
939  FwIndexType portNum,
940  FwOpcodeType opCode,
941  U32 cmdSeq,
942  Fw::CmdArgBuffer& args
943  )
944  {
945 
946  const U32 idBase = this->getIdBase();
947  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
948 
949  // Select base class function based on opcode
950  switch (opCode - idBase) {
951  case OPCODE_SENDFILE: {
953  opCode,
954  cmdSeq,
955  args
956  );
957  break;
958  }
959 
960  case OPCODE_CANCEL: {
961  this->Cancel_cmdHandlerBase(
962  opCode,
963  cmdSeq,
964  args
965  );
966  break;
967  }
968 
969  case OPCODE_SENDPARTIAL: {
971  opCode,
972  cmdSeq,
973  args
974  );
975  break;
976  }
977  default:
978  // Unknown opcode: ignore it
979  break;
980  }
981  }
982 
983  // ----------------------------------------------------------------------
984  // Port handler base-class functions for typed input ports
985  //
986  // Call these functions directly to bypass the corresponding ports
987  // ----------------------------------------------------------------------
988 
991  FwIndexType portNum,
992  U32 context
993  )
994  {
995  // Make sure port number is valid
996  FW_ASSERT(
997  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
998  static_cast<FwAssertArgType>(portNum)
999  );
1000 
1001  // Call pre-message hook
1003  portNum,
1004  context
1005  );
1006  ComponentIpcSerializableBuffer msg;
1008 
1009  // Serialize message ID
1010  _status = msg.serializeFrom(
1011  static_cast<FwEnumStoreType>(RUN_SCHED)
1012  );
1013  FW_ASSERT(
1014  _status == Fw::FW_SERIALIZE_OK,
1015  static_cast<FwAssertArgType>(_status)
1016  );
1017 
1018  // Serialize port number
1019  _status = msg.serializeFrom(portNum);
1020  FW_ASSERT(
1021  _status == Fw::FW_SERIALIZE_OK,
1022  static_cast<FwAssertArgType>(_status)
1023  );
1024 
1025  // Serialize argument context
1026  _status = msg.serializeFrom(context);
1027  FW_ASSERT(
1028  _status == Fw::FW_SERIALIZE_OK,
1029  static_cast<FwAssertArgType>(_status)
1030  );
1031 
1032  // Send message
1034  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1035 
1036  FW_ASSERT(
1037  qStatus == Os::Queue::OP_OK,
1038  static_cast<FwAssertArgType>(qStatus)
1039  );
1040  }
1041 
1044  FwIndexType portNum,
1045  const Fw::StringBase& sourceFileName,
1046  const Fw::StringBase& destFileName,
1047  U32 offset,
1048  U32 length
1049  )
1050  {
1051  // Make sure port number is valid
1052  FW_ASSERT(
1053  (0 <= portNum) && (portNum < this->getNum_SendFile_InputPorts()),
1054  static_cast<FwAssertArgType>(portNum)
1055  );
1056 
1057  Svc::SendFileResponse retVal;
1058 
1059  // Lock guard mutex before calling
1060  this->lock();
1061 
1062  // Call handler function
1063  retVal = this->SendFile_handler(
1064  portNum,
1065  sourceFileName,
1066  destFileName,
1067  offset,
1068  length
1069  );
1070 
1071  // Unlock guard mutex
1072  this->unLock();
1073 
1074  return retVal;
1075  }
1076 
1079  FwIndexType portNum,
1080  Fw::Buffer& fwBuffer
1081  )
1082  {
1083  // Make sure port number is valid
1084  FW_ASSERT(
1085  (0 <= portNum) && (portNum < this->getNum_bufferReturn_InputPorts()),
1086  static_cast<FwAssertArgType>(portNum)
1087  );
1088 
1089  // Call pre-message hook
1091  portNum,
1092  fwBuffer
1093  );
1094  ComponentIpcSerializableBuffer msg;
1096 
1097  // Serialize message ID
1098  _status = msg.serializeFrom(
1099  static_cast<FwEnumStoreType>(BUFFERRETURN_BUFFERSEND)
1100  );
1101  FW_ASSERT(
1102  _status == Fw::FW_SERIALIZE_OK,
1103  static_cast<FwAssertArgType>(_status)
1104  );
1105 
1106  // Serialize port number
1107  _status = msg.serializeFrom(portNum);
1108  FW_ASSERT(
1109  _status == Fw::FW_SERIALIZE_OK,
1110  static_cast<FwAssertArgType>(_status)
1111  );
1112 
1113  // Serialize argument fwBuffer
1114  _status = msg.serializeFrom(fwBuffer);
1115  FW_ASSERT(
1116  _status == Fw::FW_SERIALIZE_OK,
1117  static_cast<FwAssertArgType>(_status)
1118  );
1119 
1120  // Send message
1122  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1123 
1124  FW_ASSERT(
1125  qStatus == Os::Queue::OP_OK,
1126  static_cast<FwAssertArgType>(qStatus)
1127  );
1128  }
1129 
1132  FwIndexType portNum,
1133  U32 key
1134  )
1135  {
1136  // Make sure port number is valid
1137  FW_ASSERT(
1138  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
1139  static_cast<FwAssertArgType>(portNum)
1140  );
1141 
1142  // Call pre-message hook
1144  portNum,
1145  key
1146  );
1147  ComponentIpcSerializableBuffer msg;
1149 
1150  // Serialize message ID
1151  _status = msg.serializeFrom(
1152  static_cast<FwEnumStoreType>(PINGIN_PING)
1153  );
1154  FW_ASSERT(
1155  _status == Fw::FW_SERIALIZE_OK,
1156  static_cast<FwAssertArgType>(_status)
1157  );
1158 
1159  // Serialize port number
1160  _status = msg.serializeFrom(portNum);
1161  FW_ASSERT(
1162  _status == Fw::FW_SERIALIZE_OK,
1163  static_cast<FwAssertArgType>(_status)
1164  );
1165 
1166  // Serialize argument key
1167  _status = msg.serializeFrom(key);
1168  FW_ASSERT(
1169  _status == Fw::FW_SERIALIZE_OK,
1170  static_cast<FwAssertArgType>(_status)
1171  );
1172 
1173  // Send message
1175  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1176 
1177  if (qStatus == Os::Queue::Status::FULL) {
1178  this->incNumMsgDropped();
1179  return;
1180  }
1181 
1182  FW_ASSERT(
1183  qStatus == Os::Queue::OP_OK,
1184  static_cast<FwAssertArgType>(qStatus)
1185  );
1186  }
1187 
1188  // ----------------------------------------------------------------------
1189  // Pre-message hooks for typed async input ports
1190  //
1191  // Each of these functions is invoked just before processing a message
1192  // on the corresponding port. By default, they do nothing. You can
1193  // override them to provide specific pre-message behavior.
1194  // ----------------------------------------------------------------------
1195 
1198  FwIndexType portNum,
1199  U32 context
1200  )
1201  {
1202  // Default: no-op
1203  }
1204 
1207  FwIndexType portNum,
1208  Fw::Buffer& fwBuffer
1209  )
1210  {
1211  // Default: no-op
1212  }
1213 
1216  FwIndexType portNum,
1217  U32 key
1218  )
1219  {
1220  // Default: no-op
1221  }
1222 
1223 #if !FW_DIRECT_PORT_CALLS
1224 
1225  // ----------------------------------------------------------------------
1226  // Invocation functions for typed output ports
1227  // ----------------------------------------------------------------------
1228 
1231  FwIndexType portNum,
1232  const Svc::SendFileResponse& resp
1233  ) const
1234  {
1235  FW_ASSERT(
1236  (0 <= portNum) && (portNum < this->getNum_FileComplete_OutputPorts()),
1237  static_cast<FwAssertArgType>(portNum)
1238  );
1239 
1240  FW_ASSERT(
1241  this->m_FileComplete_OutputPort[portNum].isConnected(),
1242  static_cast<FwAssertArgType>(portNum)
1243  );
1244  this->m_FileComplete_OutputPort[portNum].invoke(
1245  resp
1246  );
1247  }
1248 
1251  FwIndexType portNum,
1252  Fw::Buffer& fwBuffer
1253  ) const
1254  {
1255  FW_ASSERT(
1256  (0 <= portNum) && (portNum < this->getNum_bufferSendOut_OutputPorts()),
1257  static_cast<FwAssertArgType>(portNum)
1258  );
1259 
1260  FW_ASSERT(
1261  this->m_bufferSendOut_OutputPort[portNum].isConnected(),
1262  static_cast<FwAssertArgType>(portNum)
1263  );
1264  this->m_bufferSendOut_OutputPort[portNum].invoke(
1265  fwBuffer
1266  );
1267  }
1268 
1271  FwIndexType portNum,
1272  U32 key
1273  ) const
1274  {
1275  FW_ASSERT(
1276  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1277  static_cast<FwAssertArgType>(portNum)
1278  );
1279 
1280  FW_ASSERT(
1281  this->m_pingOut_OutputPort[portNum].isConnected(),
1282  static_cast<FwAssertArgType>(portNum)
1283  );
1284  this->m_pingOut_OutputPort[portNum].invoke(
1285  key
1286  );
1287  }
1288 
1289 #endif
1290 
1291  // ----------------------------------------------------------------------
1292  // Command response
1293  // ----------------------------------------------------------------------
1294 
1297  FwOpcodeType opCode,
1298  U32 cmdSeq,
1299  Fw::CmdResponse response
1300  )
1301  {
1303  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
1304  }
1305 
1306  // ----------------------------------------------------------------------
1307  // Command handler base-class functions
1308  //
1309  // Call these functions directly to bypass the command input port
1310  // ----------------------------------------------------------------------
1311 
1314  FwOpcodeType opCode,
1315  U32 cmdSeq,
1316  Fw::CmdArgBuffer& args
1317  )
1318  {
1319  // Call pre-message hook
1320  this->SendFile_preMsgHook(opCode,cmdSeq);
1321 
1322  // Defer deserializing arguments to the message dispatcher
1323  // to avoid deserializing and reserializing just for IPC
1324  ComponentIpcSerializableBuffer msg;
1326 
1327  // Serialize for IPC
1328  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SENDFILE));
1329  FW_ASSERT (
1330  _status == Fw::FW_SERIALIZE_OK,
1331  static_cast<FwAssertArgType>(_status)
1332  );
1333 
1334  // Fake port number to make message dequeue work
1335  FwIndexType port = 0;
1336 
1337  _status = msg.serializeFrom(port);
1338  FW_ASSERT (
1339  _status == Fw::FW_SERIALIZE_OK,
1340  static_cast<FwAssertArgType>(_status)
1341  );
1342 
1343  _status = msg.serializeFrom(opCode);
1344  FW_ASSERT (
1345  _status == Fw::FW_SERIALIZE_OK,
1346  static_cast<FwAssertArgType>(_status)
1347  );
1348 
1349  _status = msg.serializeFrom(cmdSeq);
1350  FW_ASSERT (
1351  _status == Fw::FW_SERIALIZE_OK,
1352  static_cast<FwAssertArgType>(_status)
1353  );
1354 
1355  _status = msg.serializeFrom(args);
1356  FW_ASSERT (
1357  _status == Fw::FW_SERIALIZE_OK,
1358  static_cast<FwAssertArgType>(_status)
1359  );
1360 
1361  // Send message
1363  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1364 
1365  FW_ASSERT(
1366  qStatus == Os::Queue::OP_OK,
1367  static_cast<FwAssertArgType>(qStatus)
1368  );
1369  }
1370 
1373  FwOpcodeType opCode,
1374  U32 cmdSeq,
1375  Fw::CmdArgBuffer& args
1376  )
1377  {
1378  // Call pre-message hook
1379  this->Cancel_preMsgHook(opCode,cmdSeq);
1380 
1381  // Defer deserializing arguments to the message dispatcher
1382  // to avoid deserializing and reserializing just for IPC
1383  ComponentIpcSerializableBuffer msg;
1385 
1386  // Serialize for IPC
1387  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CANCEL));
1388  FW_ASSERT (
1389  _status == Fw::FW_SERIALIZE_OK,
1390  static_cast<FwAssertArgType>(_status)
1391  );
1392 
1393  // Fake port number to make message dequeue work
1394  FwIndexType port = 0;
1395 
1396  _status = msg.serializeFrom(port);
1397  FW_ASSERT (
1398  _status == Fw::FW_SERIALIZE_OK,
1399  static_cast<FwAssertArgType>(_status)
1400  );
1401 
1402  _status = msg.serializeFrom(opCode);
1403  FW_ASSERT (
1404  _status == Fw::FW_SERIALIZE_OK,
1405  static_cast<FwAssertArgType>(_status)
1406  );
1407 
1408  _status = msg.serializeFrom(cmdSeq);
1409  FW_ASSERT (
1410  _status == Fw::FW_SERIALIZE_OK,
1411  static_cast<FwAssertArgType>(_status)
1412  );
1413 
1414  _status = msg.serializeFrom(args);
1415  FW_ASSERT (
1416  _status == Fw::FW_SERIALIZE_OK,
1417  static_cast<FwAssertArgType>(_status)
1418  );
1419 
1420  // Send message
1422  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1423 
1424  FW_ASSERT(
1425  qStatus == Os::Queue::OP_OK,
1426  static_cast<FwAssertArgType>(qStatus)
1427  );
1428  }
1429 
1432  FwOpcodeType opCode,
1433  U32 cmdSeq,
1434  Fw::CmdArgBuffer& args
1435  )
1436  {
1437  // Call pre-message hook
1438  this->SendPartial_preMsgHook(opCode,cmdSeq);
1439 
1440  // Defer deserializing arguments to the message dispatcher
1441  // to avoid deserializing and reserializing just for IPC
1442  ComponentIpcSerializableBuffer msg;
1444 
1445  // Serialize for IPC
1446  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SENDPARTIAL));
1447  FW_ASSERT (
1448  _status == Fw::FW_SERIALIZE_OK,
1449  static_cast<FwAssertArgType>(_status)
1450  );
1451 
1452  // Fake port number to make message dequeue work
1453  FwIndexType port = 0;
1454 
1455  _status = msg.serializeFrom(port);
1456  FW_ASSERT (
1457  _status == Fw::FW_SERIALIZE_OK,
1458  static_cast<FwAssertArgType>(_status)
1459  );
1460 
1461  _status = msg.serializeFrom(opCode);
1462  FW_ASSERT (
1463  _status == Fw::FW_SERIALIZE_OK,
1464  static_cast<FwAssertArgType>(_status)
1465  );
1466 
1467  _status = msg.serializeFrom(cmdSeq);
1468  FW_ASSERT (
1469  _status == Fw::FW_SERIALIZE_OK,
1470  static_cast<FwAssertArgType>(_status)
1471  );
1472 
1473  _status = msg.serializeFrom(args);
1474  FW_ASSERT (
1475  _status == Fw::FW_SERIALIZE_OK,
1476  static_cast<FwAssertArgType>(_status)
1477  );
1478 
1479  // Send message
1481  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1482 
1483  FW_ASSERT(
1484  qStatus == Os::Queue::OP_OK,
1485  static_cast<FwAssertArgType>(qStatus)
1486  );
1487  }
1488 
1489  // ----------------------------------------------------------------------
1490  // Pre-message hooks for async commands
1491  //
1492  // Each of these functions is invoked just before processing the
1493  // corresponding command. By default they do nothing. You can
1494  // override them to provide specific pre-command behavior.
1495  // ----------------------------------------------------------------------
1496 
1499  FwOpcodeType opCode,
1500  U32 cmdSeq
1501  )
1502  {
1503  // Defaults to no-op; can be overridden
1504  (void) opCode;
1505  (void) cmdSeq;
1506  }
1507 
1510  FwOpcodeType opCode,
1511  U32 cmdSeq
1512  )
1513  {
1514  // Defaults to no-op; can be overridden
1515  (void) opCode;
1516  (void) cmdSeq;
1517  }
1518 
1521  FwOpcodeType opCode,
1522  U32 cmdSeq
1523  )
1524  {
1525  // Defaults to no-op; can be overridden
1526  (void) opCode;
1527  (void) cmdSeq;
1528  }
1529 
1530  // ----------------------------------------------------------------------
1531  // Event logging functions
1532  // ----------------------------------------------------------------------
1533 
1536  {
1537  // Get the time
1538  Fw::Time _logTime;
1539  if (this->isConnected_timeCaller_OutputPort(0)) {
1540  this->timeCaller_out(0, _logTime);
1541  }
1542 
1543  const FwEventIdType _id = this->getIdBase() + EVENTID_FILEOPENERROR;
1544 
1545  // Emit the event on the log port
1546  if (this->isConnected_eventOut_OutputPort(0)) {
1547  Fw::LogBuffer _logBuff;
1549 
1550 #if FW_AMPCS_COMPATIBLE
1551  // Serialize the number of arguments
1552  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1553  FW_ASSERT(
1554  _status == Fw::FW_SERIALIZE_OK,
1555  static_cast<FwAssertArgType>(_status)
1556  );
1557 #endif
1558 
1559  _status = fileName.serializeTo(
1560  _logBuff,
1561  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1562  );
1563  FW_ASSERT(
1564  _status == Fw::FW_SERIALIZE_OK,
1565  static_cast<FwAssertArgType>(_status)
1566  );
1567 
1568  this->eventOut_out(
1569  0,
1570  _id,
1571  _logTime,
1573  _logBuff
1574  );
1575  }
1576 
1577  // Emit the event on the text log port
1578 #if FW_ENABLE_TEXT_LOGGING
1579  if (this->isConnected_textEventOut_OutputPort(0)) {
1580 #if FW_OBJECT_NAMES == 1
1581  const char* _formatString =
1582  "(%s) %s: Could not open file %s";
1583 #else
1584  const char* _formatString =
1585  "%s: Could not open file %s";
1586 #endif
1587 
1588  Fw::TextLogString _logString;
1589  (void) _logString.format(
1590  _formatString,
1591 #if FW_OBJECT_NAMES == 1
1592  this->m_objName.toChar(),
1593 #endif
1594  "FileOpenError ",
1595  fileName.toChar()
1596  );
1597 
1598  this->textEventOut_out(
1599  0,
1600  _id,
1601  _logTime,
1603  _logString
1604  );
1605  }
1606 #endif
1607  }
1608 
1611  const Fw::StringBase& fileName,
1612  I32 status
1613  ) const
1614  {
1615  // Get the time
1616  Fw::Time _logTime;
1617  if (this->isConnected_timeCaller_OutputPort(0)) {
1618  this->timeCaller_out(0, _logTime);
1619  }
1620 
1621  const FwEventIdType _id = this->getIdBase() + EVENTID_FILEREADERROR;
1622 
1623  // Emit the event on the log port
1624  if (this->isConnected_eventOut_OutputPort(0)) {
1625  Fw::LogBuffer _logBuff;
1627 
1628 #if FW_AMPCS_COMPATIBLE
1629  // Serialize the number of arguments
1630  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1631  FW_ASSERT(
1632  _status == Fw::FW_SERIALIZE_OK,
1633  static_cast<FwAssertArgType>(_status)
1634  );
1635 #endif
1636 
1637  _status = fileName.serializeTo(
1638  _logBuff,
1639  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1640  );
1641  FW_ASSERT(
1642  _status == Fw::FW_SERIALIZE_OK,
1643  static_cast<FwAssertArgType>(_status)
1644  );
1645 
1646 #if FW_AMPCS_COMPATIBLE
1647  // Serialize the argument size
1648  _status = _logBuff.serializeFrom(
1649  static_cast<U8>(sizeof(I32))
1650  );
1651  FW_ASSERT(
1652  _status == Fw::FW_SERIALIZE_OK,
1653  static_cast<FwAssertArgType>(_status)
1654  );
1655 #endif
1656  _status = _logBuff.serializeFrom(status);
1657  FW_ASSERT(
1658  _status == Fw::FW_SERIALIZE_OK,
1659  static_cast<FwAssertArgType>(_status)
1660  );
1661 
1662  this->eventOut_out(
1663  0,
1664  _id,
1665  _logTime,
1667  _logBuff
1668  );
1669  }
1670 
1671  // Emit the event on the text log port
1672 #if FW_ENABLE_TEXT_LOGGING
1673  if (this->isConnected_textEventOut_OutputPort(0)) {
1674 #if FW_OBJECT_NAMES == 1
1675  const char* _formatString =
1676  "(%s) %s: Could not read file %s with status %" PRIi32 "";
1677 #else
1678  const char* _formatString =
1679  "%s: Could not read file %s with status %" PRIi32 "";
1680 #endif
1681 
1682  Fw::TextLogString _logString;
1683  (void) _logString.format(
1684  _formatString,
1685 #if FW_OBJECT_NAMES == 1
1686  this->m_objName.toChar(),
1687 #endif
1688  "FileReadError ",
1689  fileName.toChar(),
1690  status
1691  );
1692 
1693  this->textEventOut_out(
1694  0,
1695  _id,
1696  _logTime,
1698  _logString
1699  );
1700  }
1701 #endif
1702  }
1703 
1706  const Fw::StringBase& sourceFileName,
1707  const Fw::StringBase& destFileName
1708  ) const
1709  {
1710  // Get the time
1711  Fw::Time _logTime;
1712  if (this->isConnected_timeCaller_OutputPort(0)) {
1713  this->timeCaller_out(0, _logTime);
1714  }
1715 
1716  const FwEventIdType _id = this->getIdBase() + EVENTID_FILESENT;
1717 
1718  // Emit the event on the log port
1719  if (this->isConnected_eventOut_OutputPort(0)) {
1720  Fw::LogBuffer _logBuff;
1722 
1723 #if FW_AMPCS_COMPATIBLE
1724  // Serialize the number of arguments
1725  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1726  FW_ASSERT(
1727  _status == Fw::FW_SERIALIZE_OK,
1728  static_cast<FwAssertArgType>(_status)
1729  );
1730 #endif
1731 
1732  _status = sourceFileName.serializeTo(
1733  _logBuff,
1734  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1735  );
1736  FW_ASSERT(
1737  _status == Fw::FW_SERIALIZE_OK,
1738  static_cast<FwAssertArgType>(_status)
1739  );
1740 
1741  _status = destFileName.serializeTo(
1742  _logBuff,
1743  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1744  );
1745  FW_ASSERT(
1746  _status == Fw::FW_SERIALIZE_OK,
1747  static_cast<FwAssertArgType>(_status)
1748  );
1749 
1750  this->eventOut_out(
1751  0,
1752  _id,
1753  _logTime,
1755  _logBuff
1756  );
1757  }
1758 
1759  // Emit the event on the text log port
1760 #if FW_ENABLE_TEXT_LOGGING
1761  if (this->isConnected_textEventOut_OutputPort(0)) {
1762 #if FW_OBJECT_NAMES == 1
1763  const char* _formatString =
1764  "(%s) %s: Sent file %s to file %s";
1765 #else
1766  const char* _formatString =
1767  "%s: Sent file %s to file %s";
1768 #endif
1769 
1770  Fw::TextLogString _logString;
1771  (void) _logString.format(
1772  _formatString,
1773 #if FW_OBJECT_NAMES == 1
1774  this->m_objName.toChar(),
1775 #endif
1776  "FileSent ",
1777  sourceFileName.toChar(),
1778  destFileName.toChar()
1779  );
1780 
1781  this->textEventOut_out(
1782  0,
1783  _id,
1784  _logTime,
1786  _logString
1787  );
1788  }
1789 #endif
1790  }
1791 
1794  const Fw::StringBase& sourceFileName,
1795  const Fw::StringBase& destFileName
1796  ) const
1797  {
1798  // Get the time
1799  Fw::Time _logTime;
1800  if (this->isConnected_timeCaller_OutputPort(0)) {
1801  this->timeCaller_out(0, _logTime);
1802  }
1803 
1804  const FwEventIdType _id = this->getIdBase() + EVENTID_DOWNLINKCANCELED;
1805 
1806  // Emit the event on the log port
1807  if (this->isConnected_eventOut_OutputPort(0)) {
1808  Fw::LogBuffer _logBuff;
1810 
1811 #if FW_AMPCS_COMPATIBLE
1812  // Serialize the number of arguments
1813  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1814  FW_ASSERT(
1815  _status == Fw::FW_SERIALIZE_OK,
1816  static_cast<FwAssertArgType>(_status)
1817  );
1818 #endif
1819 
1820  _status = sourceFileName.serializeTo(
1821  _logBuff,
1822  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1823  );
1824  FW_ASSERT(
1825  _status == Fw::FW_SERIALIZE_OK,
1826  static_cast<FwAssertArgType>(_status)
1827  );
1828 
1829  _status = destFileName.serializeTo(
1830  _logBuff,
1831  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1832  );
1833  FW_ASSERT(
1834  _status == Fw::FW_SERIALIZE_OK,
1835  static_cast<FwAssertArgType>(_status)
1836  );
1837 
1838  this->eventOut_out(
1839  0,
1840  _id,
1841  _logTime,
1843  _logBuff
1844  );
1845  }
1846 
1847  // Emit the event on the text log port
1848 #if FW_ENABLE_TEXT_LOGGING
1849  if (this->isConnected_textEventOut_OutputPort(0)) {
1850 #if FW_OBJECT_NAMES == 1
1851  const char* _formatString =
1852  "(%s) %s: Canceled downlink of file %s to file %s";
1853 #else
1854  const char* _formatString =
1855  "%s: Canceled downlink of file %s to file %s";
1856 #endif
1857 
1858  Fw::TextLogString _logString;
1859  (void) _logString.format(
1860  _formatString,
1861 #if FW_OBJECT_NAMES == 1
1862  this->m_objName.toChar(),
1863 #endif
1864  "DownlinkCanceled ",
1865  sourceFileName.toChar(),
1866  destFileName.toChar()
1867  );
1868 
1869  this->textEventOut_out(
1870  0,
1871  _id,
1872  _logTime,
1874  _logString
1875  );
1876  }
1877 #endif
1878  }
1879 
1882  U32 startOffset,
1883  U32 length,
1884  U32 filesize,
1885  const Fw::StringBase& sourceFileName,
1886  const Fw::StringBase& destFileName
1887  ) const
1888  {
1889  // Get the time
1890  Fw::Time _logTime;
1891  if (this->isConnected_timeCaller_OutputPort(0)) {
1892  this->timeCaller_out(0, _logTime);
1893  }
1894 
1896 
1897  // Emit the event on the log port
1898  if (this->isConnected_eventOut_OutputPort(0)) {
1899  Fw::LogBuffer _logBuff;
1901 
1902 #if FW_AMPCS_COMPATIBLE
1903  // Serialize the number of arguments
1904  _status = _logBuff.serializeFrom(static_cast<U8>(5));
1905  FW_ASSERT(
1906  _status == Fw::FW_SERIALIZE_OK,
1907  static_cast<FwAssertArgType>(_status)
1908  );
1909 #endif
1910 
1911 #if FW_AMPCS_COMPATIBLE
1912  // Serialize the argument size
1913  _status = _logBuff.serializeFrom(
1914  static_cast<U8>(sizeof(U32))
1915  );
1916  FW_ASSERT(
1917  _status == Fw::FW_SERIALIZE_OK,
1918  static_cast<FwAssertArgType>(_status)
1919  );
1920 #endif
1921  _status = _logBuff.serializeFrom(startOffset);
1922  FW_ASSERT(
1923  _status == Fw::FW_SERIALIZE_OK,
1924  static_cast<FwAssertArgType>(_status)
1925  );
1926 
1927 #if FW_AMPCS_COMPATIBLE
1928  // Serialize the argument size
1929  _status = _logBuff.serializeFrom(
1930  static_cast<U8>(sizeof(U32))
1931  );
1932  FW_ASSERT(
1933  _status == Fw::FW_SERIALIZE_OK,
1934  static_cast<FwAssertArgType>(_status)
1935  );
1936 #endif
1937  _status = _logBuff.serializeFrom(length);
1938  FW_ASSERT(
1939  _status == Fw::FW_SERIALIZE_OK,
1940  static_cast<FwAssertArgType>(_status)
1941  );
1942 
1943 #if FW_AMPCS_COMPATIBLE
1944  // Serialize the argument size
1945  _status = _logBuff.serializeFrom(
1946  static_cast<U8>(sizeof(U32))
1947  );
1948  FW_ASSERT(
1949  _status == Fw::FW_SERIALIZE_OK,
1950  static_cast<FwAssertArgType>(_status)
1951  );
1952 #endif
1953  _status = _logBuff.serializeFrom(filesize);
1954  FW_ASSERT(
1955  _status == Fw::FW_SERIALIZE_OK,
1956  static_cast<FwAssertArgType>(_status)
1957  );
1958 
1959  _status = sourceFileName.serializeTo(
1960  _logBuff,
1961  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1962  );
1963  FW_ASSERT(
1964  _status == Fw::FW_SERIALIZE_OK,
1965  static_cast<FwAssertArgType>(_status)
1966  );
1967 
1968  _status = destFileName.serializeTo(
1969  _logBuff,
1970  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1971  );
1972  FW_ASSERT(
1973  _status == Fw::FW_SERIALIZE_OK,
1974  static_cast<FwAssertArgType>(_status)
1975  );
1976 
1977  this->eventOut_out(
1978  0,
1979  _id,
1980  _logTime,
1982  _logBuff
1983  );
1984  }
1985 
1986  // Emit the event on the text log port
1987 #if FW_ENABLE_TEXT_LOGGING
1988  if (this->isConnected_textEventOut_OutputPort(0)) {
1989 #if FW_OBJECT_NAMES == 1
1990  const char* _formatString =
1991  "(%s) %s: Offset %" PRIu32 " plus length %" PRIu32 " is greater than source size %" PRIu32 " for partial downlink of file %s to file %s. ";
1992 #else
1993  const char* _formatString =
1994  "%s: Offset %" PRIu32 " plus length %" PRIu32 " is greater than source size %" PRIu32 " for partial downlink of file %s to file %s. ";
1995 #endif
1996 
1997  Fw::TextLogString _logString;
1998  (void) _logString.format(
1999  _formatString,
2000 #if FW_OBJECT_NAMES == 1
2001  this->m_objName.toChar(),
2002 #endif
2003  "DownlinkPartialWarning ",
2004  startOffset,
2005  length,
2006  filesize,
2007  sourceFileName.toChar(),
2008  destFileName.toChar()
2009  );
2010 
2011  this->textEventOut_out(
2012  0,
2013  _id,
2014  _logTime,
2016  _logString
2017  );
2018  }
2019 #endif
2020  }
2021 
2024  const Fw::StringBase& sourceFileName,
2025  const Fw::StringBase& destFileName,
2026  U32 startOffset,
2027  U32 filesize
2028  ) const
2029  {
2030  // Get the time
2031  Fw::Time _logTime;
2032  if (this->isConnected_timeCaller_OutputPort(0)) {
2033  this->timeCaller_out(0, _logTime);
2034  }
2035 
2036  const FwEventIdType _id = this->getIdBase() + EVENTID_DOWNLINKPARTIALFAIL;
2037 
2038  // Emit the event on the log port
2039  if (this->isConnected_eventOut_OutputPort(0)) {
2040  Fw::LogBuffer _logBuff;
2042 
2043 #if FW_AMPCS_COMPATIBLE
2044  // Serialize the number of arguments
2045  _status = _logBuff.serializeFrom(static_cast<U8>(4));
2046  FW_ASSERT(
2047  _status == Fw::FW_SERIALIZE_OK,
2048  static_cast<FwAssertArgType>(_status)
2049  );
2050 #endif
2051 
2052  _status = sourceFileName.serializeTo(
2053  _logBuff,
2054  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2055  );
2056  FW_ASSERT(
2057  _status == Fw::FW_SERIALIZE_OK,
2058  static_cast<FwAssertArgType>(_status)
2059  );
2060 
2061  _status = destFileName.serializeTo(
2062  _logBuff,
2063  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2064  );
2065  FW_ASSERT(
2066  _status == Fw::FW_SERIALIZE_OK,
2067  static_cast<FwAssertArgType>(_status)
2068  );
2069 
2070 #if FW_AMPCS_COMPATIBLE
2071  // Serialize the argument size
2072  _status = _logBuff.serializeFrom(
2073  static_cast<U8>(sizeof(U32))
2074  );
2075  FW_ASSERT(
2076  _status == Fw::FW_SERIALIZE_OK,
2077  static_cast<FwAssertArgType>(_status)
2078  );
2079 #endif
2080  _status = _logBuff.serializeFrom(startOffset);
2081  FW_ASSERT(
2082  _status == Fw::FW_SERIALIZE_OK,
2083  static_cast<FwAssertArgType>(_status)
2084  );
2085 
2086 #if FW_AMPCS_COMPATIBLE
2087  // Serialize the argument size
2088  _status = _logBuff.serializeFrom(
2089  static_cast<U8>(sizeof(U32))
2090  );
2091  FW_ASSERT(
2092  _status == Fw::FW_SERIALIZE_OK,
2093  static_cast<FwAssertArgType>(_status)
2094  );
2095 #endif
2096  _status = _logBuff.serializeFrom(filesize);
2097  FW_ASSERT(
2098  _status == Fw::FW_SERIALIZE_OK,
2099  static_cast<FwAssertArgType>(_status)
2100  );
2101 
2102  this->eventOut_out(
2103  0,
2104  _id,
2105  _logTime,
2107  _logBuff
2108  );
2109  }
2110 
2111  // Emit the event on the text log port
2112 #if FW_ENABLE_TEXT_LOGGING
2113  if (this->isConnected_textEventOut_OutputPort(0)) {
2114 #if FW_OBJECT_NAMES == 1
2115  const char* _formatString =
2116  "(%s) %s: Error occurred during partial downlink of file %s to file %s. Offset %" PRIu32 " greater than or equal to source filesize %" PRIu32 ".";
2117 #else
2118  const char* _formatString =
2119  "%s: Error occurred during partial downlink of file %s to file %s. Offset %" PRIu32 " greater than or equal to source filesize %" PRIu32 ".";
2120 #endif
2121 
2122  Fw::TextLogString _logString;
2123  (void) _logString.format(
2124  _formatString,
2125 #if FW_OBJECT_NAMES == 1
2126  this->m_objName.toChar(),
2127 #endif
2128  "DownlinkPartialFail ",
2129  sourceFileName.toChar(),
2130  destFileName.toChar(),
2131  startOffset,
2132  filesize
2133  );
2134 
2135  this->textEventOut_out(
2136  0,
2137  _id,
2138  _logTime,
2140  _logString
2141  );
2142  }
2143 #endif
2144  }
2145 
2148  const Fw::StringBase& sourceFileName,
2149  U32 byteOffset
2150  ) const
2151  {
2152  // Get the time
2153  Fw::Time _logTime;
2154  if (this->isConnected_timeCaller_OutputPort(0)) {
2155  this->timeCaller_out(0, _logTime);
2156  }
2157 
2158  const FwEventIdType _id = this->getIdBase() + EVENTID_SENDDATAFAIL;
2159 
2160  // Emit the event on the log port
2161  if (this->isConnected_eventOut_OutputPort(0)) {
2162  Fw::LogBuffer _logBuff;
2164 
2165 #if FW_AMPCS_COMPATIBLE
2166  // Serialize the number of arguments
2167  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2168  FW_ASSERT(
2169  _status == Fw::FW_SERIALIZE_OK,
2170  static_cast<FwAssertArgType>(_status)
2171  );
2172 #endif
2173 
2174  _status = sourceFileName.serializeTo(
2175  _logBuff,
2176  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2177  );
2178  FW_ASSERT(
2179  _status == Fw::FW_SERIALIZE_OK,
2180  static_cast<FwAssertArgType>(_status)
2181  );
2182 
2183 #if FW_AMPCS_COMPATIBLE
2184  // Serialize the argument size
2185  _status = _logBuff.serializeFrom(
2186  static_cast<U8>(sizeof(U32))
2187  );
2188  FW_ASSERT(
2189  _status == Fw::FW_SERIALIZE_OK,
2190  static_cast<FwAssertArgType>(_status)
2191  );
2192 #endif
2193  _status = _logBuff.serializeFrom(byteOffset);
2194  FW_ASSERT(
2195  _status == Fw::FW_SERIALIZE_OK,
2196  static_cast<FwAssertArgType>(_status)
2197  );
2198 
2199  this->eventOut_out(
2200  0,
2201  _id,
2202  _logTime,
2204  _logBuff
2205  );
2206  }
2207 
2208  // Emit the event on the text log port
2209 #if FW_ENABLE_TEXT_LOGGING
2210  if (this->isConnected_textEventOut_OutputPort(0)) {
2211 #if FW_OBJECT_NAMES == 1
2212  const char* _formatString =
2213  "(%s) %s: Failed to send data packet from file %s at byte offset %" PRIu32 ".";
2214 #else
2215  const char* _formatString =
2216  "%s: Failed to send data packet from file %s at byte offset %" PRIu32 ".";
2217 #endif
2218 
2219  Fw::TextLogString _logString;
2220  (void) _logString.format(
2221  _formatString,
2222 #if FW_OBJECT_NAMES == 1
2223  this->m_objName.toChar(),
2224 #endif
2225  "SendDataFail ",
2226  sourceFileName.toChar(),
2227  byteOffset
2228  );
2229 
2230  this->textEventOut_out(
2231  0,
2232  _id,
2233  _logTime,
2235  _logString
2236  );
2237  }
2238 #endif
2239  }
2240 
2243  U32 fileSize,
2244  const Fw::StringBase& sourceFileName,
2245  const Fw::StringBase& destFileName
2246  ) const
2247  {
2248  // Get the time
2249  Fw::Time _logTime;
2250  if (this->isConnected_timeCaller_OutputPort(0)) {
2251  this->timeCaller_out(0, _logTime);
2252  }
2253 
2254  const FwEventIdType _id = this->getIdBase() + EVENTID_SENDSTARTED;
2255 
2256  // Emit the event on the log port
2257  if (this->isConnected_eventOut_OutputPort(0)) {
2258  Fw::LogBuffer _logBuff;
2260 
2261 #if FW_AMPCS_COMPATIBLE
2262  // Serialize the number of arguments
2263  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2264  FW_ASSERT(
2265  _status == Fw::FW_SERIALIZE_OK,
2266  static_cast<FwAssertArgType>(_status)
2267  );
2268 #endif
2269 
2270 #if FW_AMPCS_COMPATIBLE
2271  // Serialize the argument size
2272  _status = _logBuff.serializeFrom(
2273  static_cast<U8>(sizeof(U32))
2274  );
2275  FW_ASSERT(
2276  _status == Fw::FW_SERIALIZE_OK,
2277  static_cast<FwAssertArgType>(_status)
2278  );
2279 #endif
2280  _status = _logBuff.serializeFrom(fileSize);
2281  FW_ASSERT(
2282  _status == Fw::FW_SERIALIZE_OK,
2283  static_cast<FwAssertArgType>(_status)
2284  );
2285 
2286  _status = sourceFileName.serializeTo(
2287  _logBuff,
2288  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2289  );
2290  FW_ASSERT(
2291  _status == Fw::FW_SERIALIZE_OK,
2292  static_cast<FwAssertArgType>(_status)
2293  );
2294 
2295  _status = destFileName.serializeTo(
2296  _logBuff,
2297  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2298  );
2299  FW_ASSERT(
2300  _status == Fw::FW_SERIALIZE_OK,
2301  static_cast<FwAssertArgType>(_status)
2302  );
2303 
2304  this->eventOut_out(
2305  0,
2306  _id,
2307  _logTime,
2309  _logBuff
2310  );
2311  }
2312 
2313  // Emit the event on the text log port
2314 #if FW_ENABLE_TEXT_LOGGING
2315  if (this->isConnected_textEventOut_OutputPort(0)) {
2316 #if FW_OBJECT_NAMES == 1
2317  const char* _formatString =
2318  "(%s) %s: Downlink of %" PRIu32 " bytes started from %s to %s";
2319 #else
2320  const char* _formatString =
2321  "%s: Downlink of %" PRIu32 " bytes started from %s to %s";
2322 #endif
2323 
2324  Fw::TextLogString _logString;
2325  (void) _logString.format(
2326  _formatString,
2327 #if FW_OBJECT_NAMES == 1
2328  this->m_objName.toChar(),
2329 #endif
2330  "SendStarted ",
2331  fileSize,
2332  sourceFileName.toChar(),
2333  destFileName.toChar()
2334  );
2335 
2336  this->textEventOut_out(
2337  0,
2338  _id,
2339  _logTime,
2341  _logString
2342  );
2343  }
2344 #endif
2345  }
2346 
2349  {
2350  // Get the time
2351  Fw::Time _logTime;
2352  if (this->isConnected_timeCaller_OutputPort(0)) {
2353  this->timeCaller_out(0, _logTime);
2354  }
2355 
2357 
2358  // Emit the event on the log port
2359  if (this->isConnected_eventOut_OutputPort(0)) {
2360  Fw::LogBuffer _logBuff;
2362 
2363 #if FW_AMPCS_COMPATIBLE
2364  // Serialize the number of arguments
2365  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2366  FW_ASSERT(
2367  _status == Fw::FW_SERIALIZE_OK,
2368  static_cast<FwAssertArgType>(_status)
2369  );
2370 #endif
2371 
2372  _status = sourceFileName.serializeTo(
2373  _logBuff,
2374  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2375  );
2376  FW_ASSERT(
2377  _status == Fw::FW_SERIALIZE_OK,
2378  static_cast<FwAssertArgType>(_status)
2379  );
2380 
2381  this->eventOut_out(
2382  0,
2383  _id,
2384  _logTime,
2386  _logBuff
2387  );
2388  }
2389 
2390  // Emit the event on the text log port
2391 #if FW_ENABLE_TEXT_LOGGING
2392  if (this->isConnected_textEventOut_OutputPort(0)) {
2393 #if FW_OBJECT_NAMES == 1
2394  const char* _formatString =
2395  "(%s) %s: Downlink of file %s stopped due to zero-size.";
2396 #else
2397  const char* _formatString =
2398  "%s: Downlink of file %s stopped due to zero-size.";
2399 #endif
2400 
2401  Fw::TextLogString _logString;
2402  (void) _logString.format(
2403  _formatString,
2404 #if FW_OBJECT_NAMES == 1
2405  this->m_objName.toChar(),
2406 #endif
2407  "DownlinkZeroSizeFile ",
2408  sourceFileName.toChar()
2409  );
2410 
2411  this->textEventOut_out(
2412  0,
2413  _id,
2414  _logTime,
2416  _logString
2417  );
2418  }
2419 #endif
2420  }
2421 
2424  {
2425  // Get the time
2426  Fw::Time _logTime;
2427  if (this->isConnected_timeCaller_OutputPort(0)) {
2428  this->timeCaller_out(0, _logTime);
2429  }
2430 
2432 
2433  // Emit the event on the log port
2434  if (this->isConnected_eventOut_OutputPort(0)) {
2435  Fw::LogBuffer _logBuff;
2436 
2437 #if FW_AMPCS_COMPATIBLE
2439  // Serialize the number of arguments
2440  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2441  FW_ASSERT(
2442  _status == Fw::FW_SERIALIZE_OK,
2443  static_cast<FwAssertArgType>(_status)
2444  );
2445 #endif
2446 
2447  this->eventOut_out(
2448  0,
2449  _id,
2450  _logTime,
2452  _logBuff
2453  );
2454  }
2455 
2456  // Emit the event on the text log port
2457 #if FW_ENABLE_TEXT_LOGGING
2458  if (this->isConnected_textEventOut_OutputPort(0)) {
2459 #if FW_OBJECT_NAMES == 1
2460  const char* _formatString =
2461  "(%s) %s: Commanded source filename too long";
2462 #else
2463  const char* _formatString =
2464  "%s: Commanded source filename too long";
2465 #endif
2466 
2467  Fw::TextLogString _logString;
2468  (void) _logString.format(
2469  _formatString,
2470 #if FW_OBJECT_NAMES == 1
2471  this->m_objName.toChar(),
2472 #endif
2473  "FilenameSourceOverflow "
2474  );
2475 
2476  this->textEventOut_out(
2477  0,
2478  _id,
2479  _logTime,
2481  _logString
2482  );
2483  }
2484 #endif
2485  }
2486 
2489  {
2490  // Get the time
2491  Fw::Time _logTime;
2492  if (this->isConnected_timeCaller_OutputPort(0)) {
2493  this->timeCaller_out(0, _logTime);
2494  }
2495 
2497 
2498  // Emit the event on the log port
2499  if (this->isConnected_eventOut_OutputPort(0)) {
2500  Fw::LogBuffer _logBuff;
2501 
2502 #if FW_AMPCS_COMPATIBLE
2504  // Serialize the number of arguments
2505  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2506  FW_ASSERT(
2507  _status == Fw::FW_SERIALIZE_OK,
2508  static_cast<FwAssertArgType>(_status)
2509  );
2510 #endif
2511 
2512  this->eventOut_out(
2513  0,
2514  _id,
2515  _logTime,
2517  _logBuff
2518  );
2519  }
2520 
2521  // Emit the event on the text log port
2522 #if FW_ENABLE_TEXT_LOGGING
2523  if (this->isConnected_textEventOut_OutputPort(0)) {
2524 #if FW_OBJECT_NAMES == 1
2525  const char* _formatString =
2526  "(%s) %s: Commanded destination filename too long";
2527 #else
2528  const char* _formatString =
2529  "%s: Commanded destination filename too long";
2530 #endif
2531 
2532  Fw::TextLogString _logString;
2533  (void) _logString.format(
2534  _formatString,
2535 #if FW_OBJECT_NAMES == 1
2536  this->m_objName.toChar(),
2537 #endif
2538  "FilenameDestinationOverflow "
2539  );
2540 
2541  this->textEventOut_out(
2542  0,
2543  _id,
2544  _logTime,
2546  _logString
2547  );
2548  }
2549 #endif
2550  }
2551 
2554  {
2555  // Get the time
2556  Fw::Time _logTime;
2557  if (this->isConnected_timeCaller_OutputPort(0)) {
2558  this->timeCaller_out(0, _logTime);
2559  }
2560 
2561  const FwEventIdType _id = this->getIdBase() + EVENTID_SOURCEOUTOFSANDBOX;
2562 
2563  // Emit the event on the log port
2564  if (this->isConnected_eventOut_OutputPort(0)) {
2565  Fw::LogBuffer _logBuff;
2567 
2568 #if FW_AMPCS_COMPATIBLE
2569  // Serialize the number of arguments
2570  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2571  FW_ASSERT(
2572  _status == Fw::FW_SERIALIZE_OK,
2573  static_cast<FwAssertArgType>(_status)
2574  );
2575 #endif
2576 
2577  _status = fileName.serializeTo(
2578  _logBuff,
2579  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2580  );
2581  FW_ASSERT(
2582  _status == Fw::FW_SERIALIZE_OK,
2583  static_cast<FwAssertArgType>(_status)
2584  );
2585 
2586  this->eventOut_out(
2587  0,
2588  _id,
2589  _logTime,
2591  _logBuff
2592  );
2593  }
2594 
2595  // Emit the event on the text log port
2596 #if FW_ENABLE_TEXT_LOGGING
2597  if (this->isConnected_textEventOut_OutputPort(0)) {
2598 #if FW_OBJECT_NAMES == 1
2599  const char* _formatString =
2600  "(%s) %s: Source file %s is outside the configured read sandbox";
2601 #else
2602  const char* _formatString =
2603  "%s: Source file %s is outside the configured read sandbox";
2604 #endif
2605 
2606  Fw::TextLogString _logString;
2607  (void) _logString.format(
2608  _formatString,
2609 #if FW_OBJECT_NAMES == 1
2610  this->m_objName.toChar(),
2611 #endif
2612  "SourceOutOfSandbox ",
2613  fileName.toChar()
2614  );
2615 
2616  this->textEventOut_out(
2617  0,
2618  _id,
2619  _logTime,
2621  _logString
2622  );
2623  }
2624 #endif
2625  }
2626 
2627  // ----------------------------------------------------------------------
2628  // Telemetry serialized write
2629  // ----------------------------------------------------------------------
2630 
2633  FwChanIdType id,
2634  Fw::TlmBuffer& _tlmBuff,
2635  Fw::Time _tlmTime
2636  ) const
2637  {
2638  if (this->isConnected_tlmOut_OutputPort(0)) {
2639  if (
2641  (_tlmTime == Fw::ZERO_TIME)
2642  ) {
2643  this->timeCaller_out(0, _tlmTime);
2644  }
2645 
2646  FwChanIdType _id;
2647  _id = this->getIdBase() + id;
2648 
2649  this->tlmOut_out(
2650  0,
2651  _id,
2652  _tlmTime,
2653  _tlmBuff
2654  );
2655  }
2656  }
2657 
2658  // ----------------------------------------------------------------------
2659  // Telemetry write functions
2660  // ----------------------------------------------------------------------
2661 
2664  U32 arg,
2665  Fw::Time _tlmTime
2666  ) const
2667  {
2668  if (this->isConnected_tlmOut_OutputPort(0)) {
2669  Fw::TlmBuffer _tlmBuff;
2670  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2671  FW_ASSERT(
2672  _stat == Fw::FW_SERIALIZE_OK,
2673  static_cast<FwAssertArgType>(_stat)
2674  );
2675 
2676  this->tlmWrite(
2678  _tlmBuff,
2679  _tlmTime
2680  );
2681  }
2682  }
2683 
2686  U32 arg,
2687  Fw::Time _tlmTime
2688  ) const
2689  {
2690  if (this->isConnected_tlmOut_OutputPort(0)) {
2691  Fw::TlmBuffer _tlmBuff;
2692  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2693  FW_ASSERT(
2694  _stat == Fw::FW_SERIALIZE_OK,
2695  static_cast<FwAssertArgType>(_stat)
2696  );
2697 
2698  this->tlmWrite(
2700  _tlmBuff,
2701  _tlmTime
2702  );
2703  }
2704  }
2705 
2708  U32 arg,
2709  Fw::Time _tlmTime
2710  ) const
2711  {
2712  if (this->isConnected_tlmOut_OutputPort(0)) {
2713  Fw::TlmBuffer _tlmBuff;
2714  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2715  FW_ASSERT(
2716  _stat == Fw::FW_SERIALIZE_OK,
2717  static_cast<FwAssertArgType>(_stat)
2718  );
2719 
2720  this->tlmWrite(
2722  _tlmBuff,
2723  _tlmTime
2724  );
2725  }
2726  }
2727 
2728  // ----------------------------------------------------------------------
2729  // Time
2730  // ----------------------------------------------------------------------
2731 
2733  getTime() const
2734  {
2735  if (this->isConnected_timeCaller_OutputPort(0)) {
2736  Fw::Time _time;
2737  this->timeCaller_out(0, _time);
2738  return _time;
2739  }
2740  else {
2741  return Fw::Time(TimeBase::TB_NONE, 0, 0);
2742  }
2743  }
2744 
2745  // ----------------------------------------------------------------------
2746  // Mutex operations for guarded ports
2747  //
2748  // You can override these operations to provide more sophisticated
2749  // synchronization
2750  // ----------------------------------------------------------------------
2751 
2754  {
2755  this->m_guardedPortMutex.lock();
2756  }
2757 
2760  {
2761  this->m_guardedPortMutex.unLock();
2762  }
2763 
2764  // ----------------------------------------------------------------------
2765  // Message dispatch functions
2766  // ----------------------------------------------------------------------
2767 
2768  Fw::QueuedComponentBase::MsgDispatchStatus FileDownlinkComponentBase ::
2769  doDispatch()
2770  {
2771  ComponentIpcSerializableBuffer _msg;
2772  FwQueuePriorityType _priority = 0;
2773 
2774  Os::Queue::Status _msgStatus = this->m_queue.receive(
2775  _msg,
2777  _priority
2778  );
2779  FW_ASSERT(
2780  _msgStatus == Os::Queue::OP_OK,
2781  static_cast<FwAssertArgType>(_msgStatus)
2782  );
2783 
2784  // Reset to beginning of buffer
2785  _msg.resetDeser();
2786 
2787  FwEnumStoreType _desMsg = 0;
2788  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
2789  FW_ASSERT(
2790  _deserStatus == Fw::FW_SERIALIZE_OK,
2791  static_cast<FwAssertArgType>(_deserStatus)
2792  );
2793 
2794  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
2795 
2796  if (_msgType == FILEDOWNLINK_COMPONENT_EXIT) {
2797  return MSG_DISPATCH_EXIT;
2798  }
2799 
2800  FwIndexType portNum = 0;
2801  _deserStatus = _msg.deserializeTo(portNum);
2802  FW_ASSERT(
2803  _deserStatus == Fw::FW_SERIALIZE_OK,
2804  static_cast<FwAssertArgType>(_deserStatus)
2805  );
2806 
2807  switch (_msgType) {
2808  // Handle async input port Run
2809  case RUN_SCHED: {
2810  // Deserialize argument context
2811  U32 context;
2812  _deserStatus = _msg.deserializeTo(context);
2813  FW_ASSERT(
2814  _deserStatus == Fw::FW_SERIALIZE_OK,
2815  static_cast<FwAssertArgType>(_deserStatus)
2816  );
2817  // Call handler function
2818  this->Run_handler(
2819  portNum,
2820  context
2821  );
2822 
2823  break;
2824  }
2825 
2826  // Handle async input port bufferReturn
2827  case BUFFERRETURN_BUFFERSEND: {
2828  // Deserialize argument fwBuffer
2829  Fw::Buffer fwBuffer;
2830  _deserStatus = _msg.deserializeTo(fwBuffer);
2831  FW_ASSERT(
2832  _deserStatus == Fw::FW_SERIALIZE_OK,
2833  static_cast<FwAssertArgType>(_deserStatus)
2834  );
2835  // Call handler function
2836  this->bufferReturn_handler(
2837  portNum,
2838  fwBuffer
2839  );
2840 
2841  break;
2842  }
2843 
2844  // Handle async input port pingIn
2845  case PINGIN_PING: {
2846  // Deserialize argument key
2847  U32 key;
2848  _deserStatus = _msg.deserializeTo(key);
2849  FW_ASSERT(
2850  _deserStatus == Fw::FW_SERIALIZE_OK,
2851  static_cast<FwAssertArgType>(_deserStatus)
2852  );
2853  // Call handler function
2854  this->pingIn_handler(
2855  portNum,
2856  key
2857  );
2858 
2859  break;
2860  }
2861 
2862  // Handle command SendFile
2863  case CMD_SENDFILE: {
2864  // Deserialize opcode
2865  FwOpcodeType _opCode = 0;
2866  _deserStatus = _msg.deserializeTo(_opCode);
2867  FW_ASSERT (
2868  _deserStatus == Fw::FW_SERIALIZE_OK,
2869  static_cast<FwAssertArgType>(_deserStatus)
2870  );
2871 
2872  // Deserialize command sequence
2873  U32 _cmdSeq = 0;
2874  _deserStatus = _msg.deserializeTo(_cmdSeq);
2875  FW_ASSERT (
2876  _deserStatus == Fw::FW_SERIALIZE_OK,
2877  static_cast<FwAssertArgType>(_deserStatus)
2878  );
2879 
2880  // Deserialize command argument buffer
2881  Fw::CmdArgBuffer args;
2882  _deserStatus = _msg.deserializeTo(args);
2883  FW_ASSERT (
2884  _deserStatus == Fw::FW_SERIALIZE_OK,
2885  static_cast<FwAssertArgType>(_deserStatus)
2886  );
2887 
2888  // Reset buffer
2889  args.resetDeser();
2890 
2891  // Deserialize argument sourceFileName
2892  Fw::CmdStringArg sourceFileName;
2893  _deserStatus = args.deserializeTo(sourceFileName);
2894  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2896  this->cmdResponse_out(
2897  _opCode,
2898  _cmdSeq,
2900  );
2901  }
2902  // Don't crash the task if bad arguments were passed from the ground
2903  break;
2904  }
2905 
2906  // Deserialize argument destFileName
2907  Fw::CmdStringArg destFileName;
2908  _deserStatus = args.deserializeTo(destFileName);
2909  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2911  this->cmdResponse_out(
2912  _opCode,
2913  _cmdSeq,
2915  );
2916  }
2917  // Don't crash the task if bad arguments were passed from the ground
2918  break;
2919  }
2920 
2921  // Make sure there was no data left over.
2922  // That means the argument buffer size was incorrect.
2923 #if FW_CMD_CHECK_RESIDUAL
2924  if (args.getDeserializeSizeLeft() != 0) {
2926  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2927  }
2928  // Don't crash the task if bad arguments were passed from the ground
2929  break;
2930  }
2931 #endif
2932 
2933  // Call handler function
2934  this->SendFile_cmdHandler(
2935  _opCode, _cmdSeq,
2936  sourceFileName,
2937  destFileName
2938  );
2939 
2940  break;
2941  }
2942 
2943  // Handle command Cancel
2944  case CMD_CANCEL: {
2945  // Deserialize opcode
2946  FwOpcodeType _opCode = 0;
2947  _deserStatus = _msg.deserializeTo(_opCode);
2948  FW_ASSERT (
2949  _deserStatus == Fw::FW_SERIALIZE_OK,
2950  static_cast<FwAssertArgType>(_deserStatus)
2951  );
2952 
2953  // Deserialize command sequence
2954  U32 _cmdSeq = 0;
2955  _deserStatus = _msg.deserializeTo(_cmdSeq);
2956  FW_ASSERT (
2957  _deserStatus == Fw::FW_SERIALIZE_OK,
2958  static_cast<FwAssertArgType>(_deserStatus)
2959  );
2960 
2961  // Deserialize command argument buffer
2962  Fw::CmdArgBuffer args;
2963  _deserStatus = _msg.deserializeTo(args);
2964  FW_ASSERT (
2965  _deserStatus == Fw::FW_SERIALIZE_OK,
2966  static_cast<FwAssertArgType>(_deserStatus)
2967  );
2968 
2969  // Reset buffer
2970  args.resetDeser();
2971 
2972  // Make sure there was no data left over.
2973  // That means the argument buffer size was incorrect.
2974 #if FW_CMD_CHECK_RESIDUAL
2975  if (args.getDeserializeSizeLeft() != 0) {
2977  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2978  }
2979  // Don't crash the task if bad arguments were passed from the ground
2980  break;
2981  }
2982 #endif
2983 
2984  // Call handler function
2985  this->Cancel_cmdHandler(_opCode, _cmdSeq);
2986 
2987  break;
2988  }
2989 
2990  // Handle command SendPartial
2991  case CMD_SENDPARTIAL: {
2992  // Deserialize opcode
2993  FwOpcodeType _opCode = 0;
2994  _deserStatus = _msg.deserializeTo(_opCode);
2995  FW_ASSERT (
2996  _deserStatus == Fw::FW_SERIALIZE_OK,
2997  static_cast<FwAssertArgType>(_deserStatus)
2998  );
2999 
3000  // Deserialize command sequence
3001  U32 _cmdSeq = 0;
3002  _deserStatus = _msg.deserializeTo(_cmdSeq);
3003  FW_ASSERT (
3004  _deserStatus == Fw::FW_SERIALIZE_OK,
3005  static_cast<FwAssertArgType>(_deserStatus)
3006  );
3007 
3008  // Deserialize command argument buffer
3009  Fw::CmdArgBuffer args;
3010  _deserStatus = _msg.deserializeTo(args);
3011  FW_ASSERT (
3012  _deserStatus == Fw::FW_SERIALIZE_OK,
3013  static_cast<FwAssertArgType>(_deserStatus)
3014  );
3015 
3016  // Reset buffer
3017  args.resetDeser();
3018 
3019  // Deserialize argument sourceFileName
3020  Fw::CmdStringArg sourceFileName;
3021  _deserStatus = args.deserializeTo(sourceFileName);
3022  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3024  this->cmdResponse_out(
3025  _opCode,
3026  _cmdSeq,
3028  );
3029  }
3030  // Don't crash the task if bad arguments were passed from the ground
3031  break;
3032  }
3033 
3034  // Deserialize argument destFileName
3035  Fw::CmdStringArg destFileName;
3036  _deserStatus = args.deserializeTo(destFileName);
3037  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3039  this->cmdResponse_out(
3040  _opCode,
3041  _cmdSeq,
3043  );
3044  }
3045  // Don't crash the task if bad arguments were passed from the ground
3046  break;
3047  }
3048 
3049  // Deserialize argument startOffset
3050  U32 startOffset;
3051  _deserStatus = args.deserializeTo(startOffset);
3052  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3054  this->cmdResponse_out(
3055  _opCode,
3056  _cmdSeq,
3058  );
3059  }
3060  // Don't crash the task if bad arguments were passed from the ground
3061  break;
3062  }
3063 
3064  // Deserialize argument length
3065  U32 length;
3066  _deserStatus = args.deserializeTo(length);
3067  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3069  this->cmdResponse_out(
3070  _opCode,
3071  _cmdSeq,
3073  );
3074  }
3075  // Don't crash the task if bad arguments were passed from the ground
3076  break;
3077  }
3078 
3079  // Make sure there was no data left over.
3080  // That means the argument buffer size was incorrect.
3081 #if FW_CMD_CHECK_RESIDUAL
3082  if (args.getDeserializeSizeLeft() != 0) {
3084  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3085  }
3086  // Don't crash the task if bad arguments were passed from the ground
3087  break;
3088  }
3089 #endif
3090 
3091  // Call handler function
3092  this->SendPartial_cmdHandler(
3093  _opCode, _cmdSeq,
3094  sourceFileName,
3095  destFileName,
3096  startOffset,
3097  length
3098  );
3099 
3100  break;
3101  }
3102 
3103  default:
3104  return MSG_DISPATCH_ERROR;
3105  }
3106 
3107  return MSG_DISPATCH_OK;
3108  }
3109 
3110  // ----------------------------------------------------------------------
3111  // Calls for messages received on special input ports
3112  // ----------------------------------------------------------------------
3113 
3114  void FileDownlinkComponentBase ::
3115  m_p_cmdIn_in(
3116  Fw::PassiveComponentBase* callComp,
3117  FwIndexType portNum,
3118  FwOpcodeType opCode,
3119  U32 cmdSeq,
3120  Fw::CmdArgBuffer& args
3121  )
3122  {
3123  FW_ASSERT(callComp != nullptr);
3124  FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
3125  compPtr->cmdIn_handlerBase(
3126  portNum,
3127  opCode,
3128  cmdSeq,
3129  args
3130  );
3131  }
3132 
3133  // ----------------------------------------------------------------------
3134  // Calls for messages received on typed input ports
3135  // ----------------------------------------------------------------------
3136 
3137  void FileDownlinkComponentBase ::
3138  m_p_Run_in(
3139  Fw::PassiveComponentBase* callComp,
3140  FwIndexType portNum,
3141  U32 context
3142  )
3143  {
3144  FW_ASSERT(callComp != nullptr);
3145  FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
3146  compPtr->Run_handlerBase(
3147  portNum,
3148  context
3149  );
3150  }
3151 
3152  Svc::SendFileResponse FileDownlinkComponentBase ::
3153  m_p_SendFile_in(
3154  Fw::PassiveComponentBase* callComp,
3155  FwIndexType portNum,
3156  const Fw::StringBase& sourceFileName,
3157  const Fw::StringBase& destFileName,
3158  U32 offset,
3159  U32 length
3160  )
3161  {
3162  FW_ASSERT(callComp != nullptr);
3163  FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
3164  return compPtr->SendFile_handlerBase(
3165  portNum,
3166  sourceFileName,
3167  destFileName,
3168  offset,
3169  length
3170  );
3171  }
3172 
3173  void FileDownlinkComponentBase ::
3174  m_p_bufferReturn_in(
3175  Fw::PassiveComponentBase* callComp,
3176  FwIndexType portNum,
3177  Fw::Buffer& fwBuffer
3178  )
3179  {
3180  FW_ASSERT(callComp != nullptr);
3181  FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
3182  compPtr->bufferReturn_handlerBase(
3183  portNum,
3184  fwBuffer
3185  );
3186  }
3187 
3188  void FileDownlinkComponentBase ::
3189  m_p_pingIn_in(
3190  Fw::PassiveComponentBase* callComp,
3191  FwIndexType portNum,
3192  U32 key
3193  )
3194  {
3195  FW_ASSERT(callComp != nullptr);
3196  FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
3197  compPtr->pingIn_handlerBase(
3198  portNum,
3199  key
3200  );
3201  }
3202 
3203 #if !FW_DIRECT_PORT_CALLS
3204 
3205  // ----------------------------------------------------------------------
3206  // Invocation functions for special output ports
3207  // ----------------------------------------------------------------------
3208 
3209  void FileDownlinkComponentBase ::
3210  cmdRegOut_out(
3211  FwIndexType portNum,
3212  FwOpcodeType opCode
3213  ) const
3214  {
3215  FW_ASSERT(
3216  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
3217  static_cast<FwAssertArgType>(portNum)
3218  );
3219 
3220  FW_ASSERT(
3221  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
3222  static_cast<FwAssertArgType>(portNum)
3223  );
3224  this->m_cmdRegOut_OutputPort[portNum].invoke(
3225  opCode
3226  );
3227  }
3228 
3229  void FileDownlinkComponentBase ::
3230  cmdResponseOut_out(
3231  FwIndexType portNum,
3232  FwOpcodeType opCode,
3233  U32 cmdSeq,
3234  const Fw::CmdResponse& response
3235  ) const
3236  {
3237  FW_ASSERT(
3238  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
3239  static_cast<FwAssertArgType>(portNum)
3240  );
3241 
3242  FW_ASSERT(
3243  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
3244  static_cast<FwAssertArgType>(portNum)
3245  );
3246  this->m_cmdResponseOut_OutputPort[portNum].invoke(
3247  opCode,
3248  cmdSeq,
3249  response
3250  );
3251  }
3252 
3253  void FileDownlinkComponentBase ::
3254  eventOut_out(
3255  FwIndexType portNum,
3256  FwEventIdType id,
3257  Fw::Time& timeTag,
3258  const Fw::LogSeverity& severity,
3259  Fw::LogBuffer& args
3260  ) const
3261  {
3262  FW_ASSERT(
3263  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
3264  static_cast<FwAssertArgType>(portNum)
3265  );
3266 
3267  FW_ASSERT(
3268  this->m_eventOut_OutputPort[portNum].isConnected(),
3269  static_cast<FwAssertArgType>(portNum)
3270  );
3271  this->m_eventOut_OutputPort[portNum].invoke(
3272  id,
3273  timeTag,
3274  severity,
3275  args
3276  );
3277  }
3278 
3279 #if FW_ENABLE_TEXT_LOGGING
3280 
3281  void FileDownlinkComponentBase ::
3282  textEventOut_out(
3283  FwIndexType portNum,
3284  FwEventIdType id,
3285  Fw::Time& timeTag,
3286  const Fw::LogSeverity& severity,
3287  Fw::TextLogString& text
3288  ) const
3289  {
3290  FW_ASSERT(
3291  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
3292  static_cast<FwAssertArgType>(portNum)
3293  );
3294 
3295  FW_ASSERT(
3296  this->m_textEventOut_OutputPort[portNum].isConnected(),
3297  static_cast<FwAssertArgType>(portNum)
3298  );
3299  this->m_textEventOut_OutputPort[portNum].invoke(
3300  id,
3301  timeTag,
3302  severity,
3303  text
3304  );
3305  }
3306 
3307 #endif
3308 
3309  void FileDownlinkComponentBase ::
3310  timeCaller_out(
3311  FwIndexType portNum,
3312  Fw::Time& time
3313  ) const
3314  {
3315  FW_ASSERT(
3316  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
3317  static_cast<FwAssertArgType>(portNum)
3318  );
3319 
3320  FW_ASSERT(
3321  this->m_timeCaller_OutputPort[portNum].isConnected(),
3322  static_cast<FwAssertArgType>(portNum)
3323  );
3324  this->m_timeCaller_OutputPort[portNum].invoke(
3325  time
3326  );
3327  }
3328 
3329  void FileDownlinkComponentBase ::
3330  tlmOut_out(
3331  FwIndexType portNum,
3332  FwChanIdType id,
3333  Fw::Time& timeTag,
3334  Fw::TlmBuffer& val
3335  ) const
3336  {
3337  FW_ASSERT(
3338  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
3339  static_cast<FwAssertArgType>(portNum)
3340  );
3341 
3342  FW_ASSERT(
3343  this->m_tlmOut_OutputPort[portNum].isConnected(),
3344  static_cast<FwAssertArgType>(portNum)
3345  );
3346  this->m_tlmOut_OutputPort[portNum].invoke(
3347  id,
3348  timeTag,
3349  val
3350  );
3351  }
3352 
3353 #endif
3354 
3355 }
Serialization/Deserialization operation was successful.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
static constexpr FwSizeType CAPACITY
Definition: CmdPortAc.hpp:36
FwIdType FwOpcodeType
The type of a command opcode.
Operation succeeded.
Definition: Os.hpp:27
PlatformSizeType FwSizeType
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:71
I32 FwEnumStoreType
Status
status returned from the queue send function
Definition: Queue.hpp:30
void init()
Initialization function.
Definition: SchedPortAc.cpp:73
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY]
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
static constexpr FwSizeType CAPACITY
void invoke(U32 key) const
Invoke a port connection.
Definition: PingPortAc.cpp:170
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
const Time ZERO_TIME
Definition: Time.cpp:5
void init()
Initialization function.
Definition: TlmPortAc.cpp:171
Enum representing a command response.
No time base has been established (Required)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
void init()
Initialization function.
Os::Queue m_queue
queue object for active component
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:177
void init()
Object initializer.
Definition: ObjBase.cpp:24
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
Message will block until space is available.
Definition: Queue.hpp:47
FwIdType FwEventIdType
The type of an event identifier.
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
static constexpr FwSizeType CAPACITY
Definition: PingPortAc.hpp:34
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
void init()
Initialization function.
Definition: TimePortAc.cpp:151
message to exit active component task
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
#define FW_MIN(a, b)
MIN macro (deprecated in C++, use std::min)
Definition: BasicTypes.h:99
A less serious but recoverable event.
void invoke(Fw::Buffer &fwBuffer) const
Invoke a port connection.
void init()
Initialization function.
Definition: PingPortAc.cpp:151
void init()
Initialization function.
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
void unLock()
unlock the mutex and assert success
FwIdType FwChanIdType
The type of a telemetry channel identifier.
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:157
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
A serious but recoverable event.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
Definition: TlmPortAc.cpp:190
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
void init()
Initialization function.
Definition: LogPortAc.cpp:180
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
BlockingType
message type
Definition: Queue.hpp:46
void init()
Initialization function.
Command failed to deserialize.
void lock()
lock the mutex and assert success
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Important informational events.
void init()
Initialization function.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:79
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
A message was sent requesting an exit of the loop.
PlatformIndexType FwIndexType
Send file response struct.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init()
Initialization function.
void incNumMsgDropped()
increment the number of messages dropped
void init()
Initialization function.
Definition: PingPortAc.cpp:73
RateGroupDivider component implementation.
message sent/received okay
Definition: Queue.hpp:31
U8 BYTE
byte type
Definition: BasicTypes.h:57
void invoke(const Svc::SendFileResponse &resp) const
Invoke a port connection.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:79
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
void init()
Initialization function.
void addCallPort(InputSendFileCompletePort *callPort)
Register an input port.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
static constexpr FwSizeType CAPACITY
Definition: SchedPortAc.hpp:34
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.
BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY]