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