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  FW_ASSERT(
1178  qStatus == Os::Queue::OP_OK,
1179  static_cast<FwAssertArgType>(qStatus)
1180  );
1181  }
1182 
1183  // ----------------------------------------------------------------------
1184  // Pre-message hooks for typed async input ports
1185  //
1186  // Each of these functions is invoked just before processing a message
1187  // on the corresponding port. By default, they do nothing. You can
1188  // override them to provide specific pre-message behavior.
1189  // ----------------------------------------------------------------------
1190 
1193  FwIndexType portNum,
1194  U32 context
1195  )
1196  {
1197  // Default: no-op
1198  }
1199 
1202  FwIndexType portNum,
1203  Fw::Buffer& fwBuffer
1204  )
1205  {
1206  // Default: no-op
1207  }
1208 
1211  FwIndexType portNum,
1212  U32 key
1213  )
1214  {
1215  // Default: no-op
1216  }
1217 
1218 #if !FW_DIRECT_PORT_CALLS
1219 
1220  // ----------------------------------------------------------------------
1221  // Invocation functions for typed output ports
1222  // ----------------------------------------------------------------------
1223 
1226  FwIndexType portNum,
1227  const Svc::SendFileResponse& resp
1228  ) const
1229  {
1230  FW_ASSERT(
1231  (0 <= portNum) && (portNum < this->getNum_FileComplete_OutputPorts()),
1232  static_cast<FwAssertArgType>(portNum)
1233  );
1234 
1235  FW_ASSERT(
1236  this->m_FileComplete_OutputPort[portNum].isConnected(),
1237  static_cast<FwAssertArgType>(portNum)
1238  );
1239  this->m_FileComplete_OutputPort[portNum].invoke(
1240  resp
1241  );
1242  }
1243 
1246  FwIndexType portNum,
1247  Fw::Buffer& fwBuffer
1248  ) const
1249  {
1250  FW_ASSERT(
1251  (0 <= portNum) && (portNum < this->getNum_bufferSendOut_OutputPorts()),
1252  static_cast<FwAssertArgType>(portNum)
1253  );
1254 
1255  FW_ASSERT(
1256  this->m_bufferSendOut_OutputPort[portNum].isConnected(),
1257  static_cast<FwAssertArgType>(portNum)
1258  );
1259  this->m_bufferSendOut_OutputPort[portNum].invoke(
1260  fwBuffer
1261  );
1262  }
1263 
1266  FwIndexType portNum,
1267  U32 key
1268  ) const
1269  {
1270  FW_ASSERT(
1271  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1272  static_cast<FwAssertArgType>(portNum)
1273  );
1274 
1275  FW_ASSERT(
1276  this->m_pingOut_OutputPort[portNum].isConnected(),
1277  static_cast<FwAssertArgType>(portNum)
1278  );
1279  this->m_pingOut_OutputPort[portNum].invoke(
1280  key
1281  );
1282  }
1283 
1284 #endif
1285 
1286  // ----------------------------------------------------------------------
1287  // Command response
1288  // ----------------------------------------------------------------------
1289 
1292  FwOpcodeType opCode,
1293  U32 cmdSeq,
1294  Fw::CmdResponse response
1295  )
1296  {
1298  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
1299  }
1300 
1301  // ----------------------------------------------------------------------
1302  // Command handler base-class functions
1303  //
1304  // Call these functions directly to bypass the command input port
1305  // ----------------------------------------------------------------------
1306 
1309  FwOpcodeType opCode,
1310  U32 cmdSeq,
1311  Fw::CmdArgBuffer& args
1312  )
1313  {
1314  // Call pre-message hook
1315  this->SendFile_preMsgHook(opCode,cmdSeq);
1316 
1317  // Defer deserializing arguments to the message dispatcher
1318  // to avoid deserializing and reserializing just for IPC
1319  ComponentIpcSerializableBuffer msg;
1321 
1322  // Serialize for IPC
1323  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SENDFILE));
1324  FW_ASSERT (
1325  _status == Fw::FW_SERIALIZE_OK,
1326  static_cast<FwAssertArgType>(_status)
1327  );
1328 
1329  // Fake port number to make message dequeue work
1330  FwIndexType port = 0;
1331 
1332  _status = msg.serializeFrom(port);
1333  FW_ASSERT (
1334  _status == Fw::FW_SERIALIZE_OK,
1335  static_cast<FwAssertArgType>(_status)
1336  );
1337 
1338  _status = msg.serializeFrom(opCode);
1339  FW_ASSERT (
1340  _status == Fw::FW_SERIALIZE_OK,
1341  static_cast<FwAssertArgType>(_status)
1342  );
1343 
1344  _status = msg.serializeFrom(cmdSeq);
1345  FW_ASSERT (
1346  _status == Fw::FW_SERIALIZE_OK,
1347  static_cast<FwAssertArgType>(_status)
1348  );
1349 
1350  _status = msg.serializeFrom(args);
1351  FW_ASSERT (
1352  _status == Fw::FW_SERIALIZE_OK,
1353  static_cast<FwAssertArgType>(_status)
1354  );
1355 
1356  // Send message
1358  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1359 
1360  FW_ASSERT(
1361  qStatus == Os::Queue::OP_OK,
1362  static_cast<FwAssertArgType>(qStatus)
1363  );
1364  }
1365 
1368  FwOpcodeType opCode,
1369  U32 cmdSeq,
1370  Fw::CmdArgBuffer& args
1371  )
1372  {
1373  // Call pre-message hook
1374  this->Cancel_preMsgHook(opCode,cmdSeq);
1375 
1376  // Defer deserializing arguments to the message dispatcher
1377  // to avoid deserializing and reserializing just for IPC
1378  ComponentIpcSerializableBuffer msg;
1380 
1381  // Serialize for IPC
1382  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CANCEL));
1383  FW_ASSERT (
1384  _status == Fw::FW_SERIALIZE_OK,
1385  static_cast<FwAssertArgType>(_status)
1386  );
1387 
1388  // Fake port number to make message dequeue work
1389  FwIndexType port = 0;
1390 
1391  _status = msg.serializeFrom(port);
1392  FW_ASSERT (
1393  _status == Fw::FW_SERIALIZE_OK,
1394  static_cast<FwAssertArgType>(_status)
1395  );
1396 
1397  _status = msg.serializeFrom(opCode);
1398  FW_ASSERT (
1399  _status == Fw::FW_SERIALIZE_OK,
1400  static_cast<FwAssertArgType>(_status)
1401  );
1402 
1403  _status = msg.serializeFrom(cmdSeq);
1404  FW_ASSERT (
1405  _status == Fw::FW_SERIALIZE_OK,
1406  static_cast<FwAssertArgType>(_status)
1407  );
1408 
1409  _status = msg.serializeFrom(args);
1410  FW_ASSERT (
1411  _status == Fw::FW_SERIALIZE_OK,
1412  static_cast<FwAssertArgType>(_status)
1413  );
1414 
1415  // Send message
1417  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1418 
1419  FW_ASSERT(
1420  qStatus == Os::Queue::OP_OK,
1421  static_cast<FwAssertArgType>(qStatus)
1422  );
1423  }
1424 
1427  FwOpcodeType opCode,
1428  U32 cmdSeq,
1429  Fw::CmdArgBuffer& args
1430  )
1431  {
1432  // Call pre-message hook
1433  this->SendPartial_preMsgHook(opCode,cmdSeq);
1434 
1435  // Defer deserializing arguments to the message dispatcher
1436  // to avoid deserializing and reserializing just for IPC
1437  ComponentIpcSerializableBuffer msg;
1439 
1440  // Serialize for IPC
1441  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SENDPARTIAL));
1442  FW_ASSERT (
1443  _status == Fw::FW_SERIALIZE_OK,
1444  static_cast<FwAssertArgType>(_status)
1445  );
1446 
1447  // Fake port number to make message dequeue work
1448  FwIndexType port = 0;
1449 
1450  _status = msg.serializeFrom(port);
1451  FW_ASSERT (
1452  _status == Fw::FW_SERIALIZE_OK,
1453  static_cast<FwAssertArgType>(_status)
1454  );
1455 
1456  _status = msg.serializeFrom(opCode);
1457  FW_ASSERT (
1458  _status == Fw::FW_SERIALIZE_OK,
1459  static_cast<FwAssertArgType>(_status)
1460  );
1461 
1462  _status = msg.serializeFrom(cmdSeq);
1463  FW_ASSERT (
1464  _status == Fw::FW_SERIALIZE_OK,
1465  static_cast<FwAssertArgType>(_status)
1466  );
1467 
1468  _status = msg.serializeFrom(args);
1469  FW_ASSERT (
1470  _status == Fw::FW_SERIALIZE_OK,
1471  static_cast<FwAssertArgType>(_status)
1472  );
1473 
1474  // Send message
1476  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1477 
1478  FW_ASSERT(
1479  qStatus == Os::Queue::OP_OK,
1480  static_cast<FwAssertArgType>(qStatus)
1481  );
1482  }
1483 
1484  // ----------------------------------------------------------------------
1485  // Pre-message hooks for async commands
1486  //
1487  // Each of these functions is invoked just before processing the
1488  // corresponding command. By default they do nothing. You can
1489  // override them to provide specific pre-command behavior.
1490  // ----------------------------------------------------------------------
1491 
1494  FwOpcodeType opCode,
1495  U32 cmdSeq
1496  )
1497  {
1498  // Defaults to no-op; can be overridden
1499  (void) opCode;
1500  (void) cmdSeq;
1501  }
1502 
1505  FwOpcodeType opCode,
1506  U32 cmdSeq
1507  )
1508  {
1509  // Defaults to no-op; can be overridden
1510  (void) opCode;
1511  (void) cmdSeq;
1512  }
1513 
1516  FwOpcodeType opCode,
1517  U32 cmdSeq
1518  )
1519  {
1520  // Defaults to no-op; can be overridden
1521  (void) opCode;
1522  (void) cmdSeq;
1523  }
1524 
1525  // ----------------------------------------------------------------------
1526  // Event logging functions
1527  // ----------------------------------------------------------------------
1528 
1531  {
1532  // Get the time
1533  Fw::Time _logTime;
1534  if (this->isConnected_timeCaller_OutputPort(0)) {
1535  this->timeCaller_out(0, _logTime);
1536  }
1537 
1538  const FwEventIdType _id = this->getIdBase() + EVENTID_FILEOPENERROR;
1539 
1540  // Emit the event on the log port
1541  if (this->isConnected_eventOut_OutputPort(0)) {
1542  Fw::LogBuffer _logBuff;
1544 
1545 #if FW_AMPCS_COMPATIBLE
1546  // Serialize the number of arguments
1547  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1548  FW_ASSERT(
1549  _status == Fw::FW_SERIALIZE_OK,
1550  static_cast<FwAssertArgType>(_status)
1551  );
1552 #endif
1553 
1554  _status = fileName.serializeTo(
1555  _logBuff,
1556  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1557  );
1558  FW_ASSERT(
1559  _status == Fw::FW_SERIALIZE_OK,
1560  static_cast<FwAssertArgType>(_status)
1561  );
1562 
1563  this->eventOut_out(
1564  0,
1565  _id,
1566  _logTime,
1568  _logBuff
1569  );
1570  }
1571 
1572  // Emit the event on the text log port
1573 #if FW_ENABLE_TEXT_LOGGING
1574  if (this->isConnected_textEventOut_OutputPort(0)) {
1575 #if FW_OBJECT_NAMES == 1
1576  const char* _formatString =
1577  "(%s) %s: Could not open file %s";
1578 #else
1579  const char* _formatString =
1580  "%s: Could not open file %s";
1581 #endif
1582 
1583  Fw::TextLogString _logString;
1584  (void) _logString.format(
1585  _formatString,
1586 #if FW_OBJECT_NAMES == 1
1587  this->m_objName.toChar(),
1588 #endif
1589  "FileOpenError ",
1590  fileName.toChar()
1591  );
1592 
1593  this->textEventOut_out(
1594  0,
1595  _id,
1596  _logTime,
1598  _logString
1599  );
1600  }
1601 #endif
1602  }
1603 
1606  const Fw::StringBase& fileName,
1607  I32 status
1608  ) const
1609  {
1610  // Get the time
1611  Fw::Time _logTime;
1612  if (this->isConnected_timeCaller_OutputPort(0)) {
1613  this->timeCaller_out(0, _logTime);
1614  }
1615 
1616  const FwEventIdType _id = this->getIdBase() + EVENTID_FILEREADERROR;
1617 
1618  // Emit the event on the log port
1619  if (this->isConnected_eventOut_OutputPort(0)) {
1620  Fw::LogBuffer _logBuff;
1622 
1623 #if FW_AMPCS_COMPATIBLE
1624  // Serialize the number of arguments
1625  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1626  FW_ASSERT(
1627  _status == Fw::FW_SERIALIZE_OK,
1628  static_cast<FwAssertArgType>(_status)
1629  );
1630 #endif
1631 
1632  _status = fileName.serializeTo(
1633  _logBuff,
1634  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1635  );
1636  FW_ASSERT(
1637  _status == Fw::FW_SERIALIZE_OK,
1638  static_cast<FwAssertArgType>(_status)
1639  );
1640 
1641 #if FW_AMPCS_COMPATIBLE
1642  // Serialize the argument size
1643  _status = _logBuff.serializeFrom(
1644  static_cast<U8>(sizeof(I32))
1645  );
1646  FW_ASSERT(
1647  _status == Fw::FW_SERIALIZE_OK,
1648  static_cast<FwAssertArgType>(_status)
1649  );
1650 #endif
1651  _status = _logBuff.serializeFrom(status);
1652  FW_ASSERT(
1653  _status == Fw::FW_SERIALIZE_OK,
1654  static_cast<FwAssertArgType>(_status)
1655  );
1656 
1657  this->eventOut_out(
1658  0,
1659  _id,
1660  _logTime,
1662  _logBuff
1663  );
1664  }
1665 
1666  // Emit the event on the text log port
1667 #if FW_ENABLE_TEXT_LOGGING
1668  if (this->isConnected_textEventOut_OutputPort(0)) {
1669 #if FW_OBJECT_NAMES == 1
1670  const char* _formatString =
1671  "(%s) %s: Could not read file %s with status %" PRIi32 "";
1672 #else
1673  const char* _formatString =
1674  "%s: Could not read file %s with status %" PRIi32 "";
1675 #endif
1676 
1677  Fw::TextLogString _logString;
1678  (void) _logString.format(
1679  _formatString,
1680 #if FW_OBJECT_NAMES == 1
1681  this->m_objName.toChar(),
1682 #endif
1683  "FileReadError ",
1684  fileName.toChar(),
1685  status
1686  );
1687 
1688  this->textEventOut_out(
1689  0,
1690  _id,
1691  _logTime,
1693  _logString
1694  );
1695  }
1696 #endif
1697  }
1698 
1701  const Fw::StringBase& sourceFileName,
1702  const Fw::StringBase& destFileName
1703  ) const
1704  {
1705  // Get the time
1706  Fw::Time _logTime;
1707  if (this->isConnected_timeCaller_OutputPort(0)) {
1708  this->timeCaller_out(0, _logTime);
1709  }
1710 
1711  const FwEventIdType _id = this->getIdBase() + EVENTID_FILESENT;
1712 
1713  // Emit the event on the log port
1714  if (this->isConnected_eventOut_OutputPort(0)) {
1715  Fw::LogBuffer _logBuff;
1717 
1718 #if FW_AMPCS_COMPATIBLE
1719  // Serialize the number of arguments
1720  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1721  FW_ASSERT(
1722  _status == Fw::FW_SERIALIZE_OK,
1723  static_cast<FwAssertArgType>(_status)
1724  );
1725 #endif
1726 
1727  _status = sourceFileName.serializeTo(
1728  _logBuff,
1729  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1730  );
1731  FW_ASSERT(
1732  _status == Fw::FW_SERIALIZE_OK,
1733  static_cast<FwAssertArgType>(_status)
1734  );
1735 
1736  _status = destFileName.serializeTo(
1737  _logBuff,
1738  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1739  );
1740  FW_ASSERT(
1741  _status == Fw::FW_SERIALIZE_OK,
1742  static_cast<FwAssertArgType>(_status)
1743  );
1744 
1745  this->eventOut_out(
1746  0,
1747  _id,
1748  _logTime,
1750  _logBuff
1751  );
1752  }
1753 
1754  // Emit the event on the text log port
1755 #if FW_ENABLE_TEXT_LOGGING
1756  if (this->isConnected_textEventOut_OutputPort(0)) {
1757 #if FW_OBJECT_NAMES == 1
1758  const char* _formatString =
1759  "(%s) %s: Sent file %s to file %s";
1760 #else
1761  const char* _formatString =
1762  "%s: Sent file %s to file %s";
1763 #endif
1764 
1765  Fw::TextLogString _logString;
1766  (void) _logString.format(
1767  _formatString,
1768 #if FW_OBJECT_NAMES == 1
1769  this->m_objName.toChar(),
1770 #endif
1771  "FileSent ",
1772  sourceFileName.toChar(),
1773  destFileName.toChar()
1774  );
1775 
1776  this->textEventOut_out(
1777  0,
1778  _id,
1779  _logTime,
1781  _logString
1782  );
1783  }
1784 #endif
1785  }
1786 
1789  const Fw::StringBase& sourceFileName,
1790  const Fw::StringBase& destFileName
1791  ) const
1792  {
1793  // Get the time
1794  Fw::Time _logTime;
1795  if (this->isConnected_timeCaller_OutputPort(0)) {
1796  this->timeCaller_out(0, _logTime);
1797  }
1798 
1799  const FwEventIdType _id = this->getIdBase() + EVENTID_DOWNLINKCANCELED;
1800 
1801  // Emit the event on the log port
1802  if (this->isConnected_eventOut_OutputPort(0)) {
1803  Fw::LogBuffer _logBuff;
1805 
1806 #if FW_AMPCS_COMPATIBLE
1807  // Serialize the number of arguments
1808  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1809  FW_ASSERT(
1810  _status == Fw::FW_SERIALIZE_OK,
1811  static_cast<FwAssertArgType>(_status)
1812  );
1813 #endif
1814 
1815  _status = sourceFileName.serializeTo(
1816  _logBuff,
1817  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1818  );
1819  FW_ASSERT(
1820  _status == Fw::FW_SERIALIZE_OK,
1821  static_cast<FwAssertArgType>(_status)
1822  );
1823 
1824  _status = destFileName.serializeTo(
1825  _logBuff,
1826  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1827  );
1828  FW_ASSERT(
1829  _status == Fw::FW_SERIALIZE_OK,
1830  static_cast<FwAssertArgType>(_status)
1831  );
1832 
1833  this->eventOut_out(
1834  0,
1835  _id,
1836  _logTime,
1838  _logBuff
1839  );
1840  }
1841 
1842  // Emit the event on the text log port
1843 #if FW_ENABLE_TEXT_LOGGING
1844  if (this->isConnected_textEventOut_OutputPort(0)) {
1845 #if FW_OBJECT_NAMES == 1
1846  const char* _formatString =
1847  "(%s) %s: Canceled downlink of file %s to file %s";
1848 #else
1849  const char* _formatString =
1850  "%s: Canceled downlink of file %s to file %s";
1851 #endif
1852 
1853  Fw::TextLogString _logString;
1854  (void) _logString.format(
1855  _formatString,
1856 #if FW_OBJECT_NAMES == 1
1857  this->m_objName.toChar(),
1858 #endif
1859  "DownlinkCanceled ",
1860  sourceFileName.toChar(),
1861  destFileName.toChar()
1862  );
1863 
1864  this->textEventOut_out(
1865  0,
1866  _id,
1867  _logTime,
1869  _logString
1870  );
1871  }
1872 #endif
1873  }
1874 
1877  U32 startOffset,
1878  U32 length,
1879  U32 filesize,
1880  const Fw::StringBase& sourceFileName,
1881  const Fw::StringBase& destFileName
1882  ) const
1883  {
1884  // Get the time
1885  Fw::Time _logTime;
1886  if (this->isConnected_timeCaller_OutputPort(0)) {
1887  this->timeCaller_out(0, _logTime);
1888  }
1889 
1891 
1892  // Emit the event on the log port
1893  if (this->isConnected_eventOut_OutputPort(0)) {
1894  Fw::LogBuffer _logBuff;
1896 
1897 #if FW_AMPCS_COMPATIBLE
1898  // Serialize the number of arguments
1899  _status = _logBuff.serializeFrom(static_cast<U8>(5));
1900  FW_ASSERT(
1901  _status == Fw::FW_SERIALIZE_OK,
1902  static_cast<FwAssertArgType>(_status)
1903  );
1904 #endif
1905 
1906 #if FW_AMPCS_COMPATIBLE
1907  // Serialize the argument size
1908  _status = _logBuff.serializeFrom(
1909  static_cast<U8>(sizeof(U32))
1910  );
1911  FW_ASSERT(
1912  _status == Fw::FW_SERIALIZE_OK,
1913  static_cast<FwAssertArgType>(_status)
1914  );
1915 #endif
1916  _status = _logBuff.serializeFrom(startOffset);
1917  FW_ASSERT(
1918  _status == Fw::FW_SERIALIZE_OK,
1919  static_cast<FwAssertArgType>(_status)
1920  );
1921 
1922 #if FW_AMPCS_COMPATIBLE
1923  // Serialize the argument size
1924  _status = _logBuff.serializeFrom(
1925  static_cast<U8>(sizeof(U32))
1926  );
1927  FW_ASSERT(
1928  _status == Fw::FW_SERIALIZE_OK,
1929  static_cast<FwAssertArgType>(_status)
1930  );
1931 #endif
1932  _status = _logBuff.serializeFrom(length);
1933  FW_ASSERT(
1934  _status == Fw::FW_SERIALIZE_OK,
1935  static_cast<FwAssertArgType>(_status)
1936  );
1937 
1938 #if FW_AMPCS_COMPATIBLE
1939  // Serialize the argument size
1940  _status = _logBuff.serializeFrom(
1941  static_cast<U8>(sizeof(U32))
1942  );
1943  FW_ASSERT(
1944  _status == Fw::FW_SERIALIZE_OK,
1945  static_cast<FwAssertArgType>(_status)
1946  );
1947 #endif
1948  _status = _logBuff.serializeFrom(filesize);
1949  FW_ASSERT(
1950  _status == Fw::FW_SERIALIZE_OK,
1951  static_cast<FwAssertArgType>(_status)
1952  );
1953 
1954  _status = sourceFileName.serializeTo(
1955  _logBuff,
1956  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1957  );
1958  FW_ASSERT(
1959  _status == Fw::FW_SERIALIZE_OK,
1960  static_cast<FwAssertArgType>(_status)
1961  );
1962 
1963  _status = destFileName.serializeTo(
1964  _logBuff,
1965  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
1966  );
1967  FW_ASSERT(
1968  _status == Fw::FW_SERIALIZE_OK,
1969  static_cast<FwAssertArgType>(_status)
1970  );
1971 
1972  this->eventOut_out(
1973  0,
1974  _id,
1975  _logTime,
1977  _logBuff
1978  );
1979  }
1980 
1981  // Emit the event on the text log port
1982 #if FW_ENABLE_TEXT_LOGGING
1983  if (this->isConnected_textEventOut_OutputPort(0)) {
1984 #if FW_OBJECT_NAMES == 1
1985  const char* _formatString =
1986  "(%s) %s: Offset %" PRIu32 " plus length %" PRIu32 " is greater than source size %" PRIu32 " for partial downlink of file %s to file %s. ";
1987 #else
1988  const char* _formatString =
1989  "%s: Offset %" PRIu32 " plus length %" PRIu32 " is greater than source size %" PRIu32 " for partial downlink of file %s to file %s. ";
1990 #endif
1991 
1992  Fw::TextLogString _logString;
1993  (void) _logString.format(
1994  _formatString,
1995 #if FW_OBJECT_NAMES == 1
1996  this->m_objName.toChar(),
1997 #endif
1998  "DownlinkPartialWarning ",
1999  startOffset,
2000  length,
2001  filesize,
2002  sourceFileName.toChar(),
2003  destFileName.toChar()
2004  );
2005 
2006  this->textEventOut_out(
2007  0,
2008  _id,
2009  _logTime,
2011  _logString
2012  );
2013  }
2014 #endif
2015  }
2016 
2019  const Fw::StringBase& sourceFileName,
2020  const Fw::StringBase& destFileName,
2021  U32 startOffset,
2022  U32 filesize
2023  ) const
2024  {
2025  // Get the time
2026  Fw::Time _logTime;
2027  if (this->isConnected_timeCaller_OutputPort(0)) {
2028  this->timeCaller_out(0, _logTime);
2029  }
2030 
2031  const FwEventIdType _id = this->getIdBase() + EVENTID_DOWNLINKPARTIALFAIL;
2032 
2033  // Emit the event on the log port
2034  if (this->isConnected_eventOut_OutputPort(0)) {
2035  Fw::LogBuffer _logBuff;
2037 
2038 #if FW_AMPCS_COMPATIBLE
2039  // Serialize the number of arguments
2040  _status = _logBuff.serializeFrom(static_cast<U8>(4));
2041  FW_ASSERT(
2042  _status == Fw::FW_SERIALIZE_OK,
2043  static_cast<FwAssertArgType>(_status)
2044  );
2045 #endif
2046 
2047  _status = sourceFileName.serializeTo(
2048  _logBuff,
2049  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2050  );
2051  FW_ASSERT(
2052  _status == Fw::FW_SERIALIZE_OK,
2053  static_cast<FwAssertArgType>(_status)
2054  );
2055 
2056  _status = destFileName.serializeTo(
2057  _logBuff,
2058  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2059  );
2060  FW_ASSERT(
2061  _status == Fw::FW_SERIALIZE_OK,
2062  static_cast<FwAssertArgType>(_status)
2063  );
2064 
2065 #if FW_AMPCS_COMPATIBLE
2066  // Serialize the argument size
2067  _status = _logBuff.serializeFrom(
2068  static_cast<U8>(sizeof(U32))
2069  );
2070  FW_ASSERT(
2071  _status == Fw::FW_SERIALIZE_OK,
2072  static_cast<FwAssertArgType>(_status)
2073  );
2074 #endif
2075  _status = _logBuff.serializeFrom(startOffset);
2076  FW_ASSERT(
2077  _status == Fw::FW_SERIALIZE_OK,
2078  static_cast<FwAssertArgType>(_status)
2079  );
2080 
2081 #if FW_AMPCS_COMPATIBLE
2082  // Serialize the argument size
2083  _status = _logBuff.serializeFrom(
2084  static_cast<U8>(sizeof(U32))
2085  );
2086  FW_ASSERT(
2087  _status == Fw::FW_SERIALIZE_OK,
2088  static_cast<FwAssertArgType>(_status)
2089  );
2090 #endif
2091  _status = _logBuff.serializeFrom(filesize);
2092  FW_ASSERT(
2093  _status == Fw::FW_SERIALIZE_OK,
2094  static_cast<FwAssertArgType>(_status)
2095  );
2096 
2097  this->eventOut_out(
2098  0,
2099  _id,
2100  _logTime,
2102  _logBuff
2103  );
2104  }
2105 
2106  // Emit the event on the text log port
2107 #if FW_ENABLE_TEXT_LOGGING
2108  if (this->isConnected_textEventOut_OutputPort(0)) {
2109 #if FW_OBJECT_NAMES == 1
2110  const char* _formatString =
2111  "(%s) %s: Error occurred during partial downlink of file %s to file %s. Offset %" PRIu32 " greater than or equal to source filesize %" PRIu32 ".";
2112 #else
2113  const char* _formatString =
2114  "%s: Error occurred during partial downlink of file %s to file %s. Offset %" PRIu32 " greater than or equal to source filesize %" PRIu32 ".";
2115 #endif
2116 
2117  Fw::TextLogString _logString;
2118  (void) _logString.format(
2119  _formatString,
2120 #if FW_OBJECT_NAMES == 1
2121  this->m_objName.toChar(),
2122 #endif
2123  "DownlinkPartialFail ",
2124  sourceFileName.toChar(),
2125  destFileName.toChar(),
2126  startOffset,
2127  filesize
2128  );
2129 
2130  this->textEventOut_out(
2131  0,
2132  _id,
2133  _logTime,
2135  _logString
2136  );
2137  }
2138 #endif
2139  }
2140 
2143  const Fw::StringBase& sourceFileName,
2144  U32 byteOffset
2145  ) const
2146  {
2147  // Get the time
2148  Fw::Time _logTime;
2149  if (this->isConnected_timeCaller_OutputPort(0)) {
2150  this->timeCaller_out(0, _logTime);
2151  }
2152 
2153  const FwEventIdType _id = this->getIdBase() + EVENTID_SENDDATAFAIL;
2154 
2155  // Emit the event on the log port
2156  if (this->isConnected_eventOut_OutputPort(0)) {
2157  Fw::LogBuffer _logBuff;
2159 
2160 #if FW_AMPCS_COMPATIBLE
2161  // Serialize the number of arguments
2162  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2163  FW_ASSERT(
2164  _status == Fw::FW_SERIALIZE_OK,
2165  static_cast<FwAssertArgType>(_status)
2166  );
2167 #endif
2168 
2169  _status = sourceFileName.serializeTo(
2170  _logBuff,
2171  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2172  );
2173  FW_ASSERT(
2174  _status == Fw::FW_SERIALIZE_OK,
2175  static_cast<FwAssertArgType>(_status)
2176  );
2177 
2178 #if FW_AMPCS_COMPATIBLE
2179  // Serialize the argument size
2180  _status = _logBuff.serializeFrom(
2181  static_cast<U8>(sizeof(U32))
2182  );
2183  FW_ASSERT(
2184  _status == Fw::FW_SERIALIZE_OK,
2185  static_cast<FwAssertArgType>(_status)
2186  );
2187 #endif
2188  _status = _logBuff.serializeFrom(byteOffset);
2189  FW_ASSERT(
2190  _status == Fw::FW_SERIALIZE_OK,
2191  static_cast<FwAssertArgType>(_status)
2192  );
2193 
2194  this->eventOut_out(
2195  0,
2196  _id,
2197  _logTime,
2199  _logBuff
2200  );
2201  }
2202 
2203  // Emit the event on the text log port
2204 #if FW_ENABLE_TEXT_LOGGING
2205  if (this->isConnected_textEventOut_OutputPort(0)) {
2206 #if FW_OBJECT_NAMES == 1
2207  const char* _formatString =
2208  "(%s) %s: Failed to send data packet from file %s at byte offset %" PRIu32 ".";
2209 #else
2210  const char* _formatString =
2211  "%s: Failed to send data packet from file %s at byte offset %" PRIu32 ".";
2212 #endif
2213 
2214  Fw::TextLogString _logString;
2215  (void) _logString.format(
2216  _formatString,
2217 #if FW_OBJECT_NAMES == 1
2218  this->m_objName.toChar(),
2219 #endif
2220  "SendDataFail ",
2221  sourceFileName.toChar(),
2222  byteOffset
2223  );
2224 
2225  this->textEventOut_out(
2226  0,
2227  _id,
2228  _logTime,
2230  _logString
2231  );
2232  }
2233 #endif
2234  }
2235 
2238  U32 fileSize,
2239  const Fw::StringBase& sourceFileName,
2240  const Fw::StringBase& destFileName
2241  ) const
2242  {
2243  // Get the time
2244  Fw::Time _logTime;
2245  if (this->isConnected_timeCaller_OutputPort(0)) {
2246  this->timeCaller_out(0, _logTime);
2247  }
2248 
2249  const FwEventIdType _id = this->getIdBase() + EVENTID_SENDSTARTED;
2250 
2251  // Emit the event on the log port
2252  if (this->isConnected_eventOut_OutputPort(0)) {
2253  Fw::LogBuffer _logBuff;
2255 
2256 #if FW_AMPCS_COMPATIBLE
2257  // Serialize the number of arguments
2258  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2259  FW_ASSERT(
2260  _status == Fw::FW_SERIALIZE_OK,
2261  static_cast<FwAssertArgType>(_status)
2262  );
2263 #endif
2264 
2265 #if FW_AMPCS_COMPATIBLE
2266  // Serialize the argument size
2267  _status = _logBuff.serializeFrom(
2268  static_cast<U8>(sizeof(U32))
2269  );
2270  FW_ASSERT(
2271  _status == Fw::FW_SERIALIZE_OK,
2272  static_cast<FwAssertArgType>(_status)
2273  );
2274 #endif
2275  _status = _logBuff.serializeFrom(fileSize);
2276  FW_ASSERT(
2277  _status == Fw::FW_SERIALIZE_OK,
2278  static_cast<FwAssertArgType>(_status)
2279  );
2280 
2281  _status = sourceFileName.serializeTo(
2282  _logBuff,
2283  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2284  );
2285  FW_ASSERT(
2286  _status == Fw::FW_SERIALIZE_OK,
2287  static_cast<FwAssertArgType>(_status)
2288  );
2289 
2290  _status = destFileName.serializeTo(
2291  _logBuff,
2292  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2293  );
2294  FW_ASSERT(
2295  _status == Fw::FW_SERIALIZE_OK,
2296  static_cast<FwAssertArgType>(_status)
2297  );
2298 
2299  this->eventOut_out(
2300  0,
2301  _id,
2302  _logTime,
2304  _logBuff
2305  );
2306  }
2307 
2308  // Emit the event on the text log port
2309 #if FW_ENABLE_TEXT_LOGGING
2310  if (this->isConnected_textEventOut_OutputPort(0)) {
2311 #if FW_OBJECT_NAMES == 1
2312  const char* _formatString =
2313  "(%s) %s: Downlink of %" PRIu32 " bytes started from %s to %s";
2314 #else
2315  const char* _formatString =
2316  "%s: Downlink of %" PRIu32 " bytes started from %s to %s";
2317 #endif
2318 
2319  Fw::TextLogString _logString;
2320  (void) _logString.format(
2321  _formatString,
2322 #if FW_OBJECT_NAMES == 1
2323  this->m_objName.toChar(),
2324 #endif
2325  "SendStarted ",
2326  fileSize,
2327  sourceFileName.toChar(),
2328  destFileName.toChar()
2329  );
2330 
2331  this->textEventOut_out(
2332  0,
2333  _id,
2334  _logTime,
2336  _logString
2337  );
2338  }
2339 #endif
2340  }
2341 
2344  {
2345  // Get the time
2346  Fw::Time _logTime;
2347  if (this->isConnected_timeCaller_OutputPort(0)) {
2348  this->timeCaller_out(0, _logTime);
2349  }
2350 
2352 
2353  // Emit the event on the log port
2354  if (this->isConnected_eventOut_OutputPort(0)) {
2355  Fw::LogBuffer _logBuff;
2357 
2358 #if FW_AMPCS_COMPATIBLE
2359  // Serialize the number of arguments
2360  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2361  FW_ASSERT(
2362  _status == Fw::FW_SERIALIZE_OK,
2363  static_cast<FwAssertArgType>(_status)
2364  );
2365 #endif
2366 
2367  _status = sourceFileName.serializeTo(
2368  _logBuff,
2369  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2370  );
2371  FW_ASSERT(
2372  _status == Fw::FW_SERIALIZE_OK,
2373  static_cast<FwAssertArgType>(_status)
2374  );
2375 
2376  this->eventOut_out(
2377  0,
2378  _id,
2379  _logTime,
2381  _logBuff
2382  );
2383  }
2384 
2385  // Emit the event on the text log port
2386 #if FW_ENABLE_TEXT_LOGGING
2387  if (this->isConnected_textEventOut_OutputPort(0)) {
2388 #if FW_OBJECT_NAMES == 1
2389  const char* _formatString =
2390  "(%s) %s: Downlink of file %s stopped due to zero-size.";
2391 #else
2392  const char* _formatString =
2393  "%s: Downlink of file %s stopped due to zero-size.";
2394 #endif
2395 
2396  Fw::TextLogString _logString;
2397  (void) _logString.format(
2398  _formatString,
2399 #if FW_OBJECT_NAMES == 1
2400  this->m_objName.toChar(),
2401 #endif
2402  "DownlinkZeroSizeFile ",
2403  sourceFileName.toChar()
2404  );
2405 
2406  this->textEventOut_out(
2407  0,
2408  _id,
2409  _logTime,
2411  _logString
2412  );
2413  }
2414 #endif
2415  }
2416 
2419  {
2420  // Get the time
2421  Fw::Time _logTime;
2422  if (this->isConnected_timeCaller_OutputPort(0)) {
2423  this->timeCaller_out(0, _logTime);
2424  }
2425 
2427 
2428  // Emit the event on the log port
2429  if (this->isConnected_eventOut_OutputPort(0)) {
2430  Fw::LogBuffer _logBuff;
2431 
2432 #if FW_AMPCS_COMPATIBLE
2434  // Serialize the number of arguments
2435  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2436  FW_ASSERT(
2437  _status == Fw::FW_SERIALIZE_OK,
2438  static_cast<FwAssertArgType>(_status)
2439  );
2440 #endif
2441 
2442  this->eventOut_out(
2443  0,
2444  _id,
2445  _logTime,
2447  _logBuff
2448  );
2449  }
2450 
2451  // Emit the event on the text log port
2452 #if FW_ENABLE_TEXT_LOGGING
2453  if (this->isConnected_textEventOut_OutputPort(0)) {
2454 #if FW_OBJECT_NAMES == 1
2455  const char* _formatString =
2456  "(%s) %s: Commanded source filename too long";
2457 #else
2458  const char* _formatString =
2459  "%s: Commanded source filename too long";
2460 #endif
2461 
2462  Fw::TextLogString _logString;
2463  (void) _logString.format(
2464  _formatString,
2465 #if FW_OBJECT_NAMES == 1
2466  this->m_objName.toChar(),
2467 #endif
2468  "FilenameSourceOverflow "
2469  );
2470 
2471  this->textEventOut_out(
2472  0,
2473  _id,
2474  _logTime,
2476  _logString
2477  );
2478  }
2479 #endif
2480  }
2481 
2484  {
2485  // Get the time
2486  Fw::Time _logTime;
2487  if (this->isConnected_timeCaller_OutputPort(0)) {
2488  this->timeCaller_out(0, _logTime);
2489  }
2490 
2492 
2493  // Emit the event on the log port
2494  if (this->isConnected_eventOut_OutputPort(0)) {
2495  Fw::LogBuffer _logBuff;
2496 
2497 #if FW_AMPCS_COMPATIBLE
2499  // Serialize the number of arguments
2500  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2501  FW_ASSERT(
2502  _status == Fw::FW_SERIALIZE_OK,
2503  static_cast<FwAssertArgType>(_status)
2504  );
2505 #endif
2506 
2507  this->eventOut_out(
2508  0,
2509  _id,
2510  _logTime,
2512  _logBuff
2513  );
2514  }
2515 
2516  // Emit the event on the text log port
2517 #if FW_ENABLE_TEXT_LOGGING
2518  if (this->isConnected_textEventOut_OutputPort(0)) {
2519 #if FW_OBJECT_NAMES == 1
2520  const char* _formatString =
2521  "(%s) %s: Commanded destination filename too long";
2522 #else
2523  const char* _formatString =
2524  "%s: Commanded destination filename too long";
2525 #endif
2526 
2527  Fw::TextLogString _logString;
2528  (void) _logString.format(
2529  _formatString,
2530 #if FW_OBJECT_NAMES == 1
2531  this->m_objName.toChar(),
2532 #endif
2533  "FilenameDestinationOverflow "
2534  );
2535 
2536  this->textEventOut_out(
2537  0,
2538  _id,
2539  _logTime,
2541  _logString
2542  );
2543  }
2544 #endif
2545  }
2546 
2549  {
2550  // Get the time
2551  Fw::Time _logTime;
2552  if (this->isConnected_timeCaller_OutputPort(0)) {
2553  this->timeCaller_out(0, _logTime);
2554  }
2555 
2556  const FwEventIdType _id = this->getIdBase() + EVENTID_SOURCEOUTOFSANDBOX;
2557 
2558  // Emit the event on the log port
2559  if (this->isConnected_eventOut_OutputPort(0)) {
2560  Fw::LogBuffer _logBuff;
2562 
2563 #if FW_AMPCS_COMPATIBLE
2564  // Serialize the number of arguments
2565  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2566  FW_ASSERT(
2567  _status == Fw::FW_SERIALIZE_OK,
2568  static_cast<FwAssertArgType>(_status)
2569  );
2570 #endif
2571 
2572  _status = fileName.serializeTo(
2573  _logBuff,
2574  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 100)
2575  );
2576  FW_ASSERT(
2577  _status == Fw::FW_SERIALIZE_OK,
2578  static_cast<FwAssertArgType>(_status)
2579  );
2580 
2581  this->eventOut_out(
2582  0,
2583  _id,
2584  _logTime,
2586  _logBuff
2587  );
2588  }
2589 
2590  // Emit the event on the text log port
2591 #if FW_ENABLE_TEXT_LOGGING
2592  if (this->isConnected_textEventOut_OutputPort(0)) {
2593 #if FW_OBJECT_NAMES == 1
2594  const char* _formatString =
2595  "(%s) %s: Source file %s is outside the configured read sandbox";
2596 #else
2597  const char* _formatString =
2598  "%s: Source file %s is outside the configured read sandbox";
2599 #endif
2600 
2601  Fw::TextLogString _logString;
2602  (void) _logString.format(
2603  _formatString,
2604 #if FW_OBJECT_NAMES == 1
2605  this->m_objName.toChar(),
2606 #endif
2607  "SourceOutOfSandbox ",
2608  fileName.toChar()
2609  );
2610 
2611  this->textEventOut_out(
2612  0,
2613  _id,
2614  _logTime,
2616  _logString
2617  );
2618  }
2619 #endif
2620  }
2621 
2622  // ----------------------------------------------------------------------
2623  // Telemetry serialized write
2624  // ----------------------------------------------------------------------
2625 
2628  FwChanIdType id,
2629  Fw::TlmBuffer& _tlmBuff,
2630  Fw::Time _tlmTime
2631  ) const
2632  {
2633  if (this->isConnected_tlmOut_OutputPort(0)) {
2634  if (
2636  (_tlmTime == Fw::ZERO_TIME)
2637  ) {
2638  this->timeCaller_out(0, _tlmTime);
2639  }
2640 
2641  FwChanIdType _id;
2642  _id = this->getIdBase() + id;
2643 
2644  this->tlmOut_out(
2645  0,
2646  _id,
2647  _tlmTime,
2648  _tlmBuff
2649  );
2650  }
2651  }
2652 
2653  // ----------------------------------------------------------------------
2654  // Telemetry write functions
2655  // ----------------------------------------------------------------------
2656 
2659  U32 arg,
2660  Fw::Time _tlmTime
2661  ) const
2662  {
2663  if (this->isConnected_tlmOut_OutputPort(0)) {
2664  Fw::TlmBuffer _tlmBuff;
2665  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2666  FW_ASSERT(
2667  _stat == Fw::FW_SERIALIZE_OK,
2668  static_cast<FwAssertArgType>(_stat)
2669  );
2670 
2671  this->tlmWrite(
2673  _tlmBuff,
2674  _tlmTime
2675  );
2676  }
2677  }
2678 
2681  U32 arg,
2682  Fw::Time _tlmTime
2683  ) const
2684  {
2685  if (this->isConnected_tlmOut_OutputPort(0)) {
2686  Fw::TlmBuffer _tlmBuff;
2687  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2688  FW_ASSERT(
2689  _stat == Fw::FW_SERIALIZE_OK,
2690  static_cast<FwAssertArgType>(_stat)
2691  );
2692 
2693  this->tlmWrite(
2695  _tlmBuff,
2696  _tlmTime
2697  );
2698  }
2699  }
2700 
2703  U32 arg,
2704  Fw::Time _tlmTime
2705  ) const
2706  {
2707  if (this->isConnected_tlmOut_OutputPort(0)) {
2708  Fw::TlmBuffer _tlmBuff;
2709  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2710  FW_ASSERT(
2711  _stat == Fw::FW_SERIALIZE_OK,
2712  static_cast<FwAssertArgType>(_stat)
2713  );
2714 
2715  this->tlmWrite(
2717  _tlmBuff,
2718  _tlmTime
2719  );
2720  }
2721  }
2722 
2723  // ----------------------------------------------------------------------
2724  // Time
2725  // ----------------------------------------------------------------------
2726 
2728  getTime() const
2729  {
2730  if (this->isConnected_timeCaller_OutputPort(0)) {
2731  Fw::Time _time;
2732  this->timeCaller_out(0, _time);
2733  return _time;
2734  }
2735  else {
2736  return Fw::Time(TimeBase::TB_NONE, 0, 0);
2737  }
2738  }
2739 
2740  // ----------------------------------------------------------------------
2741  // Mutex operations for guarded ports
2742  //
2743  // You can override these operations to provide more sophisticated
2744  // synchronization
2745  // ----------------------------------------------------------------------
2746 
2749  {
2750  this->m_guardedPortMutex.lock();
2751  }
2752 
2755  {
2756  this->m_guardedPortMutex.unLock();
2757  }
2758 
2759  // ----------------------------------------------------------------------
2760  // Message dispatch functions
2761  // ----------------------------------------------------------------------
2762 
2763  Fw::QueuedComponentBase::MsgDispatchStatus FileDownlinkComponentBase ::
2764  doDispatch()
2765  {
2766  ComponentIpcSerializableBuffer _msg;
2767  FwQueuePriorityType _priority = 0;
2768 
2769  Os::Queue::Status _msgStatus = this->m_queue.receive(
2770  _msg,
2772  _priority
2773  );
2774  FW_ASSERT(
2775  _msgStatus == Os::Queue::OP_OK,
2776  static_cast<FwAssertArgType>(_msgStatus)
2777  );
2778 
2779  // Reset to beginning of buffer
2780  _msg.resetDeser();
2781 
2782  FwEnumStoreType _desMsg = 0;
2783  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
2784  FW_ASSERT(
2785  _deserStatus == Fw::FW_SERIALIZE_OK,
2786  static_cast<FwAssertArgType>(_deserStatus)
2787  );
2788 
2789  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
2790 
2791  if (_msgType == FILEDOWNLINK_COMPONENT_EXIT) {
2792  return MSG_DISPATCH_EXIT;
2793  }
2794 
2795  FwIndexType portNum = 0;
2796  _deserStatus = _msg.deserializeTo(portNum);
2797  FW_ASSERT(
2798  _deserStatus == Fw::FW_SERIALIZE_OK,
2799  static_cast<FwAssertArgType>(_deserStatus)
2800  );
2801 
2802  switch (_msgType) {
2803  // Handle async input port Run
2804  case RUN_SCHED: {
2805  // Deserialize argument context
2806  U32 context;
2807  _deserStatus = _msg.deserializeTo(context);
2808  FW_ASSERT(
2809  _deserStatus == Fw::FW_SERIALIZE_OK,
2810  static_cast<FwAssertArgType>(_deserStatus)
2811  );
2812  // Call handler function
2813  this->Run_handler(
2814  portNum,
2815  context
2816  );
2817 
2818  break;
2819  }
2820 
2821  // Handle async input port bufferReturn
2822  case BUFFERRETURN_BUFFERSEND: {
2823  // Deserialize argument fwBuffer
2824  Fw::Buffer fwBuffer;
2825  _deserStatus = _msg.deserializeTo(fwBuffer);
2826  FW_ASSERT(
2827  _deserStatus == Fw::FW_SERIALIZE_OK,
2828  static_cast<FwAssertArgType>(_deserStatus)
2829  );
2830  // Call handler function
2831  this->bufferReturn_handler(
2832  portNum,
2833  fwBuffer
2834  );
2835 
2836  break;
2837  }
2838 
2839  // Handle async input port pingIn
2840  case PINGIN_PING: {
2841  // Deserialize argument key
2842  U32 key;
2843  _deserStatus = _msg.deserializeTo(key);
2844  FW_ASSERT(
2845  _deserStatus == Fw::FW_SERIALIZE_OK,
2846  static_cast<FwAssertArgType>(_deserStatus)
2847  );
2848  // Call handler function
2849  this->pingIn_handler(
2850  portNum,
2851  key
2852  );
2853 
2854  break;
2855  }
2856 
2857  // Handle command SendFile
2858  case CMD_SENDFILE: {
2859  // Deserialize opcode
2860  FwOpcodeType _opCode = 0;
2861  _deserStatus = _msg.deserializeTo(_opCode);
2862  FW_ASSERT (
2863  _deserStatus == Fw::FW_SERIALIZE_OK,
2864  static_cast<FwAssertArgType>(_deserStatus)
2865  );
2866 
2867  // Deserialize command sequence
2868  U32 _cmdSeq = 0;
2869  _deserStatus = _msg.deserializeTo(_cmdSeq);
2870  FW_ASSERT (
2871  _deserStatus == Fw::FW_SERIALIZE_OK,
2872  static_cast<FwAssertArgType>(_deserStatus)
2873  );
2874 
2875  // Deserialize command argument buffer
2876  Fw::CmdArgBuffer args;
2877  _deserStatus = _msg.deserializeTo(args);
2878  FW_ASSERT (
2879  _deserStatus == Fw::FW_SERIALIZE_OK,
2880  static_cast<FwAssertArgType>(_deserStatus)
2881  );
2882 
2883  // Reset buffer
2884  args.resetDeser();
2885 
2886  // Deserialize argument sourceFileName
2887  Fw::CmdStringArg sourceFileName;
2888  _deserStatus = args.deserializeTo(sourceFileName);
2889  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2891  this->cmdResponse_out(
2892  _opCode,
2893  _cmdSeq,
2895  );
2896  }
2897  // Don't crash the task if bad arguments were passed from the ground
2898  break;
2899  }
2900 
2901  // Deserialize argument destFileName
2902  Fw::CmdStringArg destFileName;
2903  _deserStatus = args.deserializeTo(destFileName);
2904  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2906  this->cmdResponse_out(
2907  _opCode,
2908  _cmdSeq,
2910  );
2911  }
2912  // Don't crash the task if bad arguments were passed from the ground
2913  break;
2914  }
2915 
2916  // Make sure there was no data left over.
2917  // That means the argument buffer size was incorrect.
2918 #if FW_CMD_CHECK_RESIDUAL
2919  if (args.getDeserializeSizeLeft() != 0) {
2921  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2922  }
2923  // Don't crash the task if bad arguments were passed from the ground
2924  break;
2925  }
2926 #endif
2927 
2928  // Call handler function
2929  this->SendFile_cmdHandler(
2930  _opCode, _cmdSeq,
2931  sourceFileName,
2932  destFileName
2933  );
2934 
2935  break;
2936  }
2937 
2938  // Handle command Cancel
2939  case CMD_CANCEL: {
2940  // Deserialize opcode
2941  FwOpcodeType _opCode = 0;
2942  _deserStatus = _msg.deserializeTo(_opCode);
2943  FW_ASSERT (
2944  _deserStatus == Fw::FW_SERIALIZE_OK,
2945  static_cast<FwAssertArgType>(_deserStatus)
2946  );
2947 
2948  // Deserialize command sequence
2949  U32 _cmdSeq = 0;
2950  _deserStatus = _msg.deserializeTo(_cmdSeq);
2951  FW_ASSERT (
2952  _deserStatus == Fw::FW_SERIALIZE_OK,
2953  static_cast<FwAssertArgType>(_deserStatus)
2954  );
2955 
2956  // Deserialize command argument buffer
2957  Fw::CmdArgBuffer args;
2958  _deserStatus = _msg.deserializeTo(args);
2959  FW_ASSERT (
2960  _deserStatus == Fw::FW_SERIALIZE_OK,
2961  static_cast<FwAssertArgType>(_deserStatus)
2962  );
2963 
2964  // Reset buffer
2965  args.resetDeser();
2966 
2967  // Make sure there was no data left over.
2968  // That means the argument buffer size was incorrect.
2969 #if FW_CMD_CHECK_RESIDUAL
2970  if (args.getDeserializeSizeLeft() != 0) {
2972  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2973  }
2974  // Don't crash the task if bad arguments were passed from the ground
2975  break;
2976  }
2977 #endif
2978 
2979  // Call handler function
2980  this->Cancel_cmdHandler(_opCode, _cmdSeq);
2981 
2982  break;
2983  }
2984 
2985  // Handle command SendPartial
2986  case CMD_SENDPARTIAL: {
2987  // Deserialize opcode
2988  FwOpcodeType _opCode = 0;
2989  _deserStatus = _msg.deserializeTo(_opCode);
2990  FW_ASSERT (
2991  _deserStatus == Fw::FW_SERIALIZE_OK,
2992  static_cast<FwAssertArgType>(_deserStatus)
2993  );
2994 
2995  // Deserialize command sequence
2996  U32 _cmdSeq = 0;
2997  _deserStatus = _msg.deserializeTo(_cmdSeq);
2998  FW_ASSERT (
2999  _deserStatus == Fw::FW_SERIALIZE_OK,
3000  static_cast<FwAssertArgType>(_deserStatus)
3001  );
3002 
3003  // Deserialize command argument buffer
3004  Fw::CmdArgBuffer args;
3005  _deserStatus = _msg.deserializeTo(args);
3006  FW_ASSERT (
3007  _deserStatus == Fw::FW_SERIALIZE_OK,
3008  static_cast<FwAssertArgType>(_deserStatus)
3009  );
3010 
3011  // Reset buffer
3012  args.resetDeser();
3013 
3014  // Deserialize argument sourceFileName
3015  Fw::CmdStringArg sourceFileName;
3016  _deserStatus = args.deserializeTo(sourceFileName);
3017  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3019  this->cmdResponse_out(
3020  _opCode,
3021  _cmdSeq,
3023  );
3024  }
3025  // Don't crash the task if bad arguments were passed from the ground
3026  break;
3027  }
3028 
3029  // Deserialize argument destFileName
3030  Fw::CmdStringArg destFileName;
3031  _deserStatus = args.deserializeTo(destFileName);
3032  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3034  this->cmdResponse_out(
3035  _opCode,
3036  _cmdSeq,
3038  );
3039  }
3040  // Don't crash the task if bad arguments were passed from the ground
3041  break;
3042  }
3043 
3044  // Deserialize argument startOffset
3045  U32 startOffset;
3046  _deserStatus = args.deserializeTo(startOffset);
3047  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3049  this->cmdResponse_out(
3050  _opCode,
3051  _cmdSeq,
3053  );
3054  }
3055  // Don't crash the task if bad arguments were passed from the ground
3056  break;
3057  }
3058 
3059  // Deserialize argument length
3060  U32 length;
3061  _deserStatus = args.deserializeTo(length);
3062  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3064  this->cmdResponse_out(
3065  _opCode,
3066  _cmdSeq,
3068  );
3069  }
3070  // Don't crash the task if bad arguments were passed from the ground
3071  break;
3072  }
3073 
3074  // Make sure there was no data left over.
3075  // That means the argument buffer size was incorrect.
3076 #if FW_CMD_CHECK_RESIDUAL
3077  if (args.getDeserializeSizeLeft() != 0) {
3079  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3080  }
3081  // Don't crash the task if bad arguments were passed from the ground
3082  break;
3083  }
3084 #endif
3085 
3086  // Call handler function
3087  this->SendPartial_cmdHandler(
3088  _opCode, _cmdSeq,
3089  sourceFileName,
3090  destFileName,
3091  startOffset,
3092  length
3093  );
3094 
3095  break;
3096  }
3097 
3098  default:
3099  return MSG_DISPATCH_ERROR;
3100  }
3101 
3102  return MSG_DISPATCH_OK;
3103  }
3104 
3105  // ----------------------------------------------------------------------
3106  // Calls for messages received on special input ports
3107  // ----------------------------------------------------------------------
3108 
3109  void FileDownlinkComponentBase ::
3110  m_p_cmdIn_in(
3111  Fw::PassiveComponentBase* callComp,
3112  FwIndexType portNum,
3113  FwOpcodeType opCode,
3114  U32 cmdSeq,
3115  Fw::CmdArgBuffer& args
3116  )
3117  {
3118  FW_ASSERT(callComp != nullptr);
3119  FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
3120  compPtr->cmdIn_handlerBase(
3121  portNum,
3122  opCode,
3123  cmdSeq,
3124  args
3125  );
3126  }
3127 
3128  // ----------------------------------------------------------------------
3129  // Calls for messages received on typed input ports
3130  // ----------------------------------------------------------------------
3131 
3132  void FileDownlinkComponentBase ::
3133  m_p_Run_in(
3134  Fw::PassiveComponentBase* callComp,
3135  FwIndexType portNum,
3136  U32 context
3137  )
3138  {
3139  FW_ASSERT(callComp != nullptr);
3140  FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
3141  compPtr->Run_handlerBase(
3142  portNum,
3143  context
3144  );
3145  }
3146 
3147  Svc::SendFileResponse FileDownlinkComponentBase ::
3148  m_p_SendFile_in(
3149  Fw::PassiveComponentBase* callComp,
3150  FwIndexType portNum,
3151  const Fw::StringBase& sourceFileName,
3152  const Fw::StringBase& destFileName,
3153  U32 offset,
3154  U32 length
3155  )
3156  {
3157  FW_ASSERT(callComp != nullptr);
3158  FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
3159  return compPtr->SendFile_handlerBase(
3160  portNum,
3161  sourceFileName,
3162  destFileName,
3163  offset,
3164  length
3165  );
3166  }
3167 
3168  void FileDownlinkComponentBase ::
3169  m_p_bufferReturn_in(
3170  Fw::PassiveComponentBase* callComp,
3171  FwIndexType portNum,
3172  Fw::Buffer& fwBuffer
3173  )
3174  {
3175  FW_ASSERT(callComp != nullptr);
3176  FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
3177  compPtr->bufferReturn_handlerBase(
3178  portNum,
3179  fwBuffer
3180  );
3181  }
3182 
3183  void FileDownlinkComponentBase ::
3184  m_p_pingIn_in(
3185  Fw::PassiveComponentBase* callComp,
3186  FwIndexType portNum,
3187  U32 key
3188  )
3189  {
3190  FW_ASSERT(callComp != nullptr);
3191  FileDownlinkComponentBase* compPtr = static_cast<FileDownlinkComponentBase*>(callComp);
3192  compPtr->pingIn_handlerBase(
3193  portNum,
3194  key
3195  );
3196  }
3197 
3198 #if !FW_DIRECT_PORT_CALLS
3199 
3200  // ----------------------------------------------------------------------
3201  // Invocation functions for special output ports
3202  // ----------------------------------------------------------------------
3203 
3204  void FileDownlinkComponentBase ::
3205  cmdRegOut_out(
3206  FwIndexType portNum,
3207  FwOpcodeType opCode
3208  ) const
3209  {
3210  FW_ASSERT(
3211  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
3212  static_cast<FwAssertArgType>(portNum)
3213  );
3214 
3215  FW_ASSERT(
3216  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
3217  static_cast<FwAssertArgType>(portNum)
3218  );
3219  this->m_cmdRegOut_OutputPort[portNum].invoke(
3220  opCode
3221  );
3222  }
3223 
3224  void FileDownlinkComponentBase ::
3225  cmdResponseOut_out(
3226  FwIndexType portNum,
3227  FwOpcodeType opCode,
3228  U32 cmdSeq,
3229  const Fw::CmdResponse& response
3230  ) const
3231  {
3232  FW_ASSERT(
3233  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
3234  static_cast<FwAssertArgType>(portNum)
3235  );
3236 
3237  FW_ASSERT(
3238  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
3239  static_cast<FwAssertArgType>(portNum)
3240  );
3241  this->m_cmdResponseOut_OutputPort[portNum].invoke(
3242  opCode,
3243  cmdSeq,
3244  response
3245  );
3246  }
3247 
3248  void FileDownlinkComponentBase ::
3249  eventOut_out(
3250  FwIndexType portNum,
3251  FwEventIdType id,
3252  Fw::Time& timeTag,
3253  const Fw::LogSeverity& severity,
3254  Fw::LogBuffer& args
3255  ) const
3256  {
3257  FW_ASSERT(
3258  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
3259  static_cast<FwAssertArgType>(portNum)
3260  );
3261 
3262  FW_ASSERT(
3263  this->m_eventOut_OutputPort[portNum].isConnected(),
3264  static_cast<FwAssertArgType>(portNum)
3265  );
3266  this->m_eventOut_OutputPort[portNum].invoke(
3267  id,
3268  timeTag,
3269  severity,
3270  args
3271  );
3272  }
3273 
3274 #if FW_ENABLE_TEXT_LOGGING
3275 
3276  void FileDownlinkComponentBase ::
3277  textEventOut_out(
3278  FwIndexType portNum,
3279  FwEventIdType id,
3280  Fw::Time& timeTag,
3281  const Fw::LogSeverity& severity,
3282  Fw::TextLogString& text
3283  ) const
3284  {
3285  FW_ASSERT(
3286  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
3287  static_cast<FwAssertArgType>(portNum)
3288  );
3289 
3290  FW_ASSERT(
3291  this->m_textEventOut_OutputPort[portNum].isConnected(),
3292  static_cast<FwAssertArgType>(portNum)
3293  );
3294  this->m_textEventOut_OutputPort[portNum].invoke(
3295  id,
3296  timeTag,
3297  severity,
3298  text
3299  );
3300  }
3301 
3302 #endif
3303 
3304  void FileDownlinkComponentBase ::
3305  timeCaller_out(
3306  FwIndexType portNum,
3307  Fw::Time& time
3308  ) const
3309  {
3310  FW_ASSERT(
3311  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
3312  static_cast<FwAssertArgType>(portNum)
3313  );
3314 
3315  FW_ASSERT(
3316  this->m_timeCaller_OutputPort[portNum].isConnected(),
3317  static_cast<FwAssertArgType>(portNum)
3318  );
3319  this->m_timeCaller_OutputPort[portNum].invoke(
3320  time
3321  );
3322  }
3323 
3324  void FileDownlinkComponentBase ::
3325  tlmOut_out(
3326  FwIndexType portNum,
3327  FwChanIdType id,
3328  Fw::Time& timeTag,
3329  Fw::TlmBuffer& val
3330  ) const
3331  {
3332  FW_ASSERT(
3333  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
3334  static_cast<FwAssertArgType>(portNum)
3335  );
3336 
3337  FW_ASSERT(
3338  this->m_tlmOut_OutputPort[portNum].isConnected(),
3339  static_cast<FwAssertArgType>(portNum)
3340  );
3341  this->m_tlmOut_OutputPort[portNum].invoke(
3342  id,
3343  timeTag,
3344  val
3345  );
3346  }
3347 
3348 #endif
3349 
3350 }
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.
message to exit active component task
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 unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:41
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
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.
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.
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 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.
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.
BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY]