F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FileManagerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FileManagerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for FileManager 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  FILEMANAGER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  PINGIN_PING,
20  CMD_CREATEDIRECTORY,
21  CMD_MOVEFILE,
22  CMD_REMOVEDIRECTORY,
23  CMD_REMOVEFILE,
24  CMD_APPENDFILE,
25  CMD_FILESIZE,
26  CMD_LISTDIRECTORY,
27  CMD_CALCULATECRC,
28  CMD_GENERATEDP,
29  INT_IF_SCHEDININTERNAL,
30  };
31 
32  // Get the max size by constructing a union of the async input, command, and
33  // internal port serialization sizes
34  union BuffUnion {
37  };
38 
39  // Define a message buffer class large enough to handle all the
40  // asynchronous inputs to the component
41  class ComponentIpcSerializableBuffer :
43  {
44 
45  public:
46 
47  enum {
48  // Offset into data in buffer: Size of message ID and port number
49  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
50  // Max data size
51  MAX_DATA_SIZE = sizeof(BuffUnion),
52  // Max message size: Size of message id + size of port + max data size
53  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
54  };
55 
56  ComponentIpcSerializableBuffer() : Fw::LinearBufferBase(m_buff, sizeof(m_buff)) {
57 
58  }
59 
60  private:
61  // Should be the max of all the input ports serialized sizes...
62  U8 m_buff[SERIALIZATION_SIZE];
63 
64  };
65  }
66 
67  // ----------------------------------------------------------------------
68  // Types for data products
69  // ----------------------------------------------------------------------
70 
73  FwDpIdType id,
74  const Fw::Buffer& buffer,
75  FwDpIdType baseId
76  ) :
77  Fw::DpContainer(id, buffer),
78  m_baseId(baseId)
79  {
80 
81  }
82 
85  Fw::DpContainer(),
86  m_baseId(0)
87  {
88 
89  }
90 
93  const U8* array,
94  FwSizeType size
95  )
96  {
97  FW_ASSERT(array != nullptr);
98  // Compute the size delta
99  const FwSizeType sizeDelta =
100  sizeof(FwDpIdType) +
101  sizeof(FwSizeStoreType) +
102  size * sizeof(U8);
103  // Serialize the elements if they will fit
105  if ((this->m_dataBuffer.getSize() + sizeDelta) <= this->m_dataBuffer.getCapacity()) {
106  const FwDpIdType id = this->m_baseId + RecordId::FileChunkDataRecord;
107  status = this->m_dataBuffer.serializeFrom(id);
108  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
109  status = this->m_dataBuffer.serializeSize(size);
110  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
111  status = this->m_dataBuffer.serializeFrom(array, size, Fw::Serialization::OMIT_LENGTH);
112  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
113  this->m_dataSize += sizeDelta;
114  }
115  else {
117  }
118  return status;
119  }
120 
123  {
124  const FwSizeType sizeDelta =
125  sizeof(FwDpIdType) +
126  elt.serializedSize();
128  if (this->m_dataBuffer.getSize() + sizeDelta <= this->m_dataBuffer.getCapacity()) {
129  const FwDpIdType id = this->m_baseId + RecordId::FileChunkHeaderRecord;
130  status = this->m_dataBuffer.serializeFrom(id);
131  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
132  status = this->m_dataBuffer.serializeFrom(elt);
133  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
134  this->m_dataSize += sizeDelta;
135  }
136  else {
138  }
139  return status;
140  }
141 
142  // ----------------------------------------------------------------------
143  // Component initialization
144  // ----------------------------------------------------------------------
145 
148  FwSizeType queueDepth,
149  FwEnumStoreType instance
150  )
151  {
152  // Initialize base class
154 
155 #if !FW_DIRECT_PORT_CALLS
156  // Connect input port cmdIn
157  for (
158  FwIndexType port = 0;
159  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
160  port++
161  ) {
162  this->m_cmdIn_InputPort[port].init();
163  this->m_cmdIn_InputPort[port].addCallComp(
164  this,
165  m_p_cmdIn_in
166  );
167  this->m_cmdIn_InputPort[port].setPortNum(port);
168 
169 #if FW_OBJECT_NAMES == 1
170  Fw::ObjectName portName;
171  portName.format(
172  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
173  this->m_objName.toChar(),
174  port
175  );
176  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
177 #endif
178  }
179 #endif
180 
181 #if !FW_DIRECT_PORT_CALLS
182  // Connect input port pingIn
183  for (
184  FwIndexType port = 0;
185  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
186  port++
187  ) {
188  this->m_pingIn_InputPort[port].init();
189  this->m_pingIn_InputPort[port].addCallComp(
190  this,
191  m_p_pingIn_in
192  );
193  this->m_pingIn_InputPort[port].setPortNum(port);
194 
195 #if FW_OBJECT_NAMES == 1
196  Fw::ObjectName portName;
197  portName.format(
198  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
199  this->m_objName.toChar(),
200  port
201  );
202  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
203 #endif
204  }
205 #endif
206 
207 #if !FW_DIRECT_PORT_CALLS
208  // Connect input port schedIn
209  for (
210  FwIndexType port = 0;
211  port < static_cast<FwIndexType>(this->getNum_schedIn_InputPorts());
212  port++
213  ) {
214  this->m_schedIn_InputPort[port].init();
215  this->m_schedIn_InputPort[port].addCallComp(
216  this,
217  m_p_schedIn_in
218  );
219  this->m_schedIn_InputPort[port].setPortNum(port);
220 
221 #if FW_OBJECT_NAMES == 1
222  Fw::ObjectName portName;
223  portName.format(
224  "%s_schedIn_InputPort[%" PRI_FwIndexType "]",
225  this->m_objName.toChar(),
226  port
227  );
228  this->m_schedIn_InputPort[port].setObjName(portName.toChar());
229 #endif
230  }
231 #endif
232 
233 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
234  // Connect output port LogText
235  for (
236  FwIndexType port = 0;
237  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
238  port++
239  ) {
240  this->m_LogText_OutputPort[port].init();
241 
242 #if FW_OBJECT_NAMES == 1
243  Fw::ObjectName portName;
244  portName.format(
245  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
246  this->m_objName.toChar(),
247  port
248  );
249  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
250 #endif
251  }
252 #endif
253 
254 #if !FW_DIRECT_PORT_CALLS
255  // Connect output port cmdRegOut
256  for (
257  FwIndexType port = 0;
258  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
259  port++
260  ) {
261  this->m_cmdRegOut_OutputPort[port].init();
262 
263 #if FW_OBJECT_NAMES == 1
264  Fw::ObjectName portName;
265  portName.format(
266  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
267  this->m_objName.toChar(),
268  port
269  );
270  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
271 #endif
272  }
273 #endif
274 
275 #if !FW_DIRECT_PORT_CALLS
276  // Connect output port cmdResponseOut
277  for (
278  FwIndexType port = 0;
279  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
280  port++
281  ) {
282  this->m_cmdResponseOut_OutputPort[port].init();
283 
284 #if FW_OBJECT_NAMES == 1
285  Fw::ObjectName portName;
286  portName.format(
287  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
288  this->m_objName.toChar(),
289  port
290  );
291  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
292 #endif
293  }
294 #endif
295 
296 #if !FW_DIRECT_PORT_CALLS
297  // Connect output port eventOut
298  for (
299  FwIndexType port = 0;
300  port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
301  port++
302  ) {
303  this->m_eventOut_OutputPort[port].init();
304 
305 #if FW_OBJECT_NAMES == 1
306  Fw::ObjectName portName;
307  portName.format(
308  "%s_eventOut_OutputPort[%" PRI_FwIndexType "]",
309  this->m_objName.toChar(),
310  port
311  );
312  this->m_eventOut_OutputPort[port].setObjName(portName.toChar());
313 #endif
314  }
315 #endif
316 
317 #if !FW_DIRECT_PORT_CALLS
318  // Connect output port productGetOut
319  for (
320  FwIndexType port = 0;
321  port < static_cast<FwIndexType>(this->getNum_productGetOut_OutputPorts());
322  port++
323  ) {
324  this->m_productGetOut_OutputPort[port].init();
325 
326 #if FW_OBJECT_NAMES == 1
327  Fw::ObjectName portName;
328  portName.format(
329  "%s_productGetOut_OutputPort[%" PRI_FwIndexType "]",
330  this->m_objName.toChar(),
331  port
332  );
333  this->m_productGetOut_OutputPort[port].setObjName(portName.toChar());
334 #endif
335  }
336 #endif
337 
338 #if !FW_DIRECT_PORT_CALLS
339  // Connect output port productSendOut
340  for (
341  FwIndexType port = 0;
342  port < static_cast<FwIndexType>(this->getNum_productSendOut_OutputPorts());
343  port++
344  ) {
345  this->m_productSendOut_OutputPort[port].init();
346 
347 #if FW_OBJECT_NAMES == 1
348  Fw::ObjectName portName;
349  portName.format(
350  "%s_productSendOut_OutputPort[%" PRI_FwIndexType "]",
351  this->m_objName.toChar(),
352  port
353  );
354  this->m_productSendOut_OutputPort[port].setObjName(portName.toChar());
355 #endif
356  }
357 #endif
358 
359 #if !FW_DIRECT_PORT_CALLS
360  // Connect output port timeCaller
361  for (
362  FwIndexType port = 0;
363  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
364  port++
365  ) {
366  this->m_timeCaller_OutputPort[port].init();
367 
368 #if FW_OBJECT_NAMES == 1
369  Fw::ObjectName portName;
370  portName.format(
371  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
372  this->m_objName.toChar(),
373  port
374  );
375  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
376 #endif
377  }
378 #endif
379 
380 #if !FW_DIRECT_PORT_CALLS
381  // Connect output port tlmOut
382  for (
383  FwIndexType port = 0;
384  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
385  port++
386  ) {
387  this->m_tlmOut_OutputPort[port].init();
388 
389 #if FW_OBJECT_NAMES == 1
390  Fw::ObjectName portName;
391  portName.format(
392  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
393  this->m_objName.toChar(),
394  port
395  );
396  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
397 #endif
398  }
399 #endif
400 
401 #if !FW_DIRECT_PORT_CALLS
402  // Connect output port pingOut
403  for (
404  FwIndexType port = 0;
405  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
406  port++
407  ) {
408  this->m_pingOut_OutputPort[port].init();
409 
410 #if FW_OBJECT_NAMES == 1
411  Fw::ObjectName portName;
412  portName.format(
413  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
414  this->m_objName.toChar(),
415  port
416  );
417  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
418 #endif
419  }
420 #endif
421 
422  // Create the queue
423  Os::Queue::Status qStat = this->createQueue(
424  queueDepth,
425  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
426  );
427  FW_ASSERT(
428  Os::Queue::Status::OP_OK == qStat,
429  static_cast<FwAssertArgType>(qStat)
430  );
431  }
432 
433 #if !FW_DIRECT_PORT_CALLS
434 
435  // ----------------------------------------------------------------------
436  // Getters for special input ports
437  // ----------------------------------------------------------------------
438 
441  {
442  FW_ASSERT(
443  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
444  static_cast<FwAssertArgType>(portNum)
445  );
446 
447  return &this->m_cmdIn_InputPort[portNum];
448  }
449 
450 #endif
451 
452 #if !FW_DIRECT_PORT_CALLS
453 
454  // ----------------------------------------------------------------------
455  // Getters for typed input ports
456  // ----------------------------------------------------------------------
457 
460  {
461  FW_ASSERT(
462  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
463  static_cast<FwAssertArgType>(portNum)
464  );
465 
466  return &this->m_pingIn_InputPort[portNum];
467  }
468 
471  {
472  FW_ASSERT(
473  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
474  static_cast<FwAssertArgType>(portNum)
475  );
476 
477  return &this->m_schedIn_InputPort[portNum];
478  }
479 
480 #endif
481 
482 #if !FW_DIRECT_PORT_CALLS
483 
484  // ----------------------------------------------------------------------
485  // Connect input ports to special output ports
486  // ----------------------------------------------------------------------
487 
488 #if FW_ENABLE_TEXT_LOGGING == 1
489 
490  void FileManagerComponentBase ::
491  set_LogText_OutputPort(
492  FwIndexType portNum,
494  )
495  {
496  FW_ASSERT(
497  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
498  static_cast<FwAssertArgType>(portNum)
499  );
500 
501  this->m_LogText_OutputPort[portNum].addCallPort(port);
502  }
503 
504 #endif
505 
508  FwIndexType portNum,
509  Fw::InputCmdRegPort* port
510  )
511  {
512  FW_ASSERT(
513  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
514  static_cast<FwAssertArgType>(portNum)
515  );
516 
517  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
518  }
519 
522  FwIndexType portNum,
524  )
525  {
526  FW_ASSERT(
527  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
528  static_cast<FwAssertArgType>(portNum)
529  );
530 
531  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
532  }
533 
536  FwIndexType portNum,
537  Fw::InputLogPort* port
538  )
539  {
540  FW_ASSERT(
541  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
542  static_cast<FwAssertArgType>(portNum)
543  );
544 
545  this->m_eventOut_OutputPort[portNum].addCallPort(port);
546  }
547 
550  FwIndexType portNum,
551  Fw::InputDpGetPort* port
552  )
553  {
554  FW_ASSERT(
555  (0 <= portNum) && (portNum < this->getNum_productGetOut_OutputPorts()),
556  static_cast<FwAssertArgType>(portNum)
557  );
558 
559  this->m_productGetOut_OutputPort[portNum].addCallPort(port);
560  }
561 
564  FwIndexType portNum,
565  Fw::InputDpSendPort* port
566  )
567  {
568  FW_ASSERT(
569  (0 <= portNum) && (portNum < this->getNum_productSendOut_OutputPorts()),
570  static_cast<FwAssertArgType>(portNum)
571  );
572 
573  this->m_productSendOut_OutputPort[portNum].addCallPort(port);
574  }
575 
578  FwIndexType portNum,
579  Fw::InputTimePort* port
580  )
581  {
582  FW_ASSERT(
583  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
584  static_cast<FwAssertArgType>(portNum)
585  );
586 
587  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
588  }
589 
592  FwIndexType portNum,
593  Fw::InputTlmPort* port
594  )
595  {
596  FW_ASSERT(
597  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
598  static_cast<FwAssertArgType>(portNum)
599  );
600 
601  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
602  }
603 
604 #endif
605 
606 #if !FW_DIRECT_PORT_CALLS
607 
608  // ----------------------------------------------------------------------
609  // Connect typed input ports to typed output ports
610  // ----------------------------------------------------------------------
611 
614  FwIndexType portNum,
615  Svc::InputPingPort* port
616  )
617  {
618  FW_ASSERT(
619  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
620  static_cast<FwAssertArgType>(portNum)
621  );
622 
623  this->m_pingOut_OutputPort[portNum].addCallPort(port);
624  }
625 
626 #endif
627 
628 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
629 
630  // ----------------------------------------------------------------------
631  // Connect serial input ports to special output ports
632  // ----------------------------------------------------------------------
633 
634 #if FW_ENABLE_TEXT_LOGGING == 1
635 
636  void FileManagerComponentBase ::
637  set_LogText_OutputPort(
638  FwIndexType portNum,
639  Fw::InputSerializePort* port
640  )
641  {
642  FW_ASSERT(
643  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
644  static_cast<FwAssertArgType>(portNum)
645  );
646 
647  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
648  }
649 
650 #endif
651 
654  FwIndexType portNum,
655  Fw::InputSerializePort* port
656  )
657  {
658  FW_ASSERT(
659  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
660  static_cast<FwAssertArgType>(portNum)
661  );
662 
663  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
664  }
665 
668  FwIndexType portNum,
669  Fw::InputSerializePort* port
670  )
671  {
672  FW_ASSERT(
673  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
674  static_cast<FwAssertArgType>(portNum)
675  );
676 
677  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
678  }
679 
682  FwIndexType portNum,
683  Fw::InputSerializePort* port
684  )
685  {
686  FW_ASSERT(
687  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
688  static_cast<FwAssertArgType>(portNum)
689  );
690 
691  this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
692  }
693 
696  FwIndexType portNum,
697  Fw::InputSerializePort* port
698  )
699  {
700  FW_ASSERT(
701  (0 <= portNum) && (portNum < this->getNum_productSendOut_OutputPorts()),
702  static_cast<FwAssertArgType>(portNum)
703  );
704 
705  this->m_productSendOut_OutputPort[portNum].registerSerialPort(port);
706  }
707 
710  FwIndexType portNum,
711  Fw::InputSerializePort* port
712  )
713  {
714  FW_ASSERT(
715  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
716  static_cast<FwAssertArgType>(portNum)
717  );
718 
719  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
720  }
721 
724  FwIndexType portNum,
725  Fw::InputSerializePort* port
726  )
727  {
728  FW_ASSERT(
729  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
730  static_cast<FwAssertArgType>(portNum)
731  );
732 
733  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
734  }
735 
736 #endif
737 
738 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
739 
740  // ----------------------------------------------------------------------
741  // Connect serial input ports to typed output ports
742  // ----------------------------------------------------------------------
743 
746  FwIndexType portNum,
747  Fw::InputSerializePort* port
748  )
749  {
750  FW_ASSERT(
751  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
752  static_cast<FwAssertArgType>(portNum)
753  );
754 
755  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
756  }
757 
758 #endif
759 
760  // ----------------------------------------------------------------------
761  // Command registration
762  // ----------------------------------------------------------------------
763 
766  {
768 
769  this->cmdRegOut_out(
770  0,
772  );
773 
774  this->cmdRegOut_out(
775  0,
776  this->getIdBase() + OPCODE_MOVEFILE
777  );
778 
779  this->cmdRegOut_out(
780  0,
782  );
783 
784  this->cmdRegOut_out(
785  0,
786  this->getIdBase() + OPCODE_REMOVEFILE
787  );
788 
789  this->cmdRegOut_out(
790  0,
791  this->getIdBase() + OPCODE_APPENDFILE
792  );
793 
794  this->cmdRegOut_out(
795  0,
796  this->getIdBase() + OPCODE_FILESIZE
797  );
798 
799  this->cmdRegOut_out(
800  0,
802  );
803 
804  this->cmdRegOut_out(
805  0,
807  );
808 
809  this->cmdRegOut_out(
810  0,
811  this->getIdBase() + OPCODE_GENERATEDP
812  );
813  }
814 
815  // ----------------------------------------------------------------------
816  // Component construction and destruction
817  // ----------------------------------------------------------------------
818 
820  FileManagerComponentBase(const char* compName) :
821  Fw::ActiveComponentBase(compName)
822  {
823 
824  }
825 
828  {
829 
830  }
831 
832 #if !FW_DIRECT_PORT_CALLS
833 
834  // ----------------------------------------------------------------------
835  // Connection status queries for special output ports
836  // ----------------------------------------------------------------------
837 
838 #if FW_ENABLE_TEXT_LOGGING == 1
839 
840  bool FileManagerComponentBase ::
841  isConnected_LogText_OutputPort(FwIndexType portNum) const
842  {
843  FW_ASSERT(
844  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
845  static_cast<FwAssertArgType>(portNum)
846  );
847 
848  return this->m_LogText_OutputPort[portNum].isConnected();
849  }
850 
851 #endif
852 
855  {
856  FW_ASSERT(
857  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
858  static_cast<FwAssertArgType>(portNum)
859  );
860 
861  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
862  }
863 
866  {
867  FW_ASSERT(
868  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
869  static_cast<FwAssertArgType>(portNum)
870  );
871 
872  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
873  }
874 
877  {
878  FW_ASSERT(
879  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
880  static_cast<FwAssertArgType>(portNum)
881  );
882 
883  return this->m_eventOut_OutputPort[portNum].isConnected();
884  }
885 
888  {
889  FW_ASSERT(
890  (0 <= portNum) && (portNum < this->getNum_productGetOut_OutputPorts()),
891  static_cast<FwAssertArgType>(portNum)
892  );
893 
894  return this->m_productGetOut_OutputPort[portNum].isConnected();
895  }
896 
899  {
900  FW_ASSERT(
901  (0 <= portNum) && (portNum < this->getNum_productSendOut_OutputPorts()),
902  static_cast<FwAssertArgType>(portNum)
903  );
904 
905  return this->m_productSendOut_OutputPort[portNum].isConnected();
906  }
907 
910  {
911  FW_ASSERT(
912  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
913  static_cast<FwAssertArgType>(portNum)
914  );
915 
916  return this->m_timeCaller_OutputPort[portNum].isConnected();
917  }
918 
921  {
922  FW_ASSERT(
923  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
924  static_cast<FwAssertArgType>(portNum)
925  );
926 
927  return this->m_tlmOut_OutputPort[portNum].isConnected();
928  }
929 
930 #endif
931 
932 #if !FW_DIRECT_PORT_CALLS
933 
934  // ----------------------------------------------------------------------
935  // Connection status queries for typed output ports
936  // ----------------------------------------------------------------------
937 
940  {
941  FW_ASSERT(
942  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
943  static_cast<FwAssertArgType>(portNum)
944  );
945 
946  return this->m_pingOut_OutputPort[portNum].isConnected();
947  }
948 
949 #endif
950 
951  // ----------------------------------------------------------------------
952  // Port handler base-class functions for special input ports
953  //
954  // Call these functions directly to bypass the corresponding ports
955  // ----------------------------------------------------------------------
956 
959  FwIndexType portNum,
960  FwOpcodeType opCode,
961  U32 cmdSeq,
962  Fw::CmdArgBuffer& args
963  )
964  {
965 
966  const U32 idBase = this->getIdBase();
967  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
968 
969  // Select base class function based on opcode
970  switch (opCode - idBase) {
971  case OPCODE_CREATEDIRECTORY: {
973  opCode,
974  cmdSeq,
975  args
976  );
977  break;
978  }
979 
980  case OPCODE_MOVEFILE: {
982  opCode,
983  cmdSeq,
984  args
985  );
986  break;
987  }
988 
989  case OPCODE_REMOVEDIRECTORY: {
991  opCode,
992  cmdSeq,
993  args
994  );
995  break;
996  }
997 
998  case OPCODE_REMOVEFILE: {
1000  opCode,
1001  cmdSeq,
1002  args
1003  );
1004  break;
1005  }
1006 
1007  case OPCODE_APPENDFILE: {
1009  opCode,
1010  cmdSeq,
1011  args
1012  );
1013  break;
1014  }
1015 
1016  case OPCODE_FILESIZE: {
1018  opCode,
1019  cmdSeq,
1020  args
1021  );
1022  break;
1023  }
1024 
1025  case OPCODE_LISTDIRECTORY: {
1027  opCode,
1028  cmdSeq,
1029  args
1030  );
1031  break;
1032  }
1033 
1034  case OPCODE_CALCULATECRC: {
1036  opCode,
1037  cmdSeq,
1038  args
1039  );
1040  break;
1041  }
1042 
1043  case OPCODE_GENERATEDP: {
1045  opCode,
1046  cmdSeq,
1047  args
1048  );
1049  break;
1050  }
1051  default:
1052  // Unknown opcode: ignore it
1053  break;
1054  }
1055  }
1056 
1057  // ----------------------------------------------------------------------
1058  // Port handler base-class functions for typed input ports
1059  //
1060  // Call these functions directly to bypass the corresponding ports
1061  // ----------------------------------------------------------------------
1062 
1065  FwIndexType portNum,
1066  U32 key
1067  )
1068  {
1069  // Make sure port number is valid
1070  FW_ASSERT(
1071  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
1072  static_cast<FwAssertArgType>(portNum)
1073  );
1074 
1075  // Call pre-message hook
1077  portNum,
1078  key
1079  );
1080  ComponentIpcSerializableBuffer msg;
1082 
1083  // Serialize message ID
1084  _status = msg.serializeFrom(
1085  static_cast<FwEnumStoreType>(PINGIN_PING)
1086  );
1087  FW_ASSERT(
1088  _status == Fw::FW_SERIALIZE_OK,
1089  static_cast<FwAssertArgType>(_status)
1090  );
1091 
1092  // Serialize port number
1093  _status = msg.serializeFrom(portNum);
1094  FW_ASSERT(
1095  _status == Fw::FW_SERIALIZE_OK,
1096  static_cast<FwAssertArgType>(_status)
1097  );
1098 
1099  // Serialize argument key
1100  _status = msg.serializeFrom(key);
1101  FW_ASSERT(
1102  _status == Fw::FW_SERIALIZE_OK,
1103  static_cast<FwAssertArgType>(_status)
1104  );
1105 
1106  // Send message
1108  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1109 
1110  if (qStatus == Os::Queue::Status::FULL) {
1111  this->incNumMsgDropped();
1112  return;
1113  }
1114 
1115  FW_ASSERT(
1116  qStatus == Os::Queue::OP_OK,
1117  static_cast<FwAssertArgType>(qStatus)
1118  );
1119  }
1120 
1123  FwIndexType portNum,
1124  U32 context
1125  )
1126  {
1127  // Make sure port number is valid
1128  FW_ASSERT(
1129  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
1130  static_cast<FwAssertArgType>(portNum)
1131  );
1132 
1133  // Call handler function
1134  this->schedIn_handler(
1135  portNum,
1136  context
1137  );
1138  }
1139 
1140  // ----------------------------------------------------------------------
1141  // Pre-message hooks for typed async input ports
1142  //
1143  // Each of these functions is invoked just before processing a message
1144  // on the corresponding port. By default, they do nothing. You can
1145  // override them to provide specific pre-message behavior.
1146  // ----------------------------------------------------------------------
1147 
1150  FwIndexType portNum,
1151  U32 key
1152  )
1153  {
1154  // Default: no-op
1155  }
1156 
1157 #if !FW_DIRECT_PORT_CALLS
1158 
1159  // ----------------------------------------------------------------------
1160  // Invocation functions for typed output ports
1161  // ----------------------------------------------------------------------
1162 
1165  FwIndexType portNum,
1166  U32 key
1167  ) const
1168  {
1169  FW_ASSERT(
1170  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1171  static_cast<FwAssertArgType>(portNum)
1172  );
1173 
1174  FW_ASSERT(
1175  this->m_pingOut_OutputPort[portNum].isConnected(),
1176  static_cast<FwAssertArgType>(portNum)
1177  );
1178  this->m_pingOut_OutputPort[portNum].invoke(
1179  key
1180  );
1181  }
1182 
1183 #endif
1184 
1185  // ----------------------------------------------------------------------
1186  // Hooks for internal ports
1187  //
1188  // Each of these functions is invoked just before dropping a message
1189  // on the corresponding internal port. You should override them to provide
1190  // specific drop behavior.
1191  // ----------------------------------------------------------------------
1192 
1193  // ----------------------------------------------------------------------
1194  // Internal interface base-class functions
1195  // ----------------------------------------------------------------------
1196 
1199  {
1200  ComponentIpcSerializableBuffer msg;
1202 
1203  // Serialize the message ID
1204  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(INT_IF_SCHEDININTERNAL));
1205  FW_ASSERT (
1206  _status == Fw::FW_SERIALIZE_OK,
1207  static_cast<FwAssertArgType>(_status)
1208  );
1209 
1210  // Fake port number to make message dequeue work
1211  _status = msg.serializeFrom(static_cast<FwIndexType>(0));
1212  FW_ASSERT (
1213  _status == Fw::FW_SERIALIZE_OK,
1214  static_cast<FwAssertArgType>(_status)
1215  );
1216 
1217  // Send message
1219  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1220 
1221  if (qStatus == Os::Queue::Status::FULL) {
1223  return;
1224  }
1225 
1226  FW_ASSERT(
1227  qStatus == Os::Queue::OP_OK,
1228  static_cast<FwAssertArgType>(qStatus)
1229  );
1230  }
1231 
1232  // ----------------------------------------------------------------------
1233  // Command response
1234  // ----------------------------------------------------------------------
1235 
1238  FwOpcodeType opCode,
1239  U32 cmdSeq,
1240  Fw::CmdResponse response
1241  )
1242  {
1244  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
1245  }
1246 
1247  // ----------------------------------------------------------------------
1248  // Command handler base-class functions
1249  //
1250  // Call these functions directly to bypass the command input port
1251  // ----------------------------------------------------------------------
1252 
1255  FwOpcodeType opCode,
1256  U32 cmdSeq,
1257  Fw::CmdArgBuffer& args
1258  )
1259  {
1260  // Call pre-message hook
1261  this->CreateDirectory_preMsgHook(opCode,cmdSeq);
1262 
1263  // Defer deserializing arguments to the message dispatcher
1264  // to avoid deserializing and reserializing just for IPC
1265  ComponentIpcSerializableBuffer msg;
1267 
1268  // Serialize for IPC
1269  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CREATEDIRECTORY));
1270  FW_ASSERT (
1271  _status == Fw::FW_SERIALIZE_OK,
1272  static_cast<FwAssertArgType>(_status)
1273  );
1274 
1275  // Fake port number to make message dequeue work
1276  FwIndexType port = 0;
1277 
1278  _status = msg.serializeFrom(port);
1279  FW_ASSERT (
1280  _status == Fw::FW_SERIALIZE_OK,
1281  static_cast<FwAssertArgType>(_status)
1282  );
1283 
1284  _status = msg.serializeFrom(opCode);
1285  FW_ASSERT (
1286  _status == Fw::FW_SERIALIZE_OK,
1287  static_cast<FwAssertArgType>(_status)
1288  );
1289 
1290  _status = msg.serializeFrom(cmdSeq);
1291  FW_ASSERT (
1292  _status == Fw::FW_SERIALIZE_OK,
1293  static_cast<FwAssertArgType>(_status)
1294  );
1295 
1296  _status = msg.serializeFrom(args);
1297  FW_ASSERT (
1298  _status == Fw::FW_SERIALIZE_OK,
1299  static_cast<FwAssertArgType>(_status)
1300  );
1301 
1302  // Send message
1304  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1305 
1306  FW_ASSERT(
1307  qStatus == Os::Queue::OP_OK,
1308  static_cast<FwAssertArgType>(qStatus)
1309  );
1310  }
1311 
1314  FwOpcodeType opCode,
1315  U32 cmdSeq,
1316  Fw::CmdArgBuffer& args
1317  )
1318  {
1319  // Call pre-message hook
1320  this->MoveFile_preMsgHook(opCode,cmdSeq);
1321 
1322  // Defer deserializing arguments to the message dispatcher
1323  // to avoid deserializing and reserializing just for IPC
1324  ComponentIpcSerializableBuffer msg;
1326 
1327  // Serialize for IPC
1328  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_MOVEFILE));
1329  FW_ASSERT (
1330  _status == Fw::FW_SERIALIZE_OK,
1331  static_cast<FwAssertArgType>(_status)
1332  );
1333 
1334  // Fake port number to make message dequeue work
1335  FwIndexType port = 0;
1336 
1337  _status = msg.serializeFrom(port);
1338  FW_ASSERT (
1339  _status == Fw::FW_SERIALIZE_OK,
1340  static_cast<FwAssertArgType>(_status)
1341  );
1342 
1343  _status = msg.serializeFrom(opCode);
1344  FW_ASSERT (
1345  _status == Fw::FW_SERIALIZE_OK,
1346  static_cast<FwAssertArgType>(_status)
1347  );
1348 
1349  _status = msg.serializeFrom(cmdSeq);
1350  FW_ASSERT (
1351  _status == Fw::FW_SERIALIZE_OK,
1352  static_cast<FwAssertArgType>(_status)
1353  );
1354 
1355  _status = msg.serializeFrom(args);
1356  FW_ASSERT (
1357  _status == Fw::FW_SERIALIZE_OK,
1358  static_cast<FwAssertArgType>(_status)
1359  );
1360 
1361  // Send message
1363  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1364 
1365  FW_ASSERT(
1366  qStatus == Os::Queue::OP_OK,
1367  static_cast<FwAssertArgType>(qStatus)
1368  );
1369  }
1370 
1373  FwOpcodeType opCode,
1374  U32 cmdSeq,
1375  Fw::CmdArgBuffer& args
1376  )
1377  {
1378  // Call pre-message hook
1379  this->RemoveDirectory_preMsgHook(opCode,cmdSeq);
1380 
1381  // Defer deserializing arguments to the message dispatcher
1382  // to avoid deserializing and reserializing just for IPC
1383  ComponentIpcSerializableBuffer msg;
1385 
1386  // Serialize for IPC
1387  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_REMOVEDIRECTORY));
1388  FW_ASSERT (
1389  _status == Fw::FW_SERIALIZE_OK,
1390  static_cast<FwAssertArgType>(_status)
1391  );
1392 
1393  // Fake port number to make message dequeue work
1394  FwIndexType port = 0;
1395 
1396  _status = msg.serializeFrom(port);
1397  FW_ASSERT (
1398  _status == Fw::FW_SERIALIZE_OK,
1399  static_cast<FwAssertArgType>(_status)
1400  );
1401 
1402  _status = msg.serializeFrom(opCode);
1403  FW_ASSERT (
1404  _status == Fw::FW_SERIALIZE_OK,
1405  static_cast<FwAssertArgType>(_status)
1406  );
1407 
1408  _status = msg.serializeFrom(cmdSeq);
1409  FW_ASSERT (
1410  _status == Fw::FW_SERIALIZE_OK,
1411  static_cast<FwAssertArgType>(_status)
1412  );
1413 
1414  _status = msg.serializeFrom(args);
1415  FW_ASSERT (
1416  _status == Fw::FW_SERIALIZE_OK,
1417  static_cast<FwAssertArgType>(_status)
1418  );
1419 
1420  // Send message
1422  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1423 
1424  FW_ASSERT(
1425  qStatus == Os::Queue::OP_OK,
1426  static_cast<FwAssertArgType>(qStatus)
1427  );
1428  }
1429 
1432  FwOpcodeType opCode,
1433  U32 cmdSeq,
1434  Fw::CmdArgBuffer& args
1435  )
1436  {
1437  // Call pre-message hook
1438  this->RemoveFile_preMsgHook(opCode,cmdSeq);
1439 
1440  // Defer deserializing arguments to the message dispatcher
1441  // to avoid deserializing and reserializing just for IPC
1442  ComponentIpcSerializableBuffer msg;
1444 
1445  // Serialize for IPC
1446  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_REMOVEFILE));
1447  FW_ASSERT (
1448  _status == Fw::FW_SERIALIZE_OK,
1449  static_cast<FwAssertArgType>(_status)
1450  );
1451 
1452  // Fake port number to make message dequeue work
1453  FwIndexType port = 0;
1454 
1455  _status = msg.serializeFrom(port);
1456  FW_ASSERT (
1457  _status == Fw::FW_SERIALIZE_OK,
1458  static_cast<FwAssertArgType>(_status)
1459  );
1460 
1461  _status = msg.serializeFrom(opCode);
1462  FW_ASSERT (
1463  _status == Fw::FW_SERIALIZE_OK,
1464  static_cast<FwAssertArgType>(_status)
1465  );
1466 
1467  _status = msg.serializeFrom(cmdSeq);
1468  FW_ASSERT (
1469  _status == Fw::FW_SERIALIZE_OK,
1470  static_cast<FwAssertArgType>(_status)
1471  );
1472 
1473  _status = msg.serializeFrom(args);
1474  FW_ASSERT (
1475  _status == Fw::FW_SERIALIZE_OK,
1476  static_cast<FwAssertArgType>(_status)
1477  );
1478 
1479  // Send message
1481  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1482 
1483  FW_ASSERT(
1484  qStatus == Os::Queue::OP_OK,
1485  static_cast<FwAssertArgType>(qStatus)
1486  );
1487  }
1488 
1491  FwOpcodeType opCode,
1492  U32 cmdSeq,
1493  Fw::CmdArgBuffer& args
1494  )
1495  {
1496  // Call pre-message hook
1497  this->AppendFile_preMsgHook(opCode,cmdSeq);
1498 
1499  // Defer deserializing arguments to the message dispatcher
1500  // to avoid deserializing and reserializing just for IPC
1501  ComponentIpcSerializableBuffer msg;
1503 
1504  // Serialize for IPC
1505  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_APPENDFILE));
1506  FW_ASSERT (
1507  _status == Fw::FW_SERIALIZE_OK,
1508  static_cast<FwAssertArgType>(_status)
1509  );
1510 
1511  // Fake port number to make message dequeue work
1512  FwIndexType port = 0;
1513 
1514  _status = msg.serializeFrom(port);
1515  FW_ASSERT (
1516  _status == Fw::FW_SERIALIZE_OK,
1517  static_cast<FwAssertArgType>(_status)
1518  );
1519 
1520  _status = msg.serializeFrom(opCode);
1521  FW_ASSERT (
1522  _status == Fw::FW_SERIALIZE_OK,
1523  static_cast<FwAssertArgType>(_status)
1524  );
1525 
1526  _status = msg.serializeFrom(cmdSeq);
1527  FW_ASSERT (
1528  _status == Fw::FW_SERIALIZE_OK,
1529  static_cast<FwAssertArgType>(_status)
1530  );
1531 
1532  _status = msg.serializeFrom(args);
1533  FW_ASSERT (
1534  _status == Fw::FW_SERIALIZE_OK,
1535  static_cast<FwAssertArgType>(_status)
1536  );
1537 
1538  // Send message
1540  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1541 
1542  FW_ASSERT(
1543  qStatus == Os::Queue::OP_OK,
1544  static_cast<FwAssertArgType>(qStatus)
1545  );
1546  }
1547 
1550  FwOpcodeType opCode,
1551  U32 cmdSeq,
1552  Fw::CmdArgBuffer& args
1553  )
1554  {
1555  // Call pre-message hook
1556  this->FileSize_preMsgHook(opCode,cmdSeq);
1557 
1558  // Defer deserializing arguments to the message dispatcher
1559  // to avoid deserializing and reserializing just for IPC
1560  ComponentIpcSerializableBuffer msg;
1562 
1563  // Serialize for IPC
1564  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_FILESIZE));
1565  FW_ASSERT (
1566  _status == Fw::FW_SERIALIZE_OK,
1567  static_cast<FwAssertArgType>(_status)
1568  );
1569 
1570  // Fake port number to make message dequeue work
1571  FwIndexType port = 0;
1572 
1573  _status = msg.serializeFrom(port);
1574  FW_ASSERT (
1575  _status == Fw::FW_SERIALIZE_OK,
1576  static_cast<FwAssertArgType>(_status)
1577  );
1578 
1579  _status = msg.serializeFrom(opCode);
1580  FW_ASSERT (
1581  _status == Fw::FW_SERIALIZE_OK,
1582  static_cast<FwAssertArgType>(_status)
1583  );
1584 
1585  _status = msg.serializeFrom(cmdSeq);
1586  FW_ASSERT (
1587  _status == Fw::FW_SERIALIZE_OK,
1588  static_cast<FwAssertArgType>(_status)
1589  );
1590 
1591  _status = msg.serializeFrom(args);
1592  FW_ASSERT (
1593  _status == Fw::FW_SERIALIZE_OK,
1594  static_cast<FwAssertArgType>(_status)
1595  );
1596 
1597  // Send message
1599  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1600 
1601  FW_ASSERT(
1602  qStatus == Os::Queue::OP_OK,
1603  static_cast<FwAssertArgType>(qStatus)
1604  );
1605  }
1606 
1609  FwOpcodeType opCode,
1610  U32 cmdSeq,
1611  Fw::CmdArgBuffer& args
1612  )
1613  {
1614  // Call pre-message hook
1615  this->ListDirectory_preMsgHook(opCode,cmdSeq);
1616 
1617  // Defer deserializing arguments to the message dispatcher
1618  // to avoid deserializing and reserializing just for IPC
1619  ComponentIpcSerializableBuffer msg;
1621 
1622  // Serialize for IPC
1623  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_LISTDIRECTORY));
1624  FW_ASSERT (
1625  _status == Fw::FW_SERIALIZE_OK,
1626  static_cast<FwAssertArgType>(_status)
1627  );
1628 
1629  // Fake port number to make message dequeue work
1630  FwIndexType port = 0;
1631 
1632  _status = msg.serializeFrom(port);
1633  FW_ASSERT (
1634  _status == Fw::FW_SERIALIZE_OK,
1635  static_cast<FwAssertArgType>(_status)
1636  );
1637 
1638  _status = msg.serializeFrom(opCode);
1639  FW_ASSERT (
1640  _status == Fw::FW_SERIALIZE_OK,
1641  static_cast<FwAssertArgType>(_status)
1642  );
1643 
1644  _status = msg.serializeFrom(cmdSeq);
1645  FW_ASSERT (
1646  _status == Fw::FW_SERIALIZE_OK,
1647  static_cast<FwAssertArgType>(_status)
1648  );
1649 
1650  _status = msg.serializeFrom(args);
1651  FW_ASSERT (
1652  _status == Fw::FW_SERIALIZE_OK,
1653  static_cast<FwAssertArgType>(_status)
1654  );
1655 
1656  // Send message
1658  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1659 
1660  FW_ASSERT(
1661  qStatus == Os::Queue::OP_OK,
1662  static_cast<FwAssertArgType>(qStatus)
1663  );
1664  }
1665 
1668  FwOpcodeType opCode,
1669  U32 cmdSeq,
1670  Fw::CmdArgBuffer& args
1671  )
1672  {
1673  // Call pre-message hook
1674  this->CalculateCrc_preMsgHook(opCode,cmdSeq);
1675 
1676  // Defer deserializing arguments to the message dispatcher
1677  // to avoid deserializing and reserializing just for IPC
1678  ComponentIpcSerializableBuffer msg;
1680 
1681  // Serialize for IPC
1682  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CALCULATECRC));
1683  FW_ASSERT (
1684  _status == Fw::FW_SERIALIZE_OK,
1685  static_cast<FwAssertArgType>(_status)
1686  );
1687 
1688  // Fake port number to make message dequeue work
1689  FwIndexType port = 0;
1690 
1691  _status = msg.serializeFrom(port);
1692  FW_ASSERT (
1693  _status == Fw::FW_SERIALIZE_OK,
1694  static_cast<FwAssertArgType>(_status)
1695  );
1696 
1697  _status = msg.serializeFrom(opCode);
1698  FW_ASSERT (
1699  _status == Fw::FW_SERIALIZE_OK,
1700  static_cast<FwAssertArgType>(_status)
1701  );
1702 
1703  _status = msg.serializeFrom(cmdSeq);
1704  FW_ASSERT (
1705  _status == Fw::FW_SERIALIZE_OK,
1706  static_cast<FwAssertArgType>(_status)
1707  );
1708 
1709  _status = msg.serializeFrom(args);
1710  FW_ASSERT (
1711  _status == Fw::FW_SERIALIZE_OK,
1712  static_cast<FwAssertArgType>(_status)
1713  );
1714 
1715  // Send message
1717  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1718 
1719  FW_ASSERT(
1720  qStatus == Os::Queue::OP_OK,
1721  static_cast<FwAssertArgType>(qStatus)
1722  );
1723  }
1724 
1727  FwOpcodeType opCode,
1728  U32 cmdSeq,
1729  Fw::CmdArgBuffer& args
1730  )
1731  {
1732  // Call pre-message hook
1733  this->GenerateDp_preMsgHook(opCode,cmdSeq);
1734 
1735  // Defer deserializing arguments to the message dispatcher
1736  // to avoid deserializing and reserializing just for IPC
1737  ComponentIpcSerializableBuffer msg;
1739 
1740  // Serialize for IPC
1741  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_GENERATEDP));
1742  FW_ASSERT (
1743  _status == Fw::FW_SERIALIZE_OK,
1744  static_cast<FwAssertArgType>(_status)
1745  );
1746 
1747  // Fake port number to make message dequeue work
1748  FwIndexType port = 0;
1749 
1750  _status = msg.serializeFrom(port);
1751  FW_ASSERT (
1752  _status == Fw::FW_SERIALIZE_OK,
1753  static_cast<FwAssertArgType>(_status)
1754  );
1755 
1756  _status = msg.serializeFrom(opCode);
1757  FW_ASSERT (
1758  _status == Fw::FW_SERIALIZE_OK,
1759  static_cast<FwAssertArgType>(_status)
1760  );
1761 
1762  _status = msg.serializeFrom(cmdSeq);
1763  FW_ASSERT (
1764  _status == Fw::FW_SERIALIZE_OK,
1765  static_cast<FwAssertArgType>(_status)
1766  );
1767 
1768  _status = msg.serializeFrom(args);
1769  FW_ASSERT (
1770  _status == Fw::FW_SERIALIZE_OK,
1771  static_cast<FwAssertArgType>(_status)
1772  );
1773 
1774  // Send message
1776  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1777 
1778  FW_ASSERT(
1779  qStatus == Os::Queue::OP_OK,
1780  static_cast<FwAssertArgType>(qStatus)
1781  );
1782  }
1783 
1784  // ----------------------------------------------------------------------
1785  // Pre-message hooks for async commands
1786  //
1787  // Each of these functions is invoked just before processing the
1788  // corresponding command. By default they do nothing. You can
1789  // override them to provide specific pre-command behavior.
1790  // ----------------------------------------------------------------------
1791 
1794  FwOpcodeType opCode,
1795  U32 cmdSeq
1796  )
1797  {
1798  // Defaults to no-op; can be overridden
1799  (void) opCode;
1800  (void) cmdSeq;
1801  }
1802 
1805  FwOpcodeType opCode,
1806  U32 cmdSeq
1807  )
1808  {
1809  // Defaults to no-op; can be overridden
1810  (void) opCode;
1811  (void) cmdSeq;
1812  }
1813 
1816  FwOpcodeType opCode,
1817  U32 cmdSeq
1818  )
1819  {
1820  // Defaults to no-op; can be overridden
1821  (void) opCode;
1822  (void) cmdSeq;
1823  }
1824 
1827  FwOpcodeType opCode,
1828  U32 cmdSeq
1829  )
1830  {
1831  // Defaults to no-op; can be overridden
1832  (void) opCode;
1833  (void) cmdSeq;
1834  }
1835 
1838  FwOpcodeType opCode,
1839  U32 cmdSeq
1840  )
1841  {
1842  // Defaults to no-op; can be overridden
1843  (void) opCode;
1844  (void) cmdSeq;
1845  }
1846 
1849  FwOpcodeType opCode,
1850  U32 cmdSeq
1851  )
1852  {
1853  // Defaults to no-op; can be overridden
1854  (void) opCode;
1855  (void) cmdSeq;
1856  }
1857 
1860  FwOpcodeType opCode,
1861  U32 cmdSeq
1862  )
1863  {
1864  // Defaults to no-op; can be overridden
1865  (void) opCode;
1866  (void) cmdSeq;
1867  }
1868 
1871  FwOpcodeType opCode,
1872  U32 cmdSeq
1873  )
1874  {
1875  // Defaults to no-op; can be overridden
1876  (void) opCode;
1877  (void) cmdSeq;
1878  }
1879 
1882  FwOpcodeType opCode,
1883  U32 cmdSeq
1884  )
1885  {
1886  // Defaults to no-op; can be overridden
1887  (void) opCode;
1888  (void) cmdSeq;
1889  }
1890 
1891  // ----------------------------------------------------------------------
1892  // Event logging functions
1893  // ----------------------------------------------------------------------
1894 
1897  const Fw::StringBase& dirName,
1898  U32 status
1899  ) const
1900  {
1901  // Get the time
1902  Fw::Time _logTime;
1903  if (this->isConnected_timeCaller_OutputPort(0)) {
1904  this->timeCaller_out(0, _logTime);
1905  }
1906 
1908 
1909  // Emit the event on the log port
1910  if (this->isConnected_eventOut_OutputPort(0)) {
1911  Fw::LogBuffer _logBuff;
1913 
1914 #if FW_AMPCS_COMPATIBLE
1915  // Serialize the number of arguments
1916  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1917  FW_ASSERT(
1918  _status == Fw::FW_SERIALIZE_OK,
1919  static_cast<FwAssertArgType>(_status)
1920  );
1921 #endif
1922 
1923  _status = dirName.serializeTo(
1924  _logBuff,
1925  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
1926  );
1927  FW_ASSERT(
1928  _status == Fw::FW_SERIALIZE_OK,
1929  static_cast<FwAssertArgType>(_status)
1930  );
1931 
1932 #if FW_AMPCS_COMPATIBLE
1933  // Serialize the argument size
1934  _status = _logBuff.serializeFrom(
1935  static_cast<U8>(sizeof(U32))
1936  );
1937  FW_ASSERT(
1938  _status == Fw::FW_SERIALIZE_OK,
1939  static_cast<FwAssertArgType>(_status)
1940  );
1941 #endif
1942  _status = _logBuff.serializeFrom(status);
1943  FW_ASSERT(
1944  _status == Fw::FW_SERIALIZE_OK,
1945  static_cast<FwAssertArgType>(_status)
1946  );
1947 
1948  this->eventOut_out(
1949  0,
1950  _id,
1951  _logTime,
1953  _logBuff
1954  );
1955  }
1956 
1957  // Emit the event on the text log port
1958 #if FW_ENABLE_TEXT_LOGGING
1959  if (this->isConnected_LogText_OutputPort(0)) {
1960 #if FW_OBJECT_NAMES == 1
1961  const char* _formatString =
1962  "(%s) %s: Could not create directory %s, returned status %" PRIu32 "";
1963 #else
1964  const char* _formatString =
1965  "%s: Could not create directory %s, returned status %" PRIu32 "";
1966 #endif
1967 
1968  Fw::TextLogString _logString;
1969  (void) _logString.format(
1970  _formatString,
1971 #if FW_OBJECT_NAMES == 1
1972  this->m_objName.toChar(),
1973 #endif
1974  "DirectoryCreateError ",
1975  dirName.toChar(),
1976  status
1977  );
1978 
1979  this->LogText_out(
1980  0,
1981  _id,
1982  _logTime,
1984  _logString
1985  );
1986  }
1987 #endif
1988  }
1989 
1992  const Fw::StringBase& dirName,
1993  U32 status
1994  ) const
1995  {
1996  // Get the time
1997  Fw::Time _logTime;
1998  if (this->isConnected_timeCaller_OutputPort(0)) {
1999  this->timeCaller_out(0, _logTime);
2000  }
2001 
2003 
2004  // Emit the event on the log port
2005  if (this->isConnected_eventOut_OutputPort(0)) {
2006  Fw::LogBuffer _logBuff;
2008 
2009 #if FW_AMPCS_COMPATIBLE
2010  // Serialize the number of arguments
2011  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2012  FW_ASSERT(
2013  _status == Fw::FW_SERIALIZE_OK,
2014  static_cast<FwAssertArgType>(_status)
2015  );
2016 #endif
2017 
2018  _status = dirName.serializeTo(
2019  _logBuff,
2020  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2021  );
2022  FW_ASSERT(
2023  _status == Fw::FW_SERIALIZE_OK,
2024  static_cast<FwAssertArgType>(_status)
2025  );
2026 
2027 #if FW_AMPCS_COMPATIBLE
2028  // Serialize the argument size
2029  _status = _logBuff.serializeFrom(
2030  static_cast<U8>(sizeof(U32))
2031  );
2032  FW_ASSERT(
2033  _status == Fw::FW_SERIALIZE_OK,
2034  static_cast<FwAssertArgType>(_status)
2035  );
2036 #endif
2037  _status = _logBuff.serializeFrom(status);
2038  FW_ASSERT(
2039  _status == Fw::FW_SERIALIZE_OK,
2040  static_cast<FwAssertArgType>(_status)
2041  );
2042 
2043  this->eventOut_out(
2044  0,
2045  _id,
2046  _logTime,
2048  _logBuff
2049  );
2050  }
2051 
2052  // Emit the event on the text log port
2053 #if FW_ENABLE_TEXT_LOGGING
2054  if (this->isConnected_LogText_OutputPort(0)) {
2055 #if FW_OBJECT_NAMES == 1
2056  const char* _formatString =
2057  "(%s) %s: Could not remove directory %s, returned status %" PRIu32 "";
2058 #else
2059  const char* _formatString =
2060  "%s: Could not remove directory %s, returned status %" PRIu32 "";
2061 #endif
2062 
2063  Fw::TextLogString _logString;
2064  (void) _logString.format(
2065  _formatString,
2066 #if FW_OBJECT_NAMES == 1
2067  this->m_objName.toChar(),
2068 #endif
2069  "DirectoryRemoveError ",
2070  dirName.toChar(),
2071  status
2072  );
2073 
2074  this->LogText_out(
2075  0,
2076  _id,
2077  _logTime,
2079  _logString
2080  );
2081  }
2082 #endif
2083  }
2084 
2087  const Fw::StringBase& sourceFileName,
2088  const Fw::StringBase& destFileName,
2089  U32 status
2090  ) const
2091  {
2092  // Get the time
2093  Fw::Time _logTime;
2094  if (this->isConnected_timeCaller_OutputPort(0)) {
2095  this->timeCaller_out(0, _logTime);
2096  }
2097 
2098  const FwEventIdType _id = this->getIdBase() + EVENTID_FILEMOVEERROR;
2099 
2100  // Emit the event on the log port
2101  if (this->isConnected_eventOut_OutputPort(0)) {
2102  Fw::LogBuffer _logBuff;
2104 
2105 #if FW_AMPCS_COMPATIBLE
2106  // Serialize the number of arguments
2107  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2108  FW_ASSERT(
2109  _status == Fw::FW_SERIALIZE_OK,
2110  static_cast<FwAssertArgType>(_status)
2111  );
2112 #endif
2113 
2114  _status = sourceFileName.serializeTo(
2115  _logBuff,
2116  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2117  );
2118  FW_ASSERT(
2119  _status == Fw::FW_SERIALIZE_OK,
2120  static_cast<FwAssertArgType>(_status)
2121  );
2122 
2123  _status = destFileName.serializeTo(
2124  _logBuff,
2125  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2126  );
2127  FW_ASSERT(
2128  _status == Fw::FW_SERIALIZE_OK,
2129  static_cast<FwAssertArgType>(_status)
2130  );
2131 
2132 #if FW_AMPCS_COMPATIBLE
2133  // Serialize the argument size
2134  _status = _logBuff.serializeFrom(
2135  static_cast<U8>(sizeof(U32))
2136  );
2137  FW_ASSERT(
2138  _status == Fw::FW_SERIALIZE_OK,
2139  static_cast<FwAssertArgType>(_status)
2140  );
2141 #endif
2142  _status = _logBuff.serializeFrom(status);
2143  FW_ASSERT(
2144  _status == Fw::FW_SERIALIZE_OK,
2145  static_cast<FwAssertArgType>(_status)
2146  );
2147 
2148  this->eventOut_out(
2149  0,
2150  _id,
2151  _logTime,
2153  _logBuff
2154  );
2155  }
2156 
2157  // Emit the event on the text log port
2158 #if FW_ENABLE_TEXT_LOGGING
2159  if (this->isConnected_LogText_OutputPort(0)) {
2160 #if FW_OBJECT_NAMES == 1
2161  const char* _formatString =
2162  "(%s) %s: Could not move file %s to file %s, returned status %" PRIu32 "";
2163 #else
2164  const char* _formatString =
2165  "%s: Could not move file %s to file %s, returned status %" PRIu32 "";
2166 #endif
2167 
2168  Fw::TextLogString _logString;
2169  (void) _logString.format(
2170  _formatString,
2171 #if FW_OBJECT_NAMES == 1
2172  this->m_objName.toChar(),
2173 #endif
2174  "FileMoveError ",
2175  sourceFileName.toChar(),
2176  destFileName.toChar(),
2177  status
2178  );
2179 
2180  this->LogText_out(
2181  0,
2182  _id,
2183  _logTime,
2185  _logString
2186  );
2187  }
2188 #endif
2189  }
2190 
2193  const Fw::StringBase& fileName,
2194  U32 status
2195  ) const
2196  {
2197  // Get the time
2198  Fw::Time _logTime;
2199  if (this->isConnected_timeCaller_OutputPort(0)) {
2200  this->timeCaller_out(0, _logTime);
2201  }
2202 
2203  const FwEventIdType _id = this->getIdBase() + EVENTID_FILEREMOVEERROR;
2204 
2205  // Emit the event on the log port
2206  if (this->isConnected_eventOut_OutputPort(0)) {
2207  Fw::LogBuffer _logBuff;
2209 
2210 #if FW_AMPCS_COMPATIBLE
2211  // Serialize the number of arguments
2212  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2213  FW_ASSERT(
2214  _status == Fw::FW_SERIALIZE_OK,
2215  static_cast<FwAssertArgType>(_status)
2216  );
2217 #endif
2218 
2219  _status = fileName.serializeTo(
2220  _logBuff,
2221  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2222  );
2223  FW_ASSERT(
2224  _status == Fw::FW_SERIALIZE_OK,
2225  static_cast<FwAssertArgType>(_status)
2226  );
2227 
2228 #if FW_AMPCS_COMPATIBLE
2229  // Serialize the argument size
2230  _status = _logBuff.serializeFrom(
2231  static_cast<U8>(sizeof(U32))
2232  );
2233  FW_ASSERT(
2234  _status == Fw::FW_SERIALIZE_OK,
2235  static_cast<FwAssertArgType>(_status)
2236  );
2237 #endif
2238  _status = _logBuff.serializeFrom(status);
2239  FW_ASSERT(
2240  _status == Fw::FW_SERIALIZE_OK,
2241  static_cast<FwAssertArgType>(_status)
2242  );
2243 
2244  this->eventOut_out(
2245  0,
2246  _id,
2247  _logTime,
2249  _logBuff
2250  );
2251  }
2252 
2253  // Emit the event on the text log port
2254 #if FW_ENABLE_TEXT_LOGGING
2255  if (this->isConnected_LogText_OutputPort(0)) {
2256 #if FW_OBJECT_NAMES == 1
2257  const char* _formatString =
2258  "(%s) %s: Could not remove file %s, returned status %" PRIu32 "";
2259 #else
2260  const char* _formatString =
2261  "%s: Could not remove file %s, returned status %" PRIu32 "";
2262 #endif
2263 
2264  Fw::TextLogString _logString;
2265  (void) _logString.format(
2266  _formatString,
2267 #if FW_OBJECT_NAMES == 1
2268  this->m_objName.toChar(),
2269 #endif
2270  "FileRemoveError ",
2271  fileName.toChar(),
2272  status
2273  );
2274 
2275  this->LogText_out(
2276  0,
2277  _id,
2278  _logTime,
2280  _logString
2281  );
2282  }
2283 #endif
2284  }
2285 
2288  const Fw::StringBase& source,
2289  const Fw::StringBase& target,
2290  U32 status
2291  ) const
2292  {
2293  // Get the time
2294  Fw::Time _logTime;
2295  if (this->isConnected_timeCaller_OutputPort(0)) {
2296  this->timeCaller_out(0, _logTime);
2297  }
2298 
2299  const FwEventIdType _id = this->getIdBase() + EVENTID_APPENDFILEFAILED;
2300 
2301  // Emit the event on the log port
2302  if (this->isConnected_eventOut_OutputPort(0)) {
2303  Fw::LogBuffer _logBuff;
2305 
2306 #if FW_AMPCS_COMPATIBLE
2307  // Serialize the number of arguments
2308  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2309  FW_ASSERT(
2310  _status == Fw::FW_SERIALIZE_OK,
2311  static_cast<FwAssertArgType>(_status)
2312  );
2313 #endif
2314 
2315  _status = source.serializeTo(
2316  _logBuff,
2317  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2318  );
2319  FW_ASSERT(
2320  _status == Fw::FW_SERIALIZE_OK,
2321  static_cast<FwAssertArgType>(_status)
2322  );
2323 
2324  _status = target.serializeTo(
2325  _logBuff,
2326  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2327  );
2328  FW_ASSERT(
2329  _status == Fw::FW_SERIALIZE_OK,
2330  static_cast<FwAssertArgType>(_status)
2331  );
2332 
2333 #if FW_AMPCS_COMPATIBLE
2334  // Serialize the argument size
2335  _status = _logBuff.serializeFrom(
2336  static_cast<U8>(sizeof(U32))
2337  );
2338  FW_ASSERT(
2339  _status == Fw::FW_SERIALIZE_OK,
2340  static_cast<FwAssertArgType>(_status)
2341  );
2342 #endif
2343  _status = _logBuff.serializeFrom(status);
2344  FW_ASSERT(
2345  _status == Fw::FW_SERIALIZE_OK,
2346  static_cast<FwAssertArgType>(_status)
2347  );
2348 
2349  this->eventOut_out(
2350  0,
2351  _id,
2352  _logTime,
2354  _logBuff
2355  );
2356  }
2357 
2358  // Emit the event on the text log port
2359 #if FW_ENABLE_TEXT_LOGGING
2360  if (this->isConnected_LogText_OutputPort(0)) {
2361 #if FW_OBJECT_NAMES == 1
2362  const char* _formatString =
2363  "(%s) %s: Appending %s onto %s failed with status %" PRIu32 "";
2364 #else
2365  const char* _formatString =
2366  "%s: Appending %s onto %s failed with status %" PRIu32 "";
2367 #endif
2368 
2369  Fw::TextLogString _logString;
2370  (void) _logString.format(
2371  _formatString,
2372 #if FW_OBJECT_NAMES == 1
2373  this->m_objName.toChar(),
2374 #endif
2375  "AppendFileFailed ",
2376  source.toChar(),
2377  target.toChar(),
2378  status
2379  );
2380 
2381  this->LogText_out(
2382  0,
2383  _id,
2384  _logTime,
2386  _logString
2387  );
2388  }
2389 #endif
2390  }
2391 
2394  const Fw::StringBase& source,
2395  const Fw::StringBase& target
2396  ) const
2397  {
2398  // Get the time
2399  Fw::Time _logTime;
2400  if (this->isConnected_timeCaller_OutputPort(0)) {
2401  this->timeCaller_out(0, _logTime);
2402  }
2403 
2404  const FwEventIdType _id = this->getIdBase() + EVENTID_APPENDFILESUCCEEDED;
2405 
2406  // Emit the event on the log port
2407  if (this->isConnected_eventOut_OutputPort(0)) {
2408  Fw::LogBuffer _logBuff;
2410 
2411 #if FW_AMPCS_COMPATIBLE
2412  // Serialize the number of arguments
2413  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2414  FW_ASSERT(
2415  _status == Fw::FW_SERIALIZE_OK,
2416  static_cast<FwAssertArgType>(_status)
2417  );
2418 #endif
2419 
2420  _status = source.serializeTo(
2421  _logBuff,
2422  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2423  );
2424  FW_ASSERT(
2425  _status == Fw::FW_SERIALIZE_OK,
2426  static_cast<FwAssertArgType>(_status)
2427  );
2428 
2429  _status = target.serializeTo(
2430  _logBuff,
2431  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2432  );
2433  FW_ASSERT(
2434  _status == Fw::FW_SERIALIZE_OK,
2435  static_cast<FwAssertArgType>(_status)
2436  );
2437 
2438  this->eventOut_out(
2439  0,
2440  _id,
2441  _logTime,
2443  _logBuff
2444  );
2445  }
2446 
2447  // Emit the event on the text log port
2448 #if FW_ENABLE_TEXT_LOGGING
2449  if (this->isConnected_LogText_OutputPort(0)) {
2450 #if FW_OBJECT_NAMES == 1
2451  const char* _formatString =
2452  "(%s) %s: Appended %s to the end of %s";
2453 #else
2454  const char* _formatString =
2455  "%s: Appended %s to the end of %s";
2456 #endif
2457 
2458  Fw::TextLogString _logString;
2459  (void) _logString.format(
2460  _formatString,
2461 #if FW_OBJECT_NAMES == 1
2462  this->m_objName.toChar(),
2463 #endif
2464  "AppendFileSucceeded ",
2465  source.toChar(),
2466  target.toChar()
2467  );
2468 
2469  this->LogText_out(
2470  0,
2471  _id,
2472  _logTime,
2474  _logString
2475  );
2476  }
2477 #endif
2478  }
2479 
2482  {
2483  // Get the time
2484  Fw::Time _logTime;
2485  if (this->isConnected_timeCaller_OutputPort(0)) {
2486  this->timeCaller_out(0, _logTime);
2487  }
2488 
2490 
2491  // Emit the event on the log port
2492  if (this->isConnected_eventOut_OutputPort(0)) {
2493  Fw::LogBuffer _logBuff;
2495 
2496 #if FW_AMPCS_COMPATIBLE
2497  // Serialize the number of arguments
2498  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2499  FW_ASSERT(
2500  _status == Fw::FW_SERIALIZE_OK,
2501  static_cast<FwAssertArgType>(_status)
2502  );
2503 #endif
2504 
2505  _status = dirName.serializeTo(
2506  _logBuff,
2507  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2508  );
2509  FW_ASSERT(
2510  _status == Fw::FW_SERIALIZE_OK,
2511  static_cast<FwAssertArgType>(_status)
2512  );
2513 
2514  this->eventOut_out(
2515  0,
2516  _id,
2517  _logTime,
2519  _logBuff
2520  );
2521  }
2522 
2523  // Emit the event on the text log port
2524 #if FW_ENABLE_TEXT_LOGGING
2525  if (this->isConnected_LogText_OutputPort(0)) {
2526 #if FW_OBJECT_NAMES == 1
2527  const char* _formatString =
2528  "(%s) %s: Created directory %s successfully";
2529 #else
2530  const char* _formatString =
2531  "%s: Created directory %s successfully";
2532 #endif
2533 
2534  Fw::TextLogString _logString;
2535  (void) _logString.format(
2536  _formatString,
2537 #if FW_OBJECT_NAMES == 1
2538  this->m_objName.toChar(),
2539 #endif
2540  "CreateDirectorySucceeded ",
2541  dirName.toChar()
2542  );
2543 
2544  this->LogText_out(
2545  0,
2546  _id,
2547  _logTime,
2549  _logString
2550  );
2551  }
2552 #endif
2553  }
2554 
2557  {
2558  // Get the time
2559  Fw::Time _logTime;
2560  if (this->isConnected_timeCaller_OutputPort(0)) {
2561  this->timeCaller_out(0, _logTime);
2562  }
2563 
2565 
2566  // Emit the event on the log port
2567  if (this->isConnected_eventOut_OutputPort(0)) {
2568  Fw::LogBuffer _logBuff;
2570 
2571 #if FW_AMPCS_COMPATIBLE
2572  // Serialize the number of arguments
2573  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2574  FW_ASSERT(
2575  _status == Fw::FW_SERIALIZE_OK,
2576  static_cast<FwAssertArgType>(_status)
2577  );
2578 #endif
2579 
2580  _status = dirName.serializeTo(
2581  _logBuff,
2582  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2583  );
2584  FW_ASSERT(
2585  _status == Fw::FW_SERIALIZE_OK,
2586  static_cast<FwAssertArgType>(_status)
2587  );
2588 
2589  this->eventOut_out(
2590  0,
2591  _id,
2592  _logTime,
2594  _logBuff
2595  );
2596  }
2597 
2598  // Emit the event on the text log port
2599 #if FW_ENABLE_TEXT_LOGGING
2600  if (this->isConnected_LogText_OutputPort(0)) {
2601 #if FW_OBJECT_NAMES == 1
2602  const char* _formatString =
2603  "(%s) %s: Removed directory %s successfully";
2604 #else
2605  const char* _formatString =
2606  "%s: Removed directory %s successfully";
2607 #endif
2608 
2609  Fw::TextLogString _logString;
2610  (void) _logString.format(
2611  _formatString,
2612 #if FW_OBJECT_NAMES == 1
2613  this->m_objName.toChar(),
2614 #endif
2615  "RemoveDirectorySucceeded ",
2616  dirName.toChar()
2617  );
2618 
2619  this->LogText_out(
2620  0,
2621  _id,
2622  _logTime,
2624  _logString
2625  );
2626  }
2627 #endif
2628  }
2629 
2632  const Fw::StringBase& sourceFileName,
2633  const Fw::StringBase& destFileName
2634  ) const
2635  {
2636  // Get the time
2637  Fw::Time _logTime;
2638  if (this->isConnected_timeCaller_OutputPort(0)) {
2639  this->timeCaller_out(0, _logTime);
2640  }
2641 
2642  const FwEventIdType _id = this->getIdBase() + EVENTID_MOVEFILESUCCEEDED;
2643 
2644  // Emit the event on the log port
2645  if (this->isConnected_eventOut_OutputPort(0)) {
2646  Fw::LogBuffer _logBuff;
2648 
2649 #if FW_AMPCS_COMPATIBLE
2650  // Serialize the number of arguments
2651  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2652  FW_ASSERT(
2653  _status == Fw::FW_SERIALIZE_OK,
2654  static_cast<FwAssertArgType>(_status)
2655  );
2656 #endif
2657 
2658  _status = sourceFileName.serializeTo(
2659  _logBuff,
2660  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2661  );
2662  FW_ASSERT(
2663  _status == Fw::FW_SERIALIZE_OK,
2664  static_cast<FwAssertArgType>(_status)
2665  );
2666 
2667  _status = destFileName.serializeTo(
2668  _logBuff,
2669  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2670  );
2671  FW_ASSERT(
2672  _status == Fw::FW_SERIALIZE_OK,
2673  static_cast<FwAssertArgType>(_status)
2674  );
2675 
2676  this->eventOut_out(
2677  0,
2678  _id,
2679  _logTime,
2681  _logBuff
2682  );
2683  }
2684 
2685  // Emit the event on the text log port
2686 #if FW_ENABLE_TEXT_LOGGING
2687  if (this->isConnected_LogText_OutputPort(0)) {
2688 #if FW_OBJECT_NAMES == 1
2689  const char* _formatString =
2690  "(%s) %s: Moved file %s to file %s successfully";
2691 #else
2692  const char* _formatString =
2693  "%s: Moved file %s to file %s successfully";
2694 #endif
2695 
2696  Fw::TextLogString _logString;
2697  (void) _logString.format(
2698  _formatString,
2699 #if FW_OBJECT_NAMES == 1
2700  this->m_objName.toChar(),
2701 #endif
2702  "MoveFileSucceeded ",
2703  sourceFileName.toChar(),
2704  destFileName.toChar()
2705  );
2706 
2707  this->LogText_out(
2708  0,
2709  _id,
2710  _logTime,
2712  _logString
2713  );
2714  }
2715 #endif
2716  }
2717 
2720  {
2721  // Get the time
2722  Fw::Time _logTime;
2723  if (this->isConnected_timeCaller_OutputPort(0)) {
2724  this->timeCaller_out(0, _logTime);
2725  }
2726 
2727  const FwEventIdType _id = this->getIdBase() + EVENTID_REMOVEFILESUCCEEDED;
2728 
2729  // Emit the event on the log port
2730  if (this->isConnected_eventOut_OutputPort(0)) {
2731  Fw::LogBuffer _logBuff;
2733 
2734 #if FW_AMPCS_COMPATIBLE
2735  // Serialize the number of arguments
2736  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2737  FW_ASSERT(
2738  _status == Fw::FW_SERIALIZE_OK,
2739  static_cast<FwAssertArgType>(_status)
2740  );
2741 #endif
2742 
2743  _status = fileName.serializeTo(
2744  _logBuff,
2745  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2746  );
2747  FW_ASSERT(
2748  _status == Fw::FW_SERIALIZE_OK,
2749  static_cast<FwAssertArgType>(_status)
2750  );
2751 
2752  this->eventOut_out(
2753  0,
2754  _id,
2755  _logTime,
2757  _logBuff
2758  );
2759  }
2760 
2761  // Emit the event on the text log port
2762 #if FW_ENABLE_TEXT_LOGGING
2763  if (this->isConnected_LogText_OutputPort(0)) {
2764 #if FW_OBJECT_NAMES == 1
2765  const char* _formatString =
2766  "(%s) %s: Removed file %s successfully";
2767 #else
2768  const char* _formatString =
2769  "%s: Removed file %s successfully";
2770 #endif
2771 
2772  Fw::TextLogString _logString;
2773  (void) _logString.format(
2774  _formatString,
2775 #if FW_OBJECT_NAMES == 1
2776  this->m_objName.toChar(),
2777 #endif
2778  "RemoveFileSucceeded ",
2779  fileName.toChar()
2780  );
2781 
2782  this->LogText_out(
2783  0,
2784  _id,
2785  _logTime,
2787  _logString
2788  );
2789  }
2790 #endif
2791  }
2792 
2795  const Fw::StringBase& source,
2796  const Fw::StringBase& target
2797  ) const
2798  {
2799  // Get the time
2800  Fw::Time _logTime;
2801  if (this->isConnected_timeCaller_OutputPort(0)) {
2802  this->timeCaller_out(0, _logTime);
2803  }
2804 
2805  const FwEventIdType _id = this->getIdBase() + EVENTID_APPENDFILESTARTED;
2806 
2807  // Emit the event on the log port
2808  if (this->isConnected_eventOut_OutputPort(0)) {
2809  Fw::LogBuffer _logBuff;
2811 
2812 #if FW_AMPCS_COMPATIBLE
2813  // Serialize the number of arguments
2814  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2815  FW_ASSERT(
2816  _status == Fw::FW_SERIALIZE_OK,
2817  static_cast<FwAssertArgType>(_status)
2818  );
2819 #endif
2820 
2821  _status = source.serializeTo(
2822  _logBuff,
2823  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2824  );
2825  FW_ASSERT(
2826  _status == Fw::FW_SERIALIZE_OK,
2827  static_cast<FwAssertArgType>(_status)
2828  );
2829 
2830  _status = target.serializeTo(
2831  _logBuff,
2832  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2833  );
2834  FW_ASSERT(
2835  _status == Fw::FW_SERIALIZE_OK,
2836  static_cast<FwAssertArgType>(_status)
2837  );
2838 
2839  this->eventOut_out(
2840  0,
2841  _id,
2842  _logTime,
2844  _logBuff
2845  );
2846  }
2847 
2848  // Emit the event on the text log port
2849 #if FW_ENABLE_TEXT_LOGGING
2850  if (this->isConnected_LogText_OutputPort(0)) {
2851 #if FW_OBJECT_NAMES == 1
2852  const char* _formatString =
2853  "(%s) %s: Appending file %s to the end of %s...";
2854 #else
2855  const char* _formatString =
2856  "%s: Appending file %s to the end of %s...";
2857 #endif
2858 
2859  Fw::TextLogString _logString;
2860  (void) _logString.format(
2861  _formatString,
2862 #if FW_OBJECT_NAMES == 1
2863  this->m_objName.toChar(),
2864 #endif
2865  "AppendFileStarted ",
2866  source.toChar(),
2867  target.toChar()
2868  );
2869 
2870  this->LogText_out(
2871  0,
2872  _id,
2873  _logTime,
2875  _logString
2876  );
2877  }
2878 #endif
2879  }
2880 
2883  {
2884  // Get the time
2885  Fw::Time _logTime;
2886  if (this->isConnected_timeCaller_OutputPort(0)) {
2887  this->timeCaller_out(0, _logTime);
2888  }
2889 
2891 
2892  // Emit the event on the log port
2893  if (this->isConnected_eventOut_OutputPort(0)) {
2894  Fw::LogBuffer _logBuff;
2896 
2897 #if FW_AMPCS_COMPATIBLE
2898  // Serialize the number of arguments
2899  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2900  FW_ASSERT(
2901  _status == Fw::FW_SERIALIZE_OK,
2902  static_cast<FwAssertArgType>(_status)
2903  );
2904 #endif
2905 
2906  _status = dirName.serializeTo(
2907  _logBuff,
2908  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2909  );
2910  FW_ASSERT(
2911  _status == Fw::FW_SERIALIZE_OK,
2912  static_cast<FwAssertArgType>(_status)
2913  );
2914 
2915  this->eventOut_out(
2916  0,
2917  _id,
2918  _logTime,
2920  _logBuff
2921  );
2922  }
2923 
2924  // Emit the event on the text log port
2925 #if FW_ENABLE_TEXT_LOGGING
2926  if (this->isConnected_LogText_OutputPort(0)) {
2927 #if FW_OBJECT_NAMES == 1
2928  const char* _formatString =
2929  "(%s) %s: Creating directory %s...";
2930 #else
2931  const char* _formatString =
2932  "%s: Creating directory %s...";
2933 #endif
2934 
2935  Fw::TextLogString _logString;
2936  (void) _logString.format(
2937  _formatString,
2938 #if FW_OBJECT_NAMES == 1
2939  this->m_objName.toChar(),
2940 #endif
2941  "CreateDirectoryStarted ",
2942  dirName.toChar()
2943  );
2944 
2945  this->LogText_out(
2946  0,
2947  _id,
2948  _logTime,
2950  _logString
2951  );
2952  }
2953 #endif
2954  }
2955 
2958  {
2959  // Get the time
2960  Fw::Time _logTime;
2961  if (this->isConnected_timeCaller_OutputPort(0)) {
2962  this->timeCaller_out(0, _logTime);
2963  }
2964 
2966 
2967  // Emit the event on the log port
2968  if (this->isConnected_eventOut_OutputPort(0)) {
2969  Fw::LogBuffer _logBuff;
2971 
2972 #if FW_AMPCS_COMPATIBLE
2973  // Serialize the number of arguments
2974  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2975  FW_ASSERT(
2976  _status == Fw::FW_SERIALIZE_OK,
2977  static_cast<FwAssertArgType>(_status)
2978  );
2979 #endif
2980 
2981  _status = dirName.serializeTo(
2982  _logBuff,
2983  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
2984  );
2985  FW_ASSERT(
2986  _status == Fw::FW_SERIALIZE_OK,
2987  static_cast<FwAssertArgType>(_status)
2988  );
2989 
2990  this->eventOut_out(
2991  0,
2992  _id,
2993  _logTime,
2995  _logBuff
2996  );
2997  }
2998 
2999  // Emit the event on the text log port
3000 #if FW_ENABLE_TEXT_LOGGING
3001  if (this->isConnected_LogText_OutputPort(0)) {
3002 #if FW_OBJECT_NAMES == 1
3003  const char* _formatString =
3004  "(%s) %s: Removing directory %s...";
3005 #else
3006  const char* _formatString =
3007  "%s: Removing directory %s...";
3008 #endif
3009 
3010  Fw::TextLogString _logString;
3011  (void) _logString.format(
3012  _formatString,
3013 #if FW_OBJECT_NAMES == 1
3014  this->m_objName.toChar(),
3015 #endif
3016  "RemoveDirectoryStarted ",
3017  dirName.toChar()
3018  );
3019 
3020  this->LogText_out(
3021  0,
3022  _id,
3023  _logTime,
3025  _logString
3026  );
3027  }
3028 #endif
3029  }
3030 
3033  const Fw::StringBase& sourceFileName,
3034  const Fw::StringBase& destFileName
3035  ) const
3036  {
3037  // Get the time
3038  Fw::Time _logTime;
3039  if (this->isConnected_timeCaller_OutputPort(0)) {
3040  this->timeCaller_out(0, _logTime);
3041  }
3042 
3043  const FwEventIdType _id = this->getIdBase() + EVENTID_MOVEFILESTARTED;
3044 
3045  // Emit the event on the log port
3046  if (this->isConnected_eventOut_OutputPort(0)) {
3047  Fw::LogBuffer _logBuff;
3049 
3050 #if FW_AMPCS_COMPATIBLE
3051  // Serialize the number of arguments
3052  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3053  FW_ASSERT(
3054  _status == Fw::FW_SERIALIZE_OK,
3055  static_cast<FwAssertArgType>(_status)
3056  );
3057 #endif
3058 
3059  _status = sourceFileName.serializeTo(
3060  _logBuff,
3061  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3062  );
3063  FW_ASSERT(
3064  _status == Fw::FW_SERIALIZE_OK,
3065  static_cast<FwAssertArgType>(_status)
3066  );
3067 
3068  _status = destFileName.serializeTo(
3069  _logBuff,
3070  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3071  );
3072  FW_ASSERT(
3073  _status == Fw::FW_SERIALIZE_OK,
3074  static_cast<FwAssertArgType>(_status)
3075  );
3076 
3077  this->eventOut_out(
3078  0,
3079  _id,
3080  _logTime,
3082  _logBuff
3083  );
3084  }
3085 
3086  // Emit the event on the text log port
3087 #if FW_ENABLE_TEXT_LOGGING
3088  if (this->isConnected_LogText_OutputPort(0)) {
3089 #if FW_OBJECT_NAMES == 1
3090  const char* _formatString =
3091  "(%s) %s: Moving file %s to file %s...";
3092 #else
3093  const char* _formatString =
3094  "%s: Moving file %s to file %s...";
3095 #endif
3096 
3097  Fw::TextLogString _logString;
3098  (void) _logString.format(
3099  _formatString,
3100 #if FW_OBJECT_NAMES == 1
3101  this->m_objName.toChar(),
3102 #endif
3103  "MoveFileStarted ",
3104  sourceFileName.toChar(),
3105  destFileName.toChar()
3106  );
3107 
3108  this->LogText_out(
3109  0,
3110  _id,
3111  _logTime,
3113  _logString
3114  );
3115  }
3116 #endif
3117  }
3118 
3121  {
3122  // Get the time
3123  Fw::Time _logTime;
3124  if (this->isConnected_timeCaller_OutputPort(0)) {
3125  this->timeCaller_out(0, _logTime);
3126  }
3127 
3128  const FwEventIdType _id = this->getIdBase() + EVENTID_REMOVEFILESTARTED;
3129 
3130  // Emit the event on the log port
3131  if (this->isConnected_eventOut_OutputPort(0)) {
3132  Fw::LogBuffer _logBuff;
3134 
3135 #if FW_AMPCS_COMPATIBLE
3136  // Serialize the number of arguments
3137  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3138  FW_ASSERT(
3139  _status == Fw::FW_SERIALIZE_OK,
3140  static_cast<FwAssertArgType>(_status)
3141  );
3142 #endif
3143 
3144  _status = fileName.serializeTo(
3145  _logBuff,
3146  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3147  );
3148  FW_ASSERT(
3149  _status == Fw::FW_SERIALIZE_OK,
3150  static_cast<FwAssertArgType>(_status)
3151  );
3152 
3153  this->eventOut_out(
3154  0,
3155  _id,
3156  _logTime,
3158  _logBuff
3159  );
3160  }
3161 
3162  // Emit the event on the text log port
3163 #if FW_ENABLE_TEXT_LOGGING
3164  if (this->isConnected_LogText_OutputPort(0)) {
3165 #if FW_OBJECT_NAMES == 1
3166  const char* _formatString =
3167  "(%s) %s: Removing file %s...";
3168 #else
3169  const char* _formatString =
3170  "%s: Removing file %s...";
3171 #endif
3172 
3173  Fw::TextLogString _logString;
3174  (void) _logString.format(
3175  _formatString,
3176 #if FW_OBJECT_NAMES == 1
3177  this->m_objName.toChar(),
3178 #endif
3179  "RemoveFileStarted ",
3180  fileName.toChar()
3181  );
3182 
3183  this->LogText_out(
3184  0,
3185  _id,
3186  _logTime,
3188  _logString
3189  );
3190  }
3191 #endif
3192  }
3193 
3196  const Fw::StringBase& fileName,
3197  FwSizeType size
3198  ) const
3199  {
3200  // Get the time
3201  Fw::Time _logTime;
3202  if (this->isConnected_timeCaller_OutputPort(0)) {
3203  this->timeCaller_out(0, _logTime);
3204  }
3205 
3206  const FwEventIdType _id = this->getIdBase() + EVENTID_FILESIZESUCCEEDED;
3207 
3208  // Emit the event on the log port
3209  if (this->isConnected_eventOut_OutputPort(0)) {
3210  Fw::LogBuffer _logBuff;
3212 
3213 #if FW_AMPCS_COMPATIBLE
3214  // Serialize the number of arguments
3215  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3216  FW_ASSERT(
3217  _status == Fw::FW_SERIALIZE_OK,
3218  static_cast<FwAssertArgType>(_status)
3219  );
3220 #endif
3221 
3222  _status = fileName.serializeTo(
3223  _logBuff,
3224  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3225  );
3226  FW_ASSERT(
3227  _status == Fw::FW_SERIALIZE_OK,
3228  static_cast<FwAssertArgType>(_status)
3229  );
3230 
3231 #if FW_AMPCS_COMPATIBLE
3232  // Serialize the argument size
3233  _status = _logBuff.serializeFrom(
3234  static_cast<U8>(sizeof(FwSizeType))
3235  );
3236  FW_ASSERT(
3237  _status == Fw::FW_SERIALIZE_OK,
3238  static_cast<FwAssertArgType>(_status)
3239  );
3240 #endif
3241  _status = _logBuff.serializeFrom(size);
3242  FW_ASSERT(
3243  _status == Fw::FW_SERIALIZE_OK,
3244  static_cast<FwAssertArgType>(_status)
3245  );
3246 
3247  this->eventOut_out(
3248  0,
3249  _id,
3250  _logTime,
3252  _logBuff
3253  );
3254  }
3255 
3256  // Emit the event on the text log port
3257 #if FW_ENABLE_TEXT_LOGGING
3258  if (this->isConnected_LogText_OutputPort(0)) {
3259 #if FW_OBJECT_NAMES == 1
3260  const char* _formatString =
3261  "(%s) %s: The size of file %s is %" PRIu64 " B";
3262 #else
3263  const char* _formatString =
3264  "%s: The size of file %s is %" PRIu64 " B";
3265 #endif
3266 
3267  Fw::TextLogString _logString;
3268  (void) _logString.format(
3269  _formatString,
3270 #if FW_OBJECT_NAMES == 1
3271  this->m_objName.toChar(),
3272 #endif
3273  "FileSizeSucceeded ",
3274  fileName.toChar(),
3275  size
3276  );
3277 
3278  this->LogText_out(
3279  0,
3280  _id,
3281  _logTime,
3283  _logString
3284  );
3285  }
3286 #endif
3287  }
3288 
3291  const Fw::StringBase& fileName,
3292  U32 status
3293  ) const
3294  {
3295  // Get the time
3296  Fw::Time _logTime;
3297  if (this->isConnected_timeCaller_OutputPort(0)) {
3298  this->timeCaller_out(0, _logTime);
3299  }
3300 
3301  const FwEventIdType _id = this->getIdBase() + EVENTID_FILESIZEERROR;
3302 
3303  // Emit the event on the log port
3304  if (this->isConnected_eventOut_OutputPort(0)) {
3305  Fw::LogBuffer _logBuff;
3307 
3308 #if FW_AMPCS_COMPATIBLE
3309  // Serialize the number of arguments
3310  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3311  FW_ASSERT(
3312  _status == Fw::FW_SERIALIZE_OK,
3313  static_cast<FwAssertArgType>(_status)
3314  );
3315 #endif
3316 
3317  _status = fileName.serializeTo(
3318  _logBuff,
3319  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3320  );
3321  FW_ASSERT(
3322  _status == Fw::FW_SERIALIZE_OK,
3323  static_cast<FwAssertArgType>(_status)
3324  );
3325 
3326 #if FW_AMPCS_COMPATIBLE
3327  // Serialize the argument size
3328  _status = _logBuff.serializeFrom(
3329  static_cast<U8>(sizeof(U32))
3330  );
3331  FW_ASSERT(
3332  _status == Fw::FW_SERIALIZE_OK,
3333  static_cast<FwAssertArgType>(_status)
3334  );
3335 #endif
3336  _status = _logBuff.serializeFrom(status);
3337  FW_ASSERT(
3338  _status == Fw::FW_SERIALIZE_OK,
3339  static_cast<FwAssertArgType>(_status)
3340  );
3341 
3342  this->eventOut_out(
3343  0,
3344  _id,
3345  _logTime,
3347  _logBuff
3348  );
3349  }
3350 
3351  // Emit the event on the text log port
3352 #if FW_ENABLE_TEXT_LOGGING
3353  if (this->isConnected_LogText_OutputPort(0)) {
3354 #if FW_OBJECT_NAMES == 1
3355  const char* _formatString =
3356  "(%s) %s: Failed to get the size of file %s, returned status %" PRIu32 "";
3357 #else
3358  const char* _formatString =
3359  "%s: Failed to get the size of file %s, returned status %" PRIu32 "";
3360 #endif
3361 
3362  Fw::TextLogString _logString;
3363  (void) _logString.format(
3364  _formatString,
3365 #if FW_OBJECT_NAMES == 1
3366  this->m_objName.toChar(),
3367 #endif
3368  "FileSizeError ",
3369  fileName.toChar(),
3370  status
3371  );
3372 
3373  this->LogText_out(
3374  0,
3375  _id,
3376  _logTime,
3378  _logString
3379  );
3380  }
3381 #endif
3382  }
3383 
3386  {
3387  // Get the time
3388  Fw::Time _logTime;
3389  if (this->isConnected_timeCaller_OutputPort(0)) {
3390  this->timeCaller_out(0, _logTime);
3391  }
3392 
3393  const FwEventIdType _id = this->getIdBase() + EVENTID_FILESIZESTARTED;
3394 
3395  // Emit the event on the log port
3396  if (this->isConnected_eventOut_OutputPort(0)) {
3397  Fw::LogBuffer _logBuff;
3399 
3400 #if FW_AMPCS_COMPATIBLE
3401  // Serialize the number of arguments
3402  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3403  FW_ASSERT(
3404  _status == Fw::FW_SERIALIZE_OK,
3405  static_cast<FwAssertArgType>(_status)
3406  );
3407 #endif
3408 
3409  _status = fileName.serializeTo(
3410  _logBuff,
3411  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3412  );
3413  FW_ASSERT(
3414  _status == Fw::FW_SERIALIZE_OK,
3415  static_cast<FwAssertArgType>(_status)
3416  );
3417 
3418  this->eventOut_out(
3419  0,
3420  _id,
3421  _logTime,
3423  _logBuff
3424  );
3425  }
3426 
3427  // Emit the event on the text log port
3428 #if FW_ENABLE_TEXT_LOGGING
3429  if (this->isConnected_LogText_OutputPort(0)) {
3430 #if FW_OBJECT_NAMES == 1
3431  const char* _formatString =
3432  "(%s) %s: Checking size of file %s...";
3433 #else
3434  const char* _formatString =
3435  "%s: Checking size of file %s...";
3436 #endif
3437 
3438  Fw::TextLogString _logString;
3439  (void) _logString.format(
3440  _formatString,
3441 #if FW_OBJECT_NAMES == 1
3442  this->m_objName.toChar(),
3443 #endif
3444  "FileSizeStarted ",
3445  fileName.toChar()
3446  );
3447 
3448  this->LogText_out(
3449  0,
3450  _id,
3451  _logTime,
3453  _logString
3454  );
3455  }
3456 #endif
3457  }
3458 
3461  {
3462  // Get the time
3463  Fw::Time _logTime;
3464  if (this->isConnected_timeCaller_OutputPort(0)) {
3465  this->timeCaller_out(0, _logTime);
3466  }
3467 
3469 
3470  // Emit the event on the log port
3471  if (this->isConnected_eventOut_OutputPort(0)) {
3472  Fw::LogBuffer _logBuff;
3474 
3475 #if FW_AMPCS_COMPATIBLE
3476  // Serialize the number of arguments
3477  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3478  FW_ASSERT(
3479  _status == Fw::FW_SERIALIZE_OK,
3480  static_cast<FwAssertArgType>(_status)
3481  );
3482 #endif
3483 
3484  _status = dirName.serializeTo(
3485  _logBuff,
3486  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3487  );
3488  FW_ASSERT(
3489  _status == Fw::FW_SERIALIZE_OK,
3490  static_cast<FwAssertArgType>(_status)
3491  );
3492 
3493  this->eventOut_out(
3494  0,
3495  _id,
3496  _logTime,
3498  _logBuff
3499  );
3500  }
3501 
3502  // Emit the event on the text log port
3503 #if FW_ENABLE_TEXT_LOGGING
3504  if (this->isConnected_LogText_OutputPort(0)) {
3505 #if FW_OBJECT_NAMES == 1
3506  const char* _formatString =
3507  "(%s) %s: Listing contents of directory %s...";
3508 #else
3509  const char* _formatString =
3510  "%s: Listing contents of directory %s...";
3511 #endif
3512 
3513  Fw::TextLogString _logString;
3514  (void) _logString.format(
3515  _formatString,
3516 #if FW_OBJECT_NAMES == 1
3517  this->m_objName.toChar(),
3518 #endif
3519  "ListDirectoryStarted ",
3520  dirName.toChar()
3521  );
3522 
3523  this->LogText_out(
3524  0,
3525  _id,
3526  _logTime,
3528  _logString
3529  );
3530  }
3531 #endif
3532  }
3533 
3536  const Fw::StringBase& dirName,
3537  U32 fileCount
3538  ) const
3539  {
3540  // Get the time
3541  Fw::Time _logTime;
3542  if (this->isConnected_timeCaller_OutputPort(0)) {
3543  this->timeCaller_out(0, _logTime);
3544  }
3545 
3547 
3548  // Emit the event on the log port
3549  if (this->isConnected_eventOut_OutputPort(0)) {
3550  Fw::LogBuffer _logBuff;
3552 
3553 #if FW_AMPCS_COMPATIBLE
3554  // Serialize the number of arguments
3555  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3556  FW_ASSERT(
3557  _status == Fw::FW_SERIALIZE_OK,
3558  static_cast<FwAssertArgType>(_status)
3559  );
3560 #endif
3561 
3562  _status = dirName.serializeTo(
3563  _logBuff,
3564  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3565  );
3566  FW_ASSERT(
3567  _status == Fw::FW_SERIALIZE_OK,
3568  static_cast<FwAssertArgType>(_status)
3569  );
3570 
3571 #if FW_AMPCS_COMPATIBLE
3572  // Serialize the argument size
3573  _status = _logBuff.serializeFrom(
3574  static_cast<U8>(sizeof(U32))
3575  );
3576  FW_ASSERT(
3577  _status == Fw::FW_SERIALIZE_OK,
3578  static_cast<FwAssertArgType>(_status)
3579  );
3580 #endif
3581  _status = _logBuff.serializeFrom(fileCount);
3582  FW_ASSERT(
3583  _status == Fw::FW_SERIALIZE_OK,
3584  static_cast<FwAssertArgType>(_status)
3585  );
3586 
3587  this->eventOut_out(
3588  0,
3589  _id,
3590  _logTime,
3592  _logBuff
3593  );
3594  }
3595 
3596  // Emit the event on the text log port
3597 #if FW_ENABLE_TEXT_LOGGING
3598  if (this->isConnected_LogText_OutputPort(0)) {
3599 #if FW_OBJECT_NAMES == 1
3600  const char* _formatString =
3601  "(%s) %s: Directory %s contains %" PRIu32 " files";
3602 #else
3603  const char* _formatString =
3604  "%s: Directory %s contains %" PRIu32 " files";
3605 #endif
3606 
3607  Fw::TextLogString _logString;
3608  (void) _logString.format(
3609  _formatString,
3610 #if FW_OBJECT_NAMES == 1
3611  this->m_objName.toChar(),
3612 #endif
3613  "ListDirectorySucceeded ",
3614  dirName.toChar(),
3615  fileCount
3616  );
3617 
3618  this->LogText_out(
3619  0,
3620  _id,
3621  _logTime,
3623  _logString
3624  );
3625  }
3626 #endif
3627  }
3628 
3631  const Fw::StringBase& dirName,
3632  U32 status
3633  ) const
3634  {
3635  // Get the time
3636  Fw::Time _logTime;
3637  if (this->isConnected_timeCaller_OutputPort(0)) {
3638  this->timeCaller_out(0, _logTime);
3639  }
3640 
3641  const FwEventIdType _id = this->getIdBase() + EVENTID_LISTDIRECTORYERROR;
3642 
3643  // Emit the event on the log port
3644  if (this->isConnected_eventOut_OutputPort(0)) {
3645  Fw::LogBuffer _logBuff;
3647 
3648 #if FW_AMPCS_COMPATIBLE
3649  // Serialize the number of arguments
3650  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3651  FW_ASSERT(
3652  _status == Fw::FW_SERIALIZE_OK,
3653  static_cast<FwAssertArgType>(_status)
3654  );
3655 #endif
3656 
3657  _status = dirName.serializeTo(
3658  _logBuff,
3659  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3660  );
3661  FW_ASSERT(
3662  _status == Fw::FW_SERIALIZE_OK,
3663  static_cast<FwAssertArgType>(_status)
3664  );
3665 
3666 #if FW_AMPCS_COMPATIBLE
3667  // Serialize the argument size
3668  _status = _logBuff.serializeFrom(
3669  static_cast<U8>(sizeof(U32))
3670  );
3671  FW_ASSERT(
3672  _status == Fw::FW_SERIALIZE_OK,
3673  static_cast<FwAssertArgType>(_status)
3674  );
3675 #endif
3676  _status = _logBuff.serializeFrom(status);
3677  FW_ASSERT(
3678  _status == Fw::FW_SERIALIZE_OK,
3679  static_cast<FwAssertArgType>(_status)
3680  );
3681 
3682  this->eventOut_out(
3683  0,
3684  _id,
3685  _logTime,
3687  _logBuff
3688  );
3689  }
3690 
3691  // Emit the event on the text log port
3692 #if FW_ENABLE_TEXT_LOGGING
3693  if (this->isConnected_LogText_OutputPort(0)) {
3694 #if FW_OBJECT_NAMES == 1
3695  const char* _formatString =
3696  "(%s) %s: Failed to list directory %s, returned status %" PRIu32 "";
3697 #else
3698  const char* _formatString =
3699  "%s: Failed to list directory %s, returned status %" PRIu32 "";
3700 #endif
3701 
3702  Fw::TextLogString _logString;
3703  (void) _logString.format(
3704  _formatString,
3705 #if FW_OBJECT_NAMES == 1
3706  this->m_objName.toChar(),
3707 #endif
3708  "ListDirectoryError ",
3709  dirName.toChar(),
3710  status
3711  );
3712 
3713  this->LogText_out(
3714  0,
3715  _id,
3716  _logTime,
3718  _logString
3719  );
3720  }
3721 #endif
3722  }
3723 
3726  const Fw::StringBase& dirName,
3727  const Fw::StringBase& fileName,
3728  FwSizeType fileSize
3729  ) const
3730  {
3731  // Get the time
3732  Fw::Time _logTime;
3733  if (this->isConnected_timeCaller_OutputPort(0)) {
3734  this->timeCaller_out(0, _logTime);
3735  }
3736 
3737  const FwEventIdType _id = this->getIdBase() + EVENTID_DIRECTORYLISTING;
3738 
3739  // Emit the event on the log port
3740  if (this->isConnected_eventOut_OutputPort(0)) {
3741  Fw::LogBuffer _logBuff;
3743 
3744 #if FW_AMPCS_COMPATIBLE
3745  // Serialize the number of arguments
3746  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3747  FW_ASSERT(
3748  _status == Fw::FW_SERIALIZE_OK,
3749  static_cast<FwAssertArgType>(_status)
3750  );
3751 #endif
3752 
3753  _status = dirName.serializeTo(
3754  _logBuff,
3755  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3756  );
3757  FW_ASSERT(
3758  _status == Fw::FW_SERIALIZE_OK,
3759  static_cast<FwAssertArgType>(_status)
3760  );
3761 
3762  _status = fileName.serializeTo(
3763  _logBuff,
3764  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3765  );
3766  FW_ASSERT(
3767  _status == Fw::FW_SERIALIZE_OK,
3768  static_cast<FwAssertArgType>(_status)
3769  );
3770 
3771 #if FW_AMPCS_COMPATIBLE
3772  // Serialize the argument size
3773  _status = _logBuff.serializeFrom(
3774  static_cast<U8>(sizeof(FwSizeType))
3775  );
3776  FW_ASSERT(
3777  _status == Fw::FW_SERIALIZE_OK,
3778  static_cast<FwAssertArgType>(_status)
3779  );
3780 #endif
3781  _status = _logBuff.serializeFrom(fileSize);
3782  FW_ASSERT(
3783  _status == Fw::FW_SERIALIZE_OK,
3784  static_cast<FwAssertArgType>(_status)
3785  );
3786 
3787  this->eventOut_out(
3788  0,
3789  _id,
3790  _logTime,
3792  _logBuff
3793  );
3794  }
3795 
3796  // Emit the event on the text log port
3797 #if FW_ENABLE_TEXT_LOGGING
3798  if (this->isConnected_LogText_OutputPort(0)) {
3799 #if FW_OBJECT_NAMES == 1
3800  const char* _formatString =
3801  "(%s) %s: Directory %s: %s (%" PRIu64 " bytes)";
3802 #else
3803  const char* _formatString =
3804  "%s: Directory %s: %s (%" PRIu64 " bytes)";
3805 #endif
3806 
3807  Fw::TextLogString _logString;
3808  (void) _logString.format(
3809  _formatString,
3810 #if FW_OBJECT_NAMES == 1
3811  this->m_objName.toChar(),
3812 #endif
3813  "DirectoryListing ",
3814  dirName.toChar(),
3815  fileName.toChar(),
3816  fileSize
3817  );
3818 
3819  this->LogText_out(
3820  0,
3821  _id,
3822  _logTime,
3824  _logString
3825  );
3826  }
3827 #endif
3828  }
3829 
3832  const Fw::StringBase& dirName,
3833  const Fw::StringBase& subdirName
3834  ) const
3835  {
3836  // Get the time
3837  Fw::Time _logTime;
3838  if (this->isConnected_timeCaller_OutputPort(0)) {
3839  this->timeCaller_out(0, _logTime);
3840  }
3841 
3843 
3844  // Emit the event on the log port
3845  if (this->isConnected_eventOut_OutputPort(0)) {
3846  Fw::LogBuffer _logBuff;
3848 
3849 #if FW_AMPCS_COMPATIBLE
3850  // Serialize the number of arguments
3851  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3852  FW_ASSERT(
3853  _status == Fw::FW_SERIALIZE_OK,
3854  static_cast<FwAssertArgType>(_status)
3855  );
3856 #endif
3857 
3858  _status = dirName.serializeTo(
3859  _logBuff,
3860  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3861  );
3862  FW_ASSERT(
3863  _status == Fw::FW_SERIALIZE_OK,
3864  static_cast<FwAssertArgType>(_status)
3865  );
3866 
3867  _status = subdirName.serializeTo(
3868  _logBuff,
3869  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3870  );
3871  FW_ASSERT(
3872  _status == Fw::FW_SERIALIZE_OK,
3873  static_cast<FwAssertArgType>(_status)
3874  );
3875 
3876  this->eventOut_out(
3877  0,
3878  _id,
3879  _logTime,
3881  _logBuff
3882  );
3883  }
3884 
3885  // Emit the event on the text log port
3886 #if FW_ENABLE_TEXT_LOGGING
3887  if (this->isConnected_LogText_OutputPort(0)) {
3888 #if FW_OBJECT_NAMES == 1
3889  const char* _formatString =
3890  "(%s) %s: Directory %s: %s";
3891 #else
3892  const char* _formatString =
3893  "%s: Directory %s: %s";
3894 #endif
3895 
3896  Fw::TextLogString _logString;
3897  (void) _logString.format(
3898  _formatString,
3899 #if FW_OBJECT_NAMES == 1
3900  this->m_objName.toChar(),
3901 #endif
3902  "DirectoryListingSubdir ",
3903  dirName.toChar(),
3904  subdirName.toChar()
3905  );
3906 
3907  this->LogText_out(
3908  0,
3909  _id,
3910  _logTime,
3912  _logString
3913  );
3914  }
3915 #endif
3916  }
3917 
3920  {
3921  // Get the time
3922  Fw::Time _logTime;
3923  if (this->isConnected_timeCaller_OutputPort(0)) {
3924  this->timeCaller_out(0, _logTime);
3925  }
3926 
3927  const FwEventIdType _id = this->getIdBase() + EVENTID_CALCULATECRCSTARTED;
3928 
3929  // Emit the event on the log port
3930  if (this->isConnected_eventOut_OutputPort(0)) {
3931  Fw::LogBuffer _logBuff;
3933 
3934 #if FW_AMPCS_COMPATIBLE
3935  // Serialize the number of arguments
3936  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3937  FW_ASSERT(
3938  _status == Fw::FW_SERIALIZE_OK,
3939  static_cast<FwAssertArgType>(_status)
3940  );
3941 #endif
3942 
3943  _status = fileName.serializeTo(
3944  _logBuff,
3945  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
3946  );
3947  FW_ASSERT(
3948  _status == Fw::FW_SERIALIZE_OK,
3949  static_cast<FwAssertArgType>(_status)
3950  );
3951 
3952  this->eventOut_out(
3953  0,
3954  _id,
3955  _logTime,
3957  _logBuff
3958  );
3959  }
3960 
3961  // Emit the event on the text log port
3962 #if FW_ENABLE_TEXT_LOGGING
3963  if (this->isConnected_LogText_OutputPort(0)) {
3964 #if FW_OBJECT_NAMES == 1
3965  const char* _formatString =
3966  "(%s) %s: Started CRC calculation for file %s";
3967 #else
3968  const char* _formatString =
3969  "%s: Started CRC calculation for file %s";
3970 #endif
3971 
3972  Fw::TextLogString _logString;
3973  (void) _logString.format(
3974  _formatString,
3975 #if FW_OBJECT_NAMES == 1
3976  this->m_objName.toChar(),
3977 #endif
3978  "CalculateCrcStarted ",
3979  fileName.toChar()
3980  );
3981 
3982  this->LogText_out(
3983  0,
3984  _id,
3985  _logTime,
3987  _logString
3988  );
3989  }
3990 #endif
3991  }
3992 
3995  const Fw::StringBase& fileName,
3996  U32 status
3997  ) const
3998  {
3999  // Get the time
4000  Fw::Time _logTime;
4001  if (this->isConnected_timeCaller_OutputPort(0)) {
4002  this->timeCaller_out(0, _logTime);
4003  }
4004 
4005  const FwEventIdType _id = this->getIdBase() + EVENTID_CALCULATECRCFAILED;
4006 
4007  // Emit the event on the log port
4008  if (this->isConnected_eventOut_OutputPort(0)) {
4009  Fw::LogBuffer _logBuff;
4011 
4012 #if FW_AMPCS_COMPATIBLE
4013  // Serialize the number of arguments
4014  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4015  FW_ASSERT(
4016  _status == Fw::FW_SERIALIZE_OK,
4017  static_cast<FwAssertArgType>(_status)
4018  );
4019 #endif
4020 
4021  _status = fileName.serializeTo(
4022  _logBuff,
4023  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
4024  );
4025  FW_ASSERT(
4026  _status == Fw::FW_SERIALIZE_OK,
4027  static_cast<FwAssertArgType>(_status)
4028  );
4029 
4030 #if FW_AMPCS_COMPATIBLE
4031  // Serialize the argument size
4032  _status = _logBuff.serializeFrom(
4033  static_cast<U8>(sizeof(U32))
4034  );
4035  FW_ASSERT(
4036  _status == Fw::FW_SERIALIZE_OK,
4037  static_cast<FwAssertArgType>(_status)
4038  );
4039 #endif
4040  _status = _logBuff.serializeFrom(status);
4041  FW_ASSERT(
4042  _status == Fw::FW_SERIALIZE_OK,
4043  static_cast<FwAssertArgType>(_status)
4044  );
4045 
4046  this->eventOut_out(
4047  0,
4048  _id,
4049  _logTime,
4051  _logBuff
4052  );
4053  }
4054 
4055  // Emit the event on the text log port
4056 #if FW_ENABLE_TEXT_LOGGING
4057  if (this->isConnected_LogText_OutputPort(0)) {
4058 #if FW_OBJECT_NAMES == 1
4059  const char* _formatString =
4060  "(%s) %s: Failed CRC calculation for file %s, returned status %" PRIu32 "";
4061 #else
4062  const char* _formatString =
4063  "%s: Failed CRC calculation for file %s, returned status %" PRIu32 "";
4064 #endif
4065 
4066  Fw::TextLogString _logString;
4067  (void) _logString.format(
4068  _formatString,
4069 #if FW_OBJECT_NAMES == 1
4070  this->m_objName.toChar(),
4071 #endif
4072  "CalculateCrcFailed ",
4073  fileName.toChar(),
4074  status
4075  );
4076 
4077  this->LogText_out(
4078  0,
4079  _id,
4080  _logTime,
4082  _logString
4083  );
4084  }
4085 #endif
4086  }
4087 
4090  const Fw::StringBase& fileName,
4091  U32 crc
4092  ) const
4093  {
4094  // Get the time
4095  Fw::Time _logTime;
4096  if (this->isConnected_timeCaller_OutputPort(0)) {
4097  this->timeCaller_out(0, _logTime);
4098  }
4099 
4101 
4102  // Emit the event on the log port
4103  if (this->isConnected_eventOut_OutputPort(0)) {
4104  Fw::LogBuffer _logBuff;
4106 
4107 #if FW_AMPCS_COMPATIBLE
4108  // Serialize the number of arguments
4109  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4110  FW_ASSERT(
4111  _status == Fw::FW_SERIALIZE_OK,
4112  static_cast<FwAssertArgType>(_status)
4113  );
4114 #endif
4115 
4116  _status = fileName.serializeTo(
4117  _logBuff,
4118  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
4119  );
4120  FW_ASSERT(
4121  _status == Fw::FW_SERIALIZE_OK,
4122  static_cast<FwAssertArgType>(_status)
4123  );
4124 
4125 #if FW_AMPCS_COMPATIBLE
4126  // Serialize the argument size
4127  _status = _logBuff.serializeFrom(
4128  static_cast<U8>(sizeof(U32))
4129  );
4130  FW_ASSERT(
4131  _status == Fw::FW_SERIALIZE_OK,
4132  static_cast<FwAssertArgType>(_status)
4133  );
4134 #endif
4135  _status = _logBuff.serializeFrom(crc);
4136  FW_ASSERT(
4137  _status == Fw::FW_SERIALIZE_OK,
4138  static_cast<FwAssertArgType>(_status)
4139  );
4140 
4141  this->eventOut_out(
4142  0,
4143  _id,
4144  _logTime,
4146  _logBuff
4147  );
4148  }
4149 
4150  // Emit the event on the text log port
4151 #if FW_ENABLE_TEXT_LOGGING
4152  if (this->isConnected_LogText_OutputPort(0)) {
4153 #if FW_OBJECT_NAMES == 1
4154  const char* _formatString =
4155  "(%s) %s: %s has CRC value 0x%" PRIx32 "";
4156 #else
4157  const char* _formatString =
4158  "%s: %s has CRC value 0x%" PRIx32 "";
4159 #endif
4160 
4161  Fw::TextLogString _logString;
4162  (void) _logString.format(
4163  _formatString,
4164 #if FW_OBJECT_NAMES == 1
4165  this->m_objName.toChar(),
4166 #endif
4167  "CalculateCrcSucceeded ",
4168  fileName.toChar(),
4169  crc
4170  );
4171 
4172  this->LogText_out(
4173  0,
4174  _id,
4175  _logTime,
4177  _logString
4178  );
4179  }
4180 #endif
4181  }
4182 
4185  const Fw::StringBase& fileName,
4186  const Fw::StringFormatStatus& status
4187  ) const
4188  {
4189  // Get the time
4190  Fw::Time _logTime;
4191  if (this->isConnected_timeCaller_OutputPort(0)) {
4192  this->timeCaller_out(0, _logTime);
4193  }
4194 
4195  const FwEventIdType _id = this->getIdBase() + EVENTID_FILENAMEFORMATERROR;
4196 
4197  // Emit the event on the log port
4198  if (this->isConnected_eventOut_OutputPort(0)) {
4199  Fw::LogBuffer _logBuff;
4201 
4202 #if FW_AMPCS_COMPATIBLE
4203  // Serialize the number of arguments
4204  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4205  FW_ASSERT(
4206  _status == Fw::FW_SERIALIZE_OK,
4207  static_cast<FwAssertArgType>(_status)
4208  );
4209 #endif
4210 
4211  _status = fileName.serializeTo(
4212  _logBuff,
4213  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
4214  );
4215  FW_ASSERT(
4216  _status == Fw::FW_SERIALIZE_OK,
4217  static_cast<FwAssertArgType>(_status)
4218  );
4219 
4220 #if FW_AMPCS_COMPATIBLE
4221  // Serialize the argument size
4222  _status = _logBuff.serializeFrom(
4224  );
4225  FW_ASSERT(
4226  _status == Fw::FW_SERIALIZE_OK,
4227  static_cast<FwAssertArgType>(_status)
4228  );
4229 #endif
4230  _status = _logBuff.serializeFrom(status);
4231  FW_ASSERT(
4232  _status == Fw::FW_SERIALIZE_OK,
4233  static_cast<FwAssertArgType>(_status)
4234  );
4235 
4236  this->eventOut_out(
4237  0,
4238  _id,
4239  _logTime,
4241  _logBuff
4242  );
4243  }
4244 
4245  // Emit the event on the text log port
4246 #if FW_ENABLE_TEXT_LOGGING
4247  if (this->isConnected_LogText_OutputPort(0)) {
4248 #if FW_OBJECT_NAMES == 1
4249  const char* _formatString =
4250  "(%s) %s: Failed to format full path for file %s with status %s";
4251 #else
4252  const char* _formatString =
4253  "%s: Failed to format full path for file %s with status %s";
4254 #endif
4255 
4256  Fw::String statusStr;
4257  status.toString(statusStr);
4258 
4259  Fw::TextLogString _logString;
4260  (void) _logString.format(
4261  _formatString,
4262 #if FW_OBJECT_NAMES == 1
4263  this->m_objName.toChar(),
4264 #endif
4265  "FileNameFormatError ",
4266  fileName.toChar(),
4267  statusStr.toChar()
4268  );
4269 
4270  this->LogText_out(
4271  0,
4272  _id,
4273  _logTime,
4275  _logString
4276  );
4277  }
4278 #endif
4279  }
4280 
4283  const Fw::StringBase& fileName,
4284  U64 bytesToWrite
4285  ) const
4286  {
4287  // Get the time
4288  Fw::Time _logTime;
4289  if (this->isConnected_timeCaller_OutputPort(0)) {
4290  this->timeCaller_out(0, _logTime);
4291  }
4292 
4293  const FwEventIdType _id = this->getIdBase() + EVENTID_GENERATEDPSTARTED;
4294 
4295  // Emit the event on the log port
4296  if (this->isConnected_eventOut_OutputPort(0)) {
4297  Fw::LogBuffer _logBuff;
4299 
4300 #if FW_AMPCS_COMPATIBLE
4301  // Serialize the number of arguments
4302  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4303  FW_ASSERT(
4304  _status == Fw::FW_SERIALIZE_OK,
4305  static_cast<FwAssertArgType>(_status)
4306  );
4307 #endif
4308 
4309  _status = fileName.serializeTo(
4310  _logBuff,
4311  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
4312  );
4313  FW_ASSERT(
4314  _status == Fw::FW_SERIALIZE_OK,
4315  static_cast<FwAssertArgType>(_status)
4316  );
4317 
4318 #if FW_AMPCS_COMPATIBLE
4319  // Serialize the argument size
4320  _status = _logBuff.serializeFrom(
4321  static_cast<U8>(sizeof(U64))
4322  );
4323  FW_ASSERT(
4324  _status == Fw::FW_SERIALIZE_OK,
4325  static_cast<FwAssertArgType>(_status)
4326  );
4327 #endif
4328  _status = _logBuff.serializeFrom(bytesToWrite);
4329  FW_ASSERT(
4330  _status == Fw::FW_SERIALIZE_OK,
4331  static_cast<FwAssertArgType>(_status)
4332  );
4333 
4334  this->eventOut_out(
4335  0,
4336  _id,
4337  _logTime,
4339  _logBuff
4340  );
4341  }
4342 
4343  // Emit the event on the text log port
4344 #if FW_ENABLE_TEXT_LOGGING
4345  if (this->isConnected_LogText_OutputPort(0)) {
4346 #if FW_OBJECT_NAMES == 1
4347  const char* _formatString =
4348  "(%s) %s: Started data product generation for file %s (%" PRIu64 " bytes)";
4349 #else
4350  const char* _formatString =
4351  "%s: Started data product generation for file %s (%" PRIu64 " bytes)";
4352 #endif
4353 
4354  Fw::TextLogString _logString;
4355  (void) _logString.format(
4356  _formatString,
4357 #if FW_OBJECT_NAMES == 1
4358  this->m_objName.toChar(),
4359 #endif
4360  "GenerateDpStarted ",
4361  fileName.toChar(),
4362  bytesToWrite
4363  );
4364 
4365  this->LogText_out(
4366  0,
4367  _id,
4368  _logTime,
4370  _logString
4371  );
4372  }
4373 #endif
4374  }
4375 
4378  const Fw::StringBase& fileName,
4379  U32 chunks
4380  ) const
4381  {
4382  // Get the time
4383  Fw::Time _logTime;
4384  if (this->isConnected_timeCaller_OutputPort(0)) {
4385  this->timeCaller_out(0, _logTime);
4386  }
4387 
4388  const FwEventIdType _id = this->getIdBase() + EVENTID_GENERATEDPCOMPLETE;
4389 
4390  // Emit the event on the log port
4391  if (this->isConnected_eventOut_OutputPort(0)) {
4392  Fw::LogBuffer _logBuff;
4394 
4395 #if FW_AMPCS_COMPATIBLE
4396  // Serialize the number of arguments
4397  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4398  FW_ASSERT(
4399  _status == Fw::FW_SERIALIZE_OK,
4400  static_cast<FwAssertArgType>(_status)
4401  );
4402 #endif
4403 
4404  _status = fileName.serializeTo(
4405  _logBuff,
4406  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
4407  );
4408  FW_ASSERT(
4409  _status == Fw::FW_SERIALIZE_OK,
4410  static_cast<FwAssertArgType>(_status)
4411  );
4412 
4413 #if FW_AMPCS_COMPATIBLE
4414  // Serialize the argument size
4415  _status = _logBuff.serializeFrom(
4416  static_cast<U8>(sizeof(U32))
4417  );
4418  FW_ASSERT(
4419  _status == Fw::FW_SERIALIZE_OK,
4420  static_cast<FwAssertArgType>(_status)
4421  );
4422 #endif
4423  _status = _logBuff.serializeFrom(chunks);
4424  FW_ASSERT(
4425  _status == Fw::FW_SERIALIZE_OK,
4426  static_cast<FwAssertArgType>(_status)
4427  );
4428 
4429  this->eventOut_out(
4430  0,
4431  _id,
4432  _logTime,
4434  _logBuff
4435  );
4436  }
4437 
4438  // Emit the event on the text log port
4439 #if FW_ENABLE_TEXT_LOGGING
4440  if (this->isConnected_LogText_OutputPort(0)) {
4441 #if FW_OBJECT_NAMES == 1
4442  const char* _formatString =
4443  "(%s) %s: Completed data product generation for file %s in %" PRIu32 " chunks";
4444 #else
4445  const char* _formatString =
4446  "%s: Completed data product generation for file %s in %" PRIu32 " chunks";
4447 #endif
4448 
4449  Fw::TextLogString _logString;
4450  (void) _logString.format(
4451  _formatString,
4452 #if FW_OBJECT_NAMES == 1
4453  this->m_objName.toChar(),
4454 #endif
4455  "GenerateDpComplete ",
4456  fileName.toChar(),
4457  chunks
4458  );
4459 
4460  this->LogText_out(
4461  0,
4462  _id,
4463  _logTime,
4465  _logString
4466  );
4467  }
4468 #endif
4469  }
4470 
4473  const Fw::StringBase& fileName,
4474  const Svc::FileManager_GenerateDpStage& stage,
4475  U32 status
4476  ) const
4477  {
4478  // Get the time
4479  Fw::Time _logTime;
4480  if (this->isConnected_timeCaller_OutputPort(0)) {
4481  this->timeCaller_out(0, _logTime);
4482  }
4483 
4484  const FwEventIdType _id = this->getIdBase() + EVENTID_GENERATEDPFAILED;
4485 
4486  // Emit the event on the log port
4487  if (this->isConnected_eventOut_OutputPort(0)) {
4488  Fw::LogBuffer _logBuff;
4490 
4491 #if FW_AMPCS_COMPATIBLE
4492  // Serialize the number of arguments
4493  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4494  FW_ASSERT(
4495  _status == Fw::FW_SERIALIZE_OK,
4496  static_cast<FwAssertArgType>(_status)
4497  );
4498 #endif
4499 
4500  _status = fileName.serializeTo(
4501  _logBuff,
4502  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
4503  );
4504  FW_ASSERT(
4505  _status == Fw::FW_SERIALIZE_OK,
4506  static_cast<FwAssertArgType>(_status)
4507  );
4508 
4509 #if FW_AMPCS_COMPATIBLE
4510  // Serialize the argument size
4511  _status = _logBuff.serializeFrom(
4513  );
4514  FW_ASSERT(
4515  _status == Fw::FW_SERIALIZE_OK,
4516  static_cast<FwAssertArgType>(_status)
4517  );
4518 #endif
4519  _status = _logBuff.serializeFrom(stage);
4520  FW_ASSERT(
4521  _status == Fw::FW_SERIALIZE_OK,
4522  static_cast<FwAssertArgType>(_status)
4523  );
4524 
4525 #if FW_AMPCS_COMPATIBLE
4526  // Serialize the argument size
4527  _status = _logBuff.serializeFrom(
4528  static_cast<U8>(sizeof(U32))
4529  );
4530  FW_ASSERT(
4531  _status == Fw::FW_SERIALIZE_OK,
4532  static_cast<FwAssertArgType>(_status)
4533  );
4534 #endif
4535  _status = _logBuff.serializeFrom(status);
4536  FW_ASSERT(
4537  _status == Fw::FW_SERIALIZE_OK,
4538  static_cast<FwAssertArgType>(_status)
4539  );
4540 
4541  this->eventOut_out(
4542  0,
4543  _id,
4544  _logTime,
4546  _logBuff
4547  );
4548  }
4549 
4550  // Emit the event on the text log port
4551 #if FW_ENABLE_TEXT_LOGGING
4552  if (this->isConnected_LogText_OutputPort(0)) {
4553 #if FW_OBJECT_NAMES == 1
4554  const char* _formatString =
4555  "(%s) %s: Data product generation failed for file %s at stage %s, status %" PRIu32 "";
4556 #else
4557  const char* _formatString =
4558  "%s: Data product generation failed for file %s at stage %s, status %" PRIu32 "";
4559 #endif
4560 
4561  Fw::String stageStr;
4562  stage.toString(stageStr);
4563 
4564  Fw::TextLogString _logString;
4565  (void) _logString.format(
4566  _formatString,
4567 #if FW_OBJECT_NAMES == 1
4568  this->m_objName.toChar(),
4569 #endif
4570  "GenerateDpFailed ",
4571  fileName.toChar(),
4572  stageStr.toChar(),
4573  status
4574  );
4575 
4576  this->LogText_out(
4577  0,
4578  _id,
4579  _logTime,
4581  _logString
4582  );
4583  }
4584 #endif
4585  }
4586 
4589  {
4590  // Get the time
4591  Fw::Time _logTime;
4592  if (this->isConnected_timeCaller_OutputPort(0)) {
4593  this->timeCaller_out(0, _logTime);
4594  }
4595 
4597 
4598  // Emit the event on the log port
4599  if (this->isConnected_eventOut_OutputPort(0)) {
4600  Fw::LogBuffer _logBuff;
4602 
4603 #if FW_AMPCS_COMPATIBLE
4604  // Serialize the number of arguments
4605  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4606  FW_ASSERT(
4607  _status == Fw::FW_SERIALIZE_OK,
4608  static_cast<FwAssertArgType>(_status)
4609  );
4610 #endif
4611 
4612  _status = fileName.serializeTo(
4613  _logBuff,
4614  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
4615  );
4616  FW_ASSERT(
4617  _status == Fw::FW_SERIALIZE_OK,
4618  static_cast<FwAssertArgType>(_status)
4619  );
4620 
4621  this->eventOut_out(
4622  0,
4623  _id,
4624  _logTime,
4626  _logBuff
4627  );
4628  }
4629 
4630  // Emit the event on the text log port
4631 #if FW_ENABLE_TEXT_LOGGING
4632  if (this->isConnected_LogText_OutputPort(0)) {
4633 #if FW_OBJECT_NAMES == 1
4634  const char* _formatString =
4635  "(%s) %s: Failed to allocate data product buffer for file %s";
4636 #else
4637  const char* _formatString =
4638  "%s: Failed to allocate data product buffer for file %s";
4639 #endif
4640 
4641  Fw::TextLogString _logString;
4642  (void) _logString.format(
4643  _formatString,
4644 #if FW_OBJECT_NAMES == 1
4645  this->m_objName.toChar(),
4646 #endif
4647  "GenerateDpBufferFailed ",
4648  fileName.toChar()
4649  );
4650 
4651  this->LogText_out(
4652  0,
4653  _id,
4654  _logTime,
4656  _logString
4657  );
4658  }
4659 #endif
4660  }
4661 
4664  const Fw::StringBase& fileName,
4665  U64 beginOffset,
4666  U64 endOffset,
4667  U64 fileSize
4668  ) const
4669  {
4670  // Get the time
4671  Fw::Time _logTime;
4672  if (this->isConnected_timeCaller_OutputPort(0)) {
4673  this->timeCaller_out(0, _logTime);
4674  }
4675 
4677 
4678  // Emit the event on the log port
4679  if (this->isConnected_eventOut_OutputPort(0)) {
4680  Fw::LogBuffer _logBuff;
4682 
4683 #if FW_AMPCS_COMPATIBLE
4684  // Serialize the number of arguments
4685  _status = _logBuff.serializeFrom(static_cast<U8>(4));
4686  FW_ASSERT(
4687  _status == Fw::FW_SERIALIZE_OK,
4688  static_cast<FwAssertArgType>(_status)
4689  );
4690 #endif
4691 
4692  _status = fileName.serializeTo(
4693  _logBuff,
4694  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
4695  );
4696  FW_ASSERT(
4697  _status == Fw::FW_SERIALIZE_OK,
4698  static_cast<FwAssertArgType>(_status)
4699  );
4700 
4701 #if FW_AMPCS_COMPATIBLE
4702  // Serialize the argument size
4703  _status = _logBuff.serializeFrom(
4704  static_cast<U8>(sizeof(U64))
4705  );
4706  FW_ASSERT(
4707  _status == Fw::FW_SERIALIZE_OK,
4708  static_cast<FwAssertArgType>(_status)
4709  );
4710 #endif
4711  _status = _logBuff.serializeFrom(beginOffset);
4712  FW_ASSERT(
4713  _status == Fw::FW_SERIALIZE_OK,
4714  static_cast<FwAssertArgType>(_status)
4715  );
4716 
4717 #if FW_AMPCS_COMPATIBLE
4718  // Serialize the argument size
4719  _status = _logBuff.serializeFrom(
4720  static_cast<U8>(sizeof(U64))
4721  );
4722  FW_ASSERT(
4723  _status == Fw::FW_SERIALIZE_OK,
4724  static_cast<FwAssertArgType>(_status)
4725  );
4726 #endif
4727  _status = _logBuff.serializeFrom(endOffset);
4728  FW_ASSERT(
4729  _status == Fw::FW_SERIALIZE_OK,
4730  static_cast<FwAssertArgType>(_status)
4731  );
4732 
4733 #if FW_AMPCS_COMPATIBLE
4734  // Serialize the argument size
4735  _status = _logBuff.serializeFrom(
4736  static_cast<U8>(sizeof(U64))
4737  );
4738  FW_ASSERT(
4739  _status == Fw::FW_SERIALIZE_OK,
4740  static_cast<FwAssertArgType>(_status)
4741  );
4742 #endif
4743  _status = _logBuff.serializeFrom(fileSize);
4744  FW_ASSERT(
4745  _status == Fw::FW_SERIALIZE_OK,
4746  static_cast<FwAssertArgType>(_status)
4747  );
4748 
4749  this->eventOut_out(
4750  0,
4751  _id,
4752  _logTime,
4754  _logBuff
4755  );
4756  }
4757 
4758  // Emit the event on the text log port
4759 #if FW_ENABLE_TEXT_LOGGING
4760  if (this->isConnected_LogText_OutputPort(0)) {
4761 #if FW_OBJECT_NAMES == 1
4762  const char* _formatString =
4763  "(%s) %s: Invalid offset range requested for file %s: [%" PRIu64 ", %" PRIu64 ") with file size %" PRIu64 "";
4764 #else
4765  const char* _formatString =
4766  "%s: Invalid offset range requested for file %s: [%" PRIu64 ", %" PRIu64 ") with file size %" PRIu64 "";
4767 #endif
4768 
4769  Fw::TextLogString _logString;
4770  (void) _logString.format(
4771  _formatString,
4772 #if FW_OBJECT_NAMES == 1
4773  this->m_objName.toChar(),
4774 #endif
4775  "GenerateDpInvalidRange ",
4776  fileName.toChar(),
4777  beginOffset,
4778  endOffset,
4779  fileSize
4780  );
4781 
4782  this->LogText_out(
4783  0,
4784  _id,
4785  _logTime,
4787  _logString
4788  );
4789  }
4790 #endif
4791  }
4792 
4795  const Fw::StringBase& path,
4796  const Fw::StringBase& sandboxDir
4797  ) const
4798  {
4799  // Get the time
4800  Fw::Time _logTime;
4801  if (this->isConnected_timeCaller_OutputPort(0)) {
4802  this->timeCaller_out(0, _logTime);
4803  }
4804 
4805  const FwEventIdType _id = this->getIdBase() + EVENTID_PATHOUTSIDESANDBOX;
4806 
4807  // Emit the event on the log port
4808  if (this->isConnected_eventOut_OutputPort(0)) {
4809  Fw::LogBuffer _logBuff;
4811 
4812 #if FW_AMPCS_COMPATIBLE
4813  // Serialize the number of arguments
4814  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4815  FW_ASSERT(
4816  _status == Fw::FW_SERIALIZE_OK,
4817  static_cast<FwAssertArgType>(_status)
4818  );
4819 #endif
4820 
4821  _status = path.serializeTo(
4822  _logBuff,
4823  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
4824  );
4825  FW_ASSERT(
4826  _status == Fw::FW_SERIALIZE_OK,
4827  static_cast<FwAssertArgType>(_status)
4828  );
4829 
4830  _status = sandboxDir.serializeTo(
4831  _logBuff,
4832  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
4833  );
4834  FW_ASSERT(
4835  _status == Fw::FW_SERIALIZE_OK,
4836  static_cast<FwAssertArgType>(_status)
4837  );
4838 
4839  this->eventOut_out(
4840  0,
4841  _id,
4842  _logTime,
4844  _logBuff
4845  );
4846  }
4847 
4848  // Emit the event on the text log port
4849 #if FW_ENABLE_TEXT_LOGGING
4850  if (this->isConnected_LogText_OutputPort(0)) {
4851 #if FW_OBJECT_NAMES == 1
4852  const char* _formatString =
4853  "(%s) %s: Path %s is outside the configured sandbox directory %s";
4854 #else
4855  const char* _formatString =
4856  "%s: Path %s is outside the configured sandbox directory %s";
4857 #endif
4858 
4859  Fw::TextLogString _logString;
4860  (void) _logString.format(
4861  _formatString,
4862 #if FW_OBJECT_NAMES == 1
4863  this->m_objName.toChar(),
4864 #endif
4865  "PathOutsideSandbox ",
4866  path.toChar(),
4867  sandboxDir.toChar()
4868  );
4869 
4870  this->LogText_out(
4871  0,
4872  _id,
4873  _logTime,
4875  _logString
4876  );
4877  }
4878 #endif
4879  }
4880 
4881  // ----------------------------------------------------------------------
4882  // Telemetry serialized write
4883  // ----------------------------------------------------------------------
4884 
4887  FwChanIdType id,
4888  Fw::TlmBuffer& _tlmBuff,
4889  Fw::Time _tlmTime
4890  ) const
4891  {
4892  if (this->isConnected_tlmOut_OutputPort(0)) {
4893  if (
4895  (_tlmTime == Fw::ZERO_TIME)
4896  ) {
4897  this->timeCaller_out(0, _tlmTime);
4898  }
4899 
4900  FwChanIdType _id;
4901  _id = this->getIdBase() + id;
4902 
4903  this->tlmOut_out(
4904  0,
4905  _id,
4906  _tlmTime,
4907  _tlmBuff
4908  );
4909  }
4910  }
4911 
4912  // ----------------------------------------------------------------------
4913  // Telemetry write functions
4914  // ----------------------------------------------------------------------
4915 
4918  U32 arg,
4919  Fw::Time _tlmTime
4920  ) const
4921  {
4922  if (this->isConnected_tlmOut_OutputPort(0)) {
4923  Fw::TlmBuffer _tlmBuff;
4924  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4925  FW_ASSERT(
4926  _stat == Fw::FW_SERIALIZE_OK,
4927  static_cast<FwAssertArgType>(_stat)
4928  );
4929 
4930  this->tlmWrite(
4932  _tlmBuff,
4933  _tlmTime
4934  );
4935  }
4936  }
4937 
4940  U32 arg,
4941  Fw::Time _tlmTime
4942  ) const
4943  {
4944  if (this->isConnected_tlmOut_OutputPort(0)) {
4945  Fw::TlmBuffer _tlmBuff;
4946  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4947  FW_ASSERT(
4948  _stat == Fw::FW_SERIALIZE_OK,
4949  static_cast<FwAssertArgType>(_stat)
4950  );
4951 
4952  this->tlmWrite(
4954  _tlmBuff,
4955  _tlmTime
4956  );
4957  }
4958  }
4959 
4960  // ----------------------------------------------------------------------
4961  // Functions for managing data products
4962  // ----------------------------------------------------------------------
4963 
4966  DpContainer& container,
4967  Fw::Time timeTag
4968  )
4969  {
4970  // Update the time tag
4971  if (timeTag == Fw::ZERO_TIME) {
4972  // Get the time from the time port
4973  timeTag = this->getTime();
4974  }
4975  container.setTimeTag(timeTag);
4976  // Serialize the header into the packet
4977  container.serializeHeader();
4978  // Update the size of the buffer according to the data size
4979  const FwSizeType packetSize = container.getPacketSize();
4980  Fw::Buffer buffer = container.getBuffer();
4981  FW_ASSERT(packetSize <= buffer.getSize(), static_cast<FwAssertArgType>(packetSize),
4982  static_cast<FwAssertArgType>(buffer.getSize()));
4983  buffer.setSize(static_cast<U32>(packetSize));
4984  // Invalidate the buffer in the container, so it can't be reused
4985  container.invalidateBuffer();
4986  // Send the buffer
4987  this->productSendOut_out(0, container.getId(), buffer);
4988  }
4989 
4990  // ----------------------------------------------------------------------
4991  // Time
4992  // ----------------------------------------------------------------------
4993 
4995  getTime() const
4996  {
4997  if (this->isConnected_timeCaller_OutputPort(0)) {
4998  Fw::Time _time;
4999  this->timeCaller_out(0, _time);
5000  return _time;
5001  }
5002  else {
5003  return Fw::Time(TimeBase::TB_NONE, 0, 0);
5004  }
5005  }
5006 
5007  // ----------------------------------------------------------------------
5008  // Message dispatch functions
5009  // ----------------------------------------------------------------------
5010 
5011  Fw::QueuedComponentBase::MsgDispatchStatus FileManagerComponentBase ::
5012  doDispatch()
5013  {
5014  ComponentIpcSerializableBuffer _msg;
5015  FwQueuePriorityType _priority = 0;
5016 
5017  Os::Queue::Status _msgStatus = this->m_queue.receive(
5018  _msg,
5020  _priority
5021  );
5022  FW_ASSERT(
5023  _msgStatus == Os::Queue::OP_OK,
5024  static_cast<FwAssertArgType>(_msgStatus)
5025  );
5026 
5027  // Reset to beginning of buffer
5028  _msg.resetDeser();
5029 
5030  FwEnumStoreType _desMsg = 0;
5031  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
5032  FW_ASSERT(
5033  _deserStatus == Fw::FW_SERIALIZE_OK,
5034  static_cast<FwAssertArgType>(_deserStatus)
5035  );
5036 
5037  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
5038 
5039  if (_msgType == FILEMANAGER_COMPONENT_EXIT) {
5040  return MSG_DISPATCH_EXIT;
5041  }
5042 
5043  FwIndexType portNum = 0;
5044  _deserStatus = _msg.deserializeTo(portNum);
5045  FW_ASSERT(
5046  _deserStatus == Fw::FW_SERIALIZE_OK,
5047  static_cast<FwAssertArgType>(_deserStatus)
5048  );
5049 
5050  switch (_msgType) {
5051  // Handle async input port pingIn
5052  case PINGIN_PING: {
5053  // Deserialize argument key
5054  U32 key;
5055  _deserStatus = _msg.deserializeTo(key);
5056  FW_ASSERT(
5057  _deserStatus == Fw::FW_SERIALIZE_OK,
5058  static_cast<FwAssertArgType>(_deserStatus)
5059  );
5060  // Call handler function
5061  this->pingIn_handler(
5062  portNum,
5063  key
5064  );
5065 
5066  break;
5067  }
5068 
5069  // Handle command CreateDirectory
5070  case CMD_CREATEDIRECTORY: {
5071  // Deserialize opcode
5072  FwOpcodeType _opCode = 0;
5073  _deserStatus = _msg.deserializeTo(_opCode);
5074  FW_ASSERT (
5075  _deserStatus == Fw::FW_SERIALIZE_OK,
5076  static_cast<FwAssertArgType>(_deserStatus)
5077  );
5078 
5079  // Deserialize command sequence
5080  U32 _cmdSeq = 0;
5081  _deserStatus = _msg.deserializeTo(_cmdSeq);
5082  FW_ASSERT (
5083  _deserStatus == Fw::FW_SERIALIZE_OK,
5084  static_cast<FwAssertArgType>(_deserStatus)
5085  );
5086 
5087  // Deserialize command argument buffer
5088  Fw::CmdArgBuffer args;
5089  _deserStatus = _msg.deserializeTo(args);
5090  FW_ASSERT (
5091  _deserStatus == Fw::FW_SERIALIZE_OK,
5092  static_cast<FwAssertArgType>(_deserStatus)
5093  );
5094 
5095  // Reset buffer
5096  args.resetDeser();
5097 
5098  // Deserialize argument dirName
5099  Fw::CmdStringArg dirName;
5100  _deserStatus = args.deserializeTo(dirName);
5101  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5103  this->cmdResponse_out(
5104  _opCode,
5105  _cmdSeq,
5107  );
5108  }
5109  // Don't crash the task if bad arguments were passed from the ground
5110  break;
5111  }
5112 
5113  // Make sure there was no data left over.
5114  // That means the argument buffer size was incorrect.
5115 #if FW_CMD_CHECK_RESIDUAL
5116  if (args.getDeserializeSizeLeft() != 0) {
5118  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5119  }
5120  // Don't crash the task if bad arguments were passed from the ground
5121  break;
5122  }
5123 #endif
5124 
5125  // Call handler function
5127  _opCode, _cmdSeq,
5128  dirName
5129  );
5130 
5131  break;
5132  }
5133 
5134  // Handle command MoveFile
5135  case CMD_MOVEFILE: {
5136  // Deserialize opcode
5137  FwOpcodeType _opCode = 0;
5138  _deserStatus = _msg.deserializeTo(_opCode);
5139  FW_ASSERT (
5140  _deserStatus == Fw::FW_SERIALIZE_OK,
5141  static_cast<FwAssertArgType>(_deserStatus)
5142  );
5143 
5144  // Deserialize command sequence
5145  U32 _cmdSeq = 0;
5146  _deserStatus = _msg.deserializeTo(_cmdSeq);
5147  FW_ASSERT (
5148  _deserStatus == Fw::FW_SERIALIZE_OK,
5149  static_cast<FwAssertArgType>(_deserStatus)
5150  );
5151 
5152  // Deserialize command argument buffer
5153  Fw::CmdArgBuffer args;
5154  _deserStatus = _msg.deserializeTo(args);
5155  FW_ASSERT (
5156  _deserStatus == Fw::FW_SERIALIZE_OK,
5157  static_cast<FwAssertArgType>(_deserStatus)
5158  );
5159 
5160  // Reset buffer
5161  args.resetDeser();
5162 
5163  // Deserialize argument sourceFileName
5164  Fw::CmdStringArg sourceFileName;
5165  _deserStatus = args.deserializeTo(sourceFileName);
5166  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5168  this->cmdResponse_out(
5169  _opCode,
5170  _cmdSeq,
5172  );
5173  }
5174  // Don't crash the task if bad arguments were passed from the ground
5175  break;
5176  }
5177 
5178  // Deserialize argument destFileName
5179  Fw::CmdStringArg destFileName;
5180  _deserStatus = args.deserializeTo(destFileName);
5181  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5183  this->cmdResponse_out(
5184  _opCode,
5185  _cmdSeq,
5187  );
5188  }
5189  // Don't crash the task if bad arguments were passed from the ground
5190  break;
5191  }
5192 
5193  // Make sure there was no data left over.
5194  // That means the argument buffer size was incorrect.
5195 #if FW_CMD_CHECK_RESIDUAL
5196  if (args.getDeserializeSizeLeft() != 0) {
5198  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5199  }
5200  // Don't crash the task if bad arguments were passed from the ground
5201  break;
5202  }
5203 #endif
5204 
5205  // Call handler function
5206  this->MoveFile_cmdHandler(
5207  _opCode, _cmdSeq,
5208  sourceFileName,
5209  destFileName
5210  );
5211 
5212  break;
5213  }
5214 
5215  // Handle command RemoveDirectory
5216  case CMD_REMOVEDIRECTORY: {
5217  // Deserialize opcode
5218  FwOpcodeType _opCode = 0;
5219  _deserStatus = _msg.deserializeTo(_opCode);
5220  FW_ASSERT (
5221  _deserStatus == Fw::FW_SERIALIZE_OK,
5222  static_cast<FwAssertArgType>(_deserStatus)
5223  );
5224 
5225  // Deserialize command sequence
5226  U32 _cmdSeq = 0;
5227  _deserStatus = _msg.deserializeTo(_cmdSeq);
5228  FW_ASSERT (
5229  _deserStatus == Fw::FW_SERIALIZE_OK,
5230  static_cast<FwAssertArgType>(_deserStatus)
5231  );
5232 
5233  // Deserialize command argument buffer
5234  Fw::CmdArgBuffer args;
5235  _deserStatus = _msg.deserializeTo(args);
5236  FW_ASSERT (
5237  _deserStatus == Fw::FW_SERIALIZE_OK,
5238  static_cast<FwAssertArgType>(_deserStatus)
5239  );
5240 
5241  // Reset buffer
5242  args.resetDeser();
5243 
5244  // Deserialize argument dirName
5245  Fw::CmdStringArg dirName;
5246  _deserStatus = args.deserializeTo(dirName);
5247  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5249  this->cmdResponse_out(
5250  _opCode,
5251  _cmdSeq,
5253  );
5254  }
5255  // Don't crash the task if bad arguments were passed from the ground
5256  break;
5257  }
5258 
5259  // Make sure there was no data left over.
5260  // That means the argument buffer size was incorrect.
5261 #if FW_CMD_CHECK_RESIDUAL
5262  if (args.getDeserializeSizeLeft() != 0) {
5264  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5265  }
5266  // Don't crash the task if bad arguments were passed from the ground
5267  break;
5268  }
5269 #endif
5270 
5271  // Call handler function
5273  _opCode, _cmdSeq,
5274  dirName
5275  );
5276 
5277  break;
5278  }
5279 
5280  // Handle command RemoveFile
5281  case CMD_REMOVEFILE: {
5282  // Deserialize opcode
5283  FwOpcodeType _opCode = 0;
5284  _deserStatus = _msg.deserializeTo(_opCode);
5285  FW_ASSERT (
5286  _deserStatus == Fw::FW_SERIALIZE_OK,
5287  static_cast<FwAssertArgType>(_deserStatus)
5288  );
5289 
5290  // Deserialize command sequence
5291  U32 _cmdSeq = 0;
5292  _deserStatus = _msg.deserializeTo(_cmdSeq);
5293  FW_ASSERT (
5294  _deserStatus == Fw::FW_SERIALIZE_OK,
5295  static_cast<FwAssertArgType>(_deserStatus)
5296  );
5297 
5298  // Deserialize command argument buffer
5299  Fw::CmdArgBuffer args;
5300  _deserStatus = _msg.deserializeTo(args);
5301  FW_ASSERT (
5302  _deserStatus == Fw::FW_SERIALIZE_OK,
5303  static_cast<FwAssertArgType>(_deserStatus)
5304  );
5305 
5306  // Reset buffer
5307  args.resetDeser();
5308 
5309  // Deserialize argument fileName
5310  Fw::CmdStringArg fileName;
5311  _deserStatus = args.deserializeTo(fileName);
5312  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5314  this->cmdResponse_out(
5315  _opCode,
5316  _cmdSeq,
5318  );
5319  }
5320  // Don't crash the task if bad arguments were passed from the ground
5321  break;
5322  }
5323 
5324  // Deserialize argument ignoreErrors
5325  bool ignoreErrors;
5326  _deserStatus = args.deserializeTo(ignoreErrors);
5327  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5329  this->cmdResponse_out(
5330  _opCode,
5331  _cmdSeq,
5333  );
5334  }
5335  // Don't crash the task if bad arguments were passed from the ground
5336  break;
5337  }
5338 
5339  // Make sure there was no data left over.
5340  // That means the argument buffer size was incorrect.
5341 #if FW_CMD_CHECK_RESIDUAL
5342  if (args.getDeserializeSizeLeft() != 0) {
5344  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5345  }
5346  // Don't crash the task if bad arguments were passed from the ground
5347  break;
5348  }
5349 #endif
5350 
5351  // Call handler function
5352  this->RemoveFile_cmdHandler(
5353  _opCode, _cmdSeq,
5354  fileName,
5355  ignoreErrors
5356  );
5357 
5358  break;
5359  }
5360 
5361  // Handle command AppendFile
5362  case CMD_APPENDFILE: {
5363  // Deserialize opcode
5364  FwOpcodeType _opCode = 0;
5365  _deserStatus = _msg.deserializeTo(_opCode);
5366  FW_ASSERT (
5367  _deserStatus == Fw::FW_SERIALIZE_OK,
5368  static_cast<FwAssertArgType>(_deserStatus)
5369  );
5370 
5371  // Deserialize command sequence
5372  U32 _cmdSeq = 0;
5373  _deserStatus = _msg.deserializeTo(_cmdSeq);
5374  FW_ASSERT (
5375  _deserStatus == Fw::FW_SERIALIZE_OK,
5376  static_cast<FwAssertArgType>(_deserStatus)
5377  );
5378 
5379  // Deserialize command argument buffer
5380  Fw::CmdArgBuffer args;
5381  _deserStatus = _msg.deserializeTo(args);
5382  FW_ASSERT (
5383  _deserStatus == Fw::FW_SERIALIZE_OK,
5384  static_cast<FwAssertArgType>(_deserStatus)
5385  );
5386 
5387  // Reset buffer
5388  args.resetDeser();
5389 
5390  // Deserialize argument source
5391  Fw::CmdStringArg source;
5392  _deserStatus = args.deserializeTo(source);
5393  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5395  this->cmdResponse_out(
5396  _opCode,
5397  _cmdSeq,
5399  );
5400  }
5401  // Don't crash the task if bad arguments were passed from the ground
5402  break;
5403  }
5404 
5405  // Deserialize argument target
5406  Fw::CmdStringArg target;
5407  _deserStatus = args.deserializeTo(target);
5408  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5410  this->cmdResponse_out(
5411  _opCode,
5412  _cmdSeq,
5414  );
5415  }
5416  // Don't crash the task if bad arguments were passed from the ground
5417  break;
5418  }
5419 
5420  // Make sure there was no data left over.
5421  // That means the argument buffer size was incorrect.
5422 #if FW_CMD_CHECK_RESIDUAL
5423  if (args.getDeserializeSizeLeft() != 0) {
5425  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5426  }
5427  // Don't crash the task if bad arguments were passed from the ground
5428  break;
5429  }
5430 #endif
5431 
5432  // Call handler function
5433  this->AppendFile_cmdHandler(
5434  _opCode, _cmdSeq,
5435  source,
5436  target
5437  );
5438 
5439  break;
5440  }
5441 
5442  // Handle command FileSize
5443  case CMD_FILESIZE: {
5444  // Deserialize opcode
5445  FwOpcodeType _opCode = 0;
5446  _deserStatus = _msg.deserializeTo(_opCode);
5447  FW_ASSERT (
5448  _deserStatus == Fw::FW_SERIALIZE_OK,
5449  static_cast<FwAssertArgType>(_deserStatus)
5450  );
5451 
5452  // Deserialize command sequence
5453  U32 _cmdSeq = 0;
5454  _deserStatus = _msg.deserializeTo(_cmdSeq);
5455  FW_ASSERT (
5456  _deserStatus == Fw::FW_SERIALIZE_OK,
5457  static_cast<FwAssertArgType>(_deserStatus)
5458  );
5459 
5460  // Deserialize command argument buffer
5461  Fw::CmdArgBuffer args;
5462  _deserStatus = _msg.deserializeTo(args);
5463  FW_ASSERT (
5464  _deserStatus == Fw::FW_SERIALIZE_OK,
5465  static_cast<FwAssertArgType>(_deserStatus)
5466  );
5467 
5468  // Reset buffer
5469  args.resetDeser();
5470 
5471  // Deserialize argument fileName
5472  Fw::CmdStringArg fileName;
5473  _deserStatus = args.deserializeTo(fileName);
5474  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5476  this->cmdResponse_out(
5477  _opCode,
5478  _cmdSeq,
5480  );
5481  }
5482  // Don't crash the task if bad arguments were passed from the ground
5483  break;
5484  }
5485 
5486  // Make sure there was no data left over.
5487  // That means the argument buffer size was incorrect.
5488 #if FW_CMD_CHECK_RESIDUAL
5489  if (args.getDeserializeSizeLeft() != 0) {
5491  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5492  }
5493  // Don't crash the task if bad arguments were passed from the ground
5494  break;
5495  }
5496 #endif
5497 
5498  // Call handler function
5499  this->FileSize_cmdHandler(
5500  _opCode, _cmdSeq,
5501  fileName
5502  );
5503 
5504  break;
5505  }
5506 
5507  // Handle command ListDirectory
5508  case CMD_LISTDIRECTORY: {
5509  // Deserialize opcode
5510  FwOpcodeType _opCode = 0;
5511  _deserStatus = _msg.deserializeTo(_opCode);
5512  FW_ASSERT (
5513  _deserStatus == Fw::FW_SERIALIZE_OK,
5514  static_cast<FwAssertArgType>(_deserStatus)
5515  );
5516 
5517  // Deserialize command sequence
5518  U32 _cmdSeq = 0;
5519  _deserStatus = _msg.deserializeTo(_cmdSeq);
5520  FW_ASSERT (
5521  _deserStatus == Fw::FW_SERIALIZE_OK,
5522  static_cast<FwAssertArgType>(_deserStatus)
5523  );
5524 
5525  // Deserialize command argument buffer
5526  Fw::CmdArgBuffer args;
5527  _deserStatus = _msg.deserializeTo(args);
5528  FW_ASSERT (
5529  _deserStatus == Fw::FW_SERIALIZE_OK,
5530  static_cast<FwAssertArgType>(_deserStatus)
5531  );
5532 
5533  // Reset buffer
5534  args.resetDeser();
5535 
5536  // Deserialize argument dirName
5537  Fw::CmdStringArg dirName;
5538  _deserStatus = args.deserializeTo(dirName);
5539  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5541  this->cmdResponse_out(
5542  _opCode,
5543  _cmdSeq,
5545  );
5546  }
5547  // Don't crash the task if bad arguments were passed from the ground
5548  break;
5549  }
5550 
5551  // Make sure there was no data left over.
5552  // That means the argument buffer size was incorrect.
5553 #if FW_CMD_CHECK_RESIDUAL
5554  if (args.getDeserializeSizeLeft() != 0) {
5556  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5557  }
5558  // Don't crash the task if bad arguments were passed from the ground
5559  break;
5560  }
5561 #endif
5562 
5563  // Call handler function
5565  _opCode, _cmdSeq,
5566  dirName
5567  );
5568 
5569  break;
5570  }
5571 
5572  // Handle command CalculateCrc
5573  case CMD_CALCULATECRC: {
5574  // Deserialize opcode
5575  FwOpcodeType _opCode = 0;
5576  _deserStatus = _msg.deserializeTo(_opCode);
5577  FW_ASSERT (
5578  _deserStatus == Fw::FW_SERIALIZE_OK,
5579  static_cast<FwAssertArgType>(_deserStatus)
5580  );
5581 
5582  // Deserialize command sequence
5583  U32 _cmdSeq = 0;
5584  _deserStatus = _msg.deserializeTo(_cmdSeq);
5585  FW_ASSERT (
5586  _deserStatus == Fw::FW_SERIALIZE_OK,
5587  static_cast<FwAssertArgType>(_deserStatus)
5588  );
5589 
5590  // Deserialize command argument buffer
5591  Fw::CmdArgBuffer args;
5592  _deserStatus = _msg.deserializeTo(args);
5593  FW_ASSERT (
5594  _deserStatus == Fw::FW_SERIALIZE_OK,
5595  static_cast<FwAssertArgType>(_deserStatus)
5596  );
5597 
5598  // Reset buffer
5599  args.resetDeser();
5600 
5601  // Deserialize argument filename
5602  Fw::CmdStringArg filename;
5603  _deserStatus = args.deserializeTo(filename);
5604  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5606  this->cmdResponse_out(
5607  _opCode,
5608  _cmdSeq,
5610  );
5611  }
5612  // Don't crash the task if bad arguments were passed from the ground
5613  break;
5614  }
5615 
5616  // Make sure there was no data left over.
5617  // That means the argument buffer size was incorrect.
5618 #if FW_CMD_CHECK_RESIDUAL
5619  if (args.getDeserializeSizeLeft() != 0) {
5621  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5622  }
5623  // Don't crash the task if bad arguments were passed from the ground
5624  break;
5625  }
5626 #endif
5627 
5628  // Call handler function
5630  _opCode, _cmdSeq,
5631  filename
5632  );
5633 
5634  break;
5635  }
5636 
5637  // Handle command GenerateDp
5638  case CMD_GENERATEDP: {
5639  // Deserialize opcode
5640  FwOpcodeType _opCode = 0;
5641  _deserStatus = _msg.deserializeTo(_opCode);
5642  FW_ASSERT (
5643  _deserStatus == Fw::FW_SERIALIZE_OK,
5644  static_cast<FwAssertArgType>(_deserStatus)
5645  );
5646 
5647  // Deserialize command sequence
5648  U32 _cmdSeq = 0;
5649  _deserStatus = _msg.deserializeTo(_cmdSeq);
5650  FW_ASSERT (
5651  _deserStatus == Fw::FW_SERIALIZE_OK,
5652  static_cast<FwAssertArgType>(_deserStatus)
5653  );
5654 
5655  // Deserialize command argument buffer
5656  Fw::CmdArgBuffer args;
5657  _deserStatus = _msg.deserializeTo(args);
5658  FW_ASSERT (
5659  _deserStatus == Fw::FW_SERIALIZE_OK,
5660  static_cast<FwAssertArgType>(_deserStatus)
5661  );
5662 
5663  // Reset buffer
5664  args.resetDeser();
5665 
5666  // Deserialize argument fileName
5667  Fw::CmdStringArg fileName;
5668  _deserStatus = args.deserializeTo(fileName);
5669  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5671  this->cmdResponse_out(
5672  _opCode,
5673  _cmdSeq,
5675  );
5676  }
5677  // Don't crash the task if bad arguments were passed from the ground
5678  break;
5679  }
5680 
5681  // Deserialize argument chunkSize
5682  U32 chunkSize;
5683  _deserStatus = args.deserializeTo(chunkSize);
5684  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5686  this->cmdResponse_out(
5687  _opCode,
5688  _cmdSeq,
5690  );
5691  }
5692  // Don't crash the task if bad arguments were passed from the ground
5693  break;
5694  }
5695 
5696  // Deserialize argument beginOffset
5697  U64 beginOffset;
5698  _deserStatus = args.deserializeTo(beginOffset);
5699  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5701  this->cmdResponse_out(
5702  _opCode,
5703  _cmdSeq,
5705  );
5706  }
5707  // Don't crash the task if bad arguments were passed from the ground
5708  break;
5709  }
5710 
5711  // Deserialize argument endOffset
5712  U64 endOffset;
5713  _deserStatus = args.deserializeTo(endOffset);
5714  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5716  this->cmdResponse_out(
5717  _opCode,
5718  _cmdSeq,
5720  );
5721  }
5722  // Don't crash the task if bad arguments were passed from the ground
5723  break;
5724  }
5725 
5726  // Deserialize argument priority
5727  U32 priority;
5728  _deserStatus = args.deserializeTo(priority);
5729  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5731  this->cmdResponse_out(
5732  _opCode,
5733  _cmdSeq,
5735  );
5736  }
5737  // Don't crash the task if bad arguments were passed from the ground
5738  break;
5739  }
5740 
5741  // Deserialize argument mode
5743  _deserStatus = args.deserializeTo(mode);
5744  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5746  this->cmdResponse_out(
5747  _opCode,
5748  _cmdSeq,
5750  );
5751  }
5752  // Don't crash the task if bad arguments were passed from the ground
5753  break;
5754  }
5755 
5756  // Make sure there was no data left over.
5757  // That means the argument buffer size was incorrect.
5758 #if FW_CMD_CHECK_RESIDUAL
5759  if (args.getDeserializeSizeLeft() != 0) {
5761  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5762  }
5763  // Don't crash the task if bad arguments were passed from the ground
5764  break;
5765  }
5766 #endif
5767 
5768  // Call handler function
5769  this->GenerateDp_cmdHandler(
5770  _opCode, _cmdSeq,
5771  fileName,
5772  chunkSize,
5773  beginOffset,
5774  endOffset,
5775  priority,
5776  mode
5777  );
5778 
5779  break;
5780  }
5781 
5782  // Handle internal interface schedInInternal
5783  case INT_IF_SCHEDININTERNAL: {
5784  // Make sure there was no data left over.
5785  // That means the buffer size was incorrect.
5786  FW_ASSERT(
5787  _msg.getDeserializeSizeLeft() == 0,
5788  static_cast<FwAssertArgType>(_msg.getDeserializeSizeLeft())
5789  );
5790 
5791  // Call handler function
5793 
5794  break;
5795  }
5796 
5797  default:
5798  return MSG_DISPATCH_ERROR;
5799  }
5800 
5801  return MSG_DISPATCH_OK;
5802  }
5803 
5804  // ----------------------------------------------------------------------
5805  // Calls for messages received on special input ports
5806  // ----------------------------------------------------------------------
5807 
5808  void FileManagerComponentBase ::
5809  m_p_cmdIn_in(
5810  Fw::PassiveComponentBase* callComp,
5811  FwIndexType portNum,
5812  FwOpcodeType opCode,
5813  U32 cmdSeq,
5814  Fw::CmdArgBuffer& args
5815  )
5816  {
5817  FW_ASSERT(callComp != nullptr);
5818  FileManagerComponentBase* compPtr = static_cast<FileManagerComponentBase*>(callComp);
5819  compPtr->cmdIn_handlerBase(
5820  portNum,
5821  opCode,
5822  cmdSeq,
5823  args
5824  );
5825  }
5826 
5827  // ----------------------------------------------------------------------
5828  // Calls for messages received on typed input ports
5829  // ----------------------------------------------------------------------
5830 
5831  void FileManagerComponentBase ::
5832  m_p_pingIn_in(
5833  Fw::PassiveComponentBase* callComp,
5834  FwIndexType portNum,
5835  U32 key
5836  )
5837  {
5838  FW_ASSERT(callComp != nullptr);
5839  FileManagerComponentBase* compPtr = static_cast<FileManagerComponentBase*>(callComp);
5840  compPtr->pingIn_handlerBase(
5841  portNum,
5842  key
5843  );
5844  }
5845 
5846  void FileManagerComponentBase ::
5847  m_p_schedIn_in(
5848  Fw::PassiveComponentBase* callComp,
5849  FwIndexType portNum,
5850  U32 context
5851  )
5852  {
5853  FW_ASSERT(callComp != nullptr);
5854  FileManagerComponentBase* compPtr = static_cast<FileManagerComponentBase*>(callComp);
5855  compPtr->schedIn_handlerBase(
5856  portNum,
5857  context
5858  );
5859  }
5860 
5861 #if !FW_DIRECT_PORT_CALLS
5862 
5863  // ----------------------------------------------------------------------
5864  // Invocation functions for special output ports
5865  // ----------------------------------------------------------------------
5866 
5867 #if FW_ENABLE_TEXT_LOGGING
5868 
5869  void FileManagerComponentBase ::
5870  LogText_out(
5871  FwIndexType portNum,
5872  FwEventIdType id,
5873  Fw::Time& timeTag,
5874  const Fw::LogSeverity& severity,
5875  Fw::TextLogString& text
5876  ) const
5877  {
5878  FW_ASSERT(
5879  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
5880  static_cast<FwAssertArgType>(portNum)
5881  );
5882 
5883  FW_ASSERT(
5884  this->m_LogText_OutputPort[portNum].isConnected(),
5885  static_cast<FwAssertArgType>(portNum)
5886  );
5887  this->m_LogText_OutputPort[portNum].invoke(
5888  id,
5889  timeTag,
5890  severity,
5891  text
5892  );
5893  }
5894 
5895 #endif
5896 
5897  void FileManagerComponentBase ::
5898  cmdRegOut_out(
5899  FwIndexType portNum,
5900  FwOpcodeType opCode
5901  ) const
5902  {
5903  FW_ASSERT(
5904  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
5905  static_cast<FwAssertArgType>(portNum)
5906  );
5907 
5908  FW_ASSERT(
5909  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
5910  static_cast<FwAssertArgType>(portNum)
5911  );
5912  this->m_cmdRegOut_OutputPort[portNum].invoke(
5913  opCode
5914  );
5915  }
5916 
5917  void FileManagerComponentBase ::
5918  cmdResponseOut_out(
5919  FwIndexType portNum,
5920  FwOpcodeType opCode,
5921  U32 cmdSeq,
5922  const Fw::CmdResponse& response
5923  ) const
5924  {
5925  FW_ASSERT(
5926  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
5927  static_cast<FwAssertArgType>(portNum)
5928  );
5929 
5930  FW_ASSERT(
5931  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
5932  static_cast<FwAssertArgType>(portNum)
5933  );
5934  this->m_cmdResponseOut_OutputPort[portNum].invoke(
5935  opCode,
5936  cmdSeq,
5937  response
5938  );
5939  }
5940 
5941  void FileManagerComponentBase ::
5942  eventOut_out(
5943  FwIndexType portNum,
5944  FwEventIdType id,
5945  Fw::Time& timeTag,
5946  const Fw::LogSeverity& severity,
5947  Fw::LogBuffer& args
5948  ) const
5949  {
5950  FW_ASSERT(
5951  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
5952  static_cast<FwAssertArgType>(portNum)
5953  );
5954 
5955  FW_ASSERT(
5956  this->m_eventOut_OutputPort[portNum].isConnected(),
5957  static_cast<FwAssertArgType>(portNum)
5958  );
5959  this->m_eventOut_OutputPort[portNum].invoke(
5960  id,
5961  timeTag,
5962  severity,
5963  args
5964  );
5965  }
5966 
5967  Fw::Success FileManagerComponentBase ::
5968  productGetOut_out(
5969  FwIndexType portNum,
5970  FwDpIdType id,
5971  FwSizeType dataSize,
5972  Fw::Buffer& buffer
5973  ) const
5974  {
5975  FW_ASSERT(
5976  (0 <= portNum) && (portNum < this->getNum_productGetOut_OutputPorts()),
5977  static_cast<FwAssertArgType>(portNum)
5978  );
5979 
5980  FW_ASSERT(
5981  this->m_productGetOut_OutputPort[portNum].isConnected(),
5982  static_cast<FwAssertArgType>(portNum)
5983  );
5984  return this->m_productGetOut_OutputPort[portNum].invoke(
5985  id,
5986  dataSize,
5987  buffer
5988  );
5989  }
5990 
5991  void FileManagerComponentBase ::
5992  productSendOut_out(
5993  FwIndexType portNum,
5994  FwDpIdType id,
5995  const Fw::Buffer& buffer
5996  ) const
5997  {
5998  FW_ASSERT(
5999  (0 <= portNum) && (portNum < this->getNum_productSendOut_OutputPorts()),
6000  static_cast<FwAssertArgType>(portNum)
6001  );
6002 
6003  FW_ASSERT(
6004  this->m_productSendOut_OutputPort[portNum].isConnected(),
6005  static_cast<FwAssertArgType>(portNum)
6006  );
6007  this->m_productSendOut_OutputPort[portNum].invoke(
6008  id,
6009  buffer
6010  );
6011  }
6012 
6013  void FileManagerComponentBase ::
6014  timeCaller_out(
6015  FwIndexType portNum,
6016  Fw::Time& time
6017  ) const
6018  {
6019  FW_ASSERT(
6020  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
6021  static_cast<FwAssertArgType>(portNum)
6022  );
6023 
6024  FW_ASSERT(
6025  this->m_timeCaller_OutputPort[portNum].isConnected(),
6026  static_cast<FwAssertArgType>(portNum)
6027  );
6028  this->m_timeCaller_OutputPort[portNum].invoke(
6029  time
6030  );
6031  }
6032 
6033  void FileManagerComponentBase ::
6034  tlmOut_out(
6035  FwIndexType portNum,
6036  FwChanIdType id,
6037  Fw::Time& timeTag,
6038  Fw::TlmBuffer& val
6039  ) const
6040  {
6041  FW_ASSERT(
6042  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
6043  static_cast<FwAssertArgType>(portNum)
6044  );
6045 
6046  FW_ASSERT(
6047  this->m_tlmOut_OutputPort[portNum].isConnected(),
6048  static_cast<FwAssertArgType>(portNum)
6049  );
6050  this->m_tlmOut_OutputPort[portNum].invoke(
6051  id,
6052  timeTag,
6053  val
6054  );
6055  }
6056 
6057 #endif
6058 
6059  // ----------------------------------------------------------------------
6060  // Private data product handling functions
6061  // ----------------------------------------------------------------------
6062 
6063  Fw::Success::T FileManagerComponentBase ::
6064  dpGet(
6065  ContainerId::T containerId,
6066  FwSizeType dataSize,
6067  FwDpPriorityType priority,
6068  DpContainer& container
6069  )
6070  {
6071  const FwDpIdType baseId = this->getIdBase();
6072  const FwDpIdType globalId = baseId + containerId;
6073  const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize);
6074  Fw::Buffer buffer;
6075  const Fw::Success::T status = this->productGetOut_out(0, globalId, size, buffer);
6076  if (status == Fw::Success::SUCCESS) {
6077  // Assign a fresh DpContainer into container
6078  // This action clears out all the container state
6079  container = DpContainer(globalId, buffer, baseId);
6080  container.setPriority(priority);
6081  }
6082  return status;
6083  }
6084 
6085 }
bool isConnected_productSendOut_OutputPort(FwIndexType portNum) const
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
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
void log_WARNING_HI_ListDirectoryError(const Fw::StringBase &dirName, U32 status) const
void AppendFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void log_ACTIVITY_HI_DirectoryListingSubdir(const Fw::StringBase &dirName, const Fw::StringBase &subdirName) const
void setTimeTag(Fw::Time timeTag)
Set the time tag.
void log_ACTIVITY_HI_CreateDirectoryStarted(const Fw::StringBase &dirName) const
An error occurred while attempting to create a directory.
FwIdType FwOpcodeType
The type of a command opcode.
Operation succeeded.
Definition: Os.hpp:27
virtual void ListDirectory_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command ListDirectory.
void log_ACTIVITY_HI_RemoveDirectorySucceeded(const Fw::StringBase &dirName) const
void init()
Initialization function.
void log_ACTIVITY_HI_DirectoryListing(const Fw::StringBase &dirName, const Fw::StringBase &fileName, FwSizeType fileSize) const
A command path argument was rejected by the configured sandbox directory.
Representing success.
virtual void MoveFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &sourceFileName, const Fw::CmdStringArg &destFileName)=0
PlatformSizeType FwSizeType
virtual void MoveFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command MoveFile.
Invalid offset range requested for data product generation.
U32 FwDpPriorityType
The type of a data product priority.
void log_ACTIVITY_HI_CalculateCrcStarted(const Fw::StringBase &fileName) const
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
void addCallPort(InputDpSendPort *callPort)
Register an input port.
Metadata for one chunk of a file data product.
void setSize(FwSizeType size)
Definition: Buffer.cpp:131
virtual void CalculateCrc_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &filename)=0
Status
status returned from the queue send function
Definition: Queue.hpp:30
void log_WARNING_HI_FileSizeError(const Fw::StringBase &fileName, U32 status) const
The File System component deleted an existing file without error.
FwSizeType serializedSize() const
Get the dynamic serialized size of the struct.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
void init()
Initialization function.
Definition: SchedPortAc.cpp:73
void log_ACTIVITY_HI_GenerateDpStarted(const Fw::StringBase &fileName, U64 bytesToWrite) const
BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY]
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
void FileSize_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
static constexpr FwIndexType getNum_productGetOut_OutputPorts()
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
void log_ACTIVITY_HI_FileSizeSucceeded(const Fw::StringBase &fileName, FwSizeType size) const
virtual void RemoveFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, bool ignoreErrors)=0
void log_ACTIVITY_HI_ListDirectorySucceeded(const Fw::StringBase &dirName, U32 fileCount) const
void cmdIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port cmdIn.
The File System component began creating a new directory.
No room left in the buffer to serialize data.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
void invoke(U32 key) const
Invoke a port connection.
Definition: PingPortAc.cpp:170
bool isConnected_productGetOut_OutputPort(FwIndexType portNum) const
void log_ACTIVITY_HI_CalculateCrcSucceeded(const Fw::StringBase &fileName, U32 crc) const
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
void CalculateCrc_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
const Time ZERO_TIME
Definition: Time.cpp:5
void log_ACTIVITY_HI_ListDirectoryStarted(const Fw::StringBase &dirName) const
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_pingOut_OutputPorts()
static constexpr FwIndexType getNum_productSendOut_OutputPorts()
void init()
Initialization function.
Definition: TlmPortAc.cpp:171
Enum representing a command response.
virtual void RemoveFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RemoveFile.
virtual void schedIn_handler(FwIndexType portNum, U32 context)=0
Handler for input port schedIn.
No time base has been established (Required)
void log_ACTIVITY_HI_MoveFileStarted(const Fw::StringBase &sourceFileName, const Fw::StringBase &destFileName) const
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
void log_WARNING_HI_GenerateDpInvalidRange(const Fw::StringBase &fileName, U64 beginOffset, U64 endOffset, U64 fileSize) const
FPP shadow-enum representing Fw::FormatStatus.
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
DpContainer()
Constructor with default initialization.
virtual void schedInInternal_internalInterfaceHandler()=0
Internal interface handler for schedInInternal.
static constexpr FwIndexType getNum_eventOut_OutputPorts()
Os::Queue m_queue
queue object for active component
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
void log_ACTIVITY_HI_AppendFileSucceeded(const Fw::StringBase &source, const Fw::StringBase &target) const
FileManagerComponentBase(const char *compName="")
Construct FileManagerComponentBase object.
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:177
void ListDirectory_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
The File System component began deleting an existing file.
void init()
Object initializer.
Definition: ObjBase.cpp:24
message to exit active component task
void log_WARNING_HI_PathOutsideSandbox(const Fw::StringBase &path, const Fw::StringBase &sandboxDir) const
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
The File System component moved a file to a new location without error.
void log_WARNING_HI_GenerateDpBufferFailed(const Fw::StringBase &fileName) const
void log_ACTIVITY_HI_CreateDirectorySucceeded(const Fw::StringBase &dirName) const
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
FwIdType FwEventIdType
The type of an event identifier.
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
static constexpr FwSizeType CAPACITY
Definition: PingPortAc.hpp:34
void log_WARNING_HI_GenerateDpFailed(const Fw::StringBase &fileName, const Svc::FileManager_GenerateDpStage &stage, U32 status) const
virtual void CreateDirectory_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &dirName)=0
virtual void ListDirectory_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &dirName)=0
#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 RemoveFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void init()
Initialization function.
Definition: TimePortAc.cpp:151
An error occurred while attempting to remove a file.
void log_ACTIVITY_HI_RemoveDirectoryStarted(const Fw::StringBase &dirName) const
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
void RemoveDirectory_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
#define FW_MIN(a, b)
MIN macro (deprecated in C++, use std::min)
Definition: BasicTypes.h:99
Omit length from serialization.
The File System component began deleting a directory.
ActiveComponentBase(const char *name)
Constructor.
void init()
Initialization function.
Definition: PingPortAc.cpp:151
static constexpr FwIndexType getNum_schedIn_InputPorts()
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
virtual void FileSize_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command FileSize.
void invalidateBuffer()
Invalidate the packet buffer.
T
The raw enum type.
FwIdType FwChanIdType
The type of a telemetry channel identifier.
Append 1 file&#39;s contents to the end of another.
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
The File System component began moving a file to a new location.
void schedInInternal_internalInterfaceInvoke()
Internal interface base-class function for schedInInternal.
virtual void CreateDirectory_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CreateDirectory.
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
A serious but recoverable event.
FwSizeType FwSizeStoreType
Svc::InputSchedPort * get_schedIn_InputPort(FwIndexType portNum)
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
virtual void schedInInternal_overflowHook()=0
Overflow hook for async input port schedInInternal.
static constexpr FwSizeType getPacketSizeForDataSize(FwSizeType dataSize)
Get the packet size for a given data size.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
Definition: TlmPortAc.cpp:190
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
void log_ACTIVITY_HI_FileSizeStarted(const Fw::StringBase &fileName) const
void log_WARNING_HI_FileNameFormatError(const Fw::StringBase &fileName, const Fw::StringFormatStatus &status) const
Enum representing event severity.
virtual ~FileManagerComponentBase()
Destroy FileManagerComponentBase object.
FwSizeType getPacketSize() const
Get the packet size corresponding to the data size.
Fw::Buffer getBuffer() const
#define PRI_FwIndexType
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
void init()
Initialization function.
Definition: LogPortAc.cpp:180
void MoveFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Fw::SerializeStatus serializeRecord_FileChunkHeaderRecord(const Svc::FileManager_FileChunkHeader &elt)
void log_ACTIVITY_HI_GenerateDpComplete(const Fw::StringBase &fileName, U32 chunks) const
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
void schedIn_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port schedIn.
BlockingType
message type
Definition: Queue.hpp:46
virtual void FileSize_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName)=0
void log_ACTIVITY_HI_MoveFileSucceeded(const Fw::StringBase &sourceFileName, const Fw::StringBase &destFileName) const
FwSizeType getSize() const
Definition: Buffer.cpp:90
Command failed to deserialize.
void log_WARNING_HI_DirectoryRemoveError(const Fw::StringBase &dirName, U32 status) const
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Important informational events.
FwIdType FwDpIdType
The type of a data product identifier.
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
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
void GenerateDp_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void log_ACTIVITY_HI_AppendFileStarted(const Fw::StringBase &source, const Fw::StringBase &target) const
bool isConnected_eventOut_OutputPort(FwIndexType portNum) const
void tlmWrite_Errors(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
A message was sent requesting an exit of the loop.
void log_ACTIVITY_HI_RemoveFileStarted(const Fw::StringBase &fileName) const
Fw::Success invoke(FwDpIdType id, FwSizeType dataSize, Fw::Buffer &buffer) const
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
virtual void GenerateDp_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, U32 chunkSize, U64 beginOffset, U64 endOffset, U32 priority, const Svc::FileManager_GenerateDpMode &mode)=0
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
How the chunks of a file are emitted.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
PlatformIndexType FwIndexType
The File System component created a new directory without error.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void serializeHeader()
Definition: DpContainer.cpp:89
void addCallPort(InputDpGetPort *callPort)
Register an input port.
The File System component deleted and existing directory without error.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
Where a data product generation failure occurred.
static constexpr FwIndexType getNum_pingIn_InputPorts()
void init()
Initialization function.
void log_WARNING_HI_AppendFileFailed(const Fw::StringBase &source, const Fw::StringBase &target, U32 status) const
void incNumMsgDropped()
increment the number of messages dropped
void regCommands()
Register commands with the Command Dispatcher.
void init()
Initialization function.
Definition: PingPortAc.cpp:73
void set_productSendOut_OutputPort(FwIndexType portNum, Fw::InputDpSendPort *port)
Connect port to productSendOut[portNum].
static constexpr FwIndexType getNum_cmdIn_InputPorts()
An error occurred while attempting to remove a directory.
RateGroupDivider component implementation.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
message sent/received okay
Definition: Queue.hpp:31
U8 BYTE
byte type
Definition: BasicTypes.h:57
void log_WARNING_HI_CalculateCrcFailed(const Fw::StringBase &fileName, U32 status) const
virtual void AppendFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command AppendFile.
Fw::SerializeStatus serializeRecord_FileChunkDataRecord(const U8 *array, FwSizeType size)
virtual void GenerateDp_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command GenerateDp.
The File System component appended 2 files without error.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:79
An error occurred while attempting to move a file.
FwDpIdType getId() const
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
virtual void RemoveDirectory_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RemoveDirectory.
void init()
Initialization function.
The File System component returned status non-zero when trying to append 2 files together.
void log_WARNING_HI_DirectoryCreateError(const Fw::StringBase &dirName, U32 status) const
void set_productGetOut_OutputPort(FwIndexType portNum, Fw::InputDpGetPort *port)
Connect port to productGetOut[portNum].
void log_ACTIVITY_HI_RemoveFileSucceeded(const Fw::StringBase &fileName) const
void log_WARNING_HI_FileMoveError(const Fw::StringBase &sourceFileName, const Fw::StringBase &destFileName, U32 status) const
void invoke(FwDpIdType id, const Fw::Buffer &buffer) const
Invoke a port connection.
void tlmWrite_CommandsExecuted(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void CreateDirectory_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void init()
Initialization function.
Success/Failure.
virtual void RemoveDirectory_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &dirName)=0
void log_WARNING_HI_FileRemoveError(const Fw::StringBase &fileName, U32 status) const
The size of the serial representation.
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
void dpSend(DpContainer &container, Fw::Time timeTag=Fw::ZERO_TIME)
Send a data product.
virtual void CalculateCrc_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CalculateCrc.
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
The File System component appended 2 files without error.
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.
BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY]
virtual void AppendFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &source, const Fw::CmdStringArg &target)=0