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