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  INT_IF_RUN,
29  };
30 
31  // Get the max size by constructing a union of the async input, command, and
32  // internal port serialization sizes
33  union BuffUnion {
34  BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY];
35  BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY];
36  };
37 
38  // Define a message buffer class large enough to handle all the
39  // asynchronous inputs to the component
40  class ComponentIpcSerializableBuffer :
42  {
43 
44  public:
45 
46  enum {
47  // Offset into data in buffer: Size of message ID and port number
48  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
49  // Max data size
50  MAX_DATA_SIZE = sizeof(BuffUnion),
51  // Max message size: Size of message id + size of port + max data size
52  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
53  };
54 
55  Fw::Serializable::SizeType getCapacity() const {
56  return sizeof(m_buff);
57  }
58 
59  U8* getBuffAddr() {
60  return m_buff;
61  }
62 
63  const U8* getBuffAddr() const {
64  return m_buff;
65  }
66 
67  private:
68  // Should be the max of all the input ports serialized sizes...
69  U8 m_buff[SERIALIZATION_SIZE];
70 
71  };
72  }
73 
74  // ----------------------------------------------------------------------
75  // Component initialization
76  // ----------------------------------------------------------------------
77 
80  FwSizeType queueDepth,
81  FwEnumStoreType instance
82  )
83  {
84  // Initialize base class
86 
87 #if !FW_DIRECT_PORT_CALLS
88  // Connect input port cmdIn
89  for (
90  FwIndexType port = 0;
91  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
92  port++
93  ) {
94  this->m_cmdIn_InputPort[port].init();
95  this->m_cmdIn_InputPort[port].addCallComp(
96  this,
97  m_p_cmdIn_in
98  );
99  this->m_cmdIn_InputPort[port].setPortNum(port);
100 
101 #if FW_OBJECT_NAMES == 1
102  Fw::ObjectName portName;
103  portName.format(
104  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
105  this->m_objName.toChar(),
106  port
107  );
108  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
109 #endif
110  }
111 #endif
112 
113 #if !FW_DIRECT_PORT_CALLS
114  // Connect input port pingIn
115  for (
116  FwIndexType port = 0;
117  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
118  port++
119  ) {
120  this->m_pingIn_InputPort[port].init();
121  this->m_pingIn_InputPort[port].addCallComp(
122  this,
123  m_p_pingIn_in
124  );
125  this->m_pingIn_InputPort[port].setPortNum(port);
126 
127 #if FW_OBJECT_NAMES == 1
128  Fw::ObjectName portName;
129  portName.format(
130  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
131  this->m_objName.toChar(),
132  port
133  );
134  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
135 #endif
136  }
137 #endif
138 
139 #if !FW_DIRECT_PORT_CALLS
140  // Connect input port schedIn
141  for (
142  FwIndexType port = 0;
143  port < static_cast<FwIndexType>(this->getNum_schedIn_InputPorts());
144  port++
145  ) {
146  this->m_schedIn_InputPort[port].init();
147  this->m_schedIn_InputPort[port].addCallComp(
148  this,
149  m_p_schedIn_in
150  );
151  this->m_schedIn_InputPort[port].setPortNum(port);
152 
153 #if FW_OBJECT_NAMES == 1
154  Fw::ObjectName portName;
155  portName.format(
156  "%s_schedIn_InputPort[%" PRI_FwIndexType "]",
157  this->m_objName.toChar(),
158  port
159  );
160  this->m_schedIn_InputPort[port].setObjName(portName.toChar());
161 #endif
162  }
163 #endif
164 
165 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
166  // Connect output port LogText
167  for (
168  FwIndexType port = 0;
169  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
170  port++
171  ) {
172  this->m_LogText_OutputPort[port].init();
173 
174 #if FW_OBJECT_NAMES == 1
175  Fw::ObjectName portName;
176  portName.format(
177  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
178  this->m_objName.toChar(),
179  port
180  );
181  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
182 #endif
183  }
184 #endif
185 
186 #if !FW_DIRECT_PORT_CALLS
187  // Connect output port cmdRegOut
188  for (
189  FwIndexType port = 0;
190  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
191  port++
192  ) {
193  this->m_cmdRegOut_OutputPort[port].init();
194 
195 #if FW_OBJECT_NAMES == 1
196  Fw::ObjectName portName;
197  portName.format(
198  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
199  this->m_objName.toChar(),
200  port
201  );
202  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
203 #endif
204  }
205 #endif
206 
207 #if !FW_DIRECT_PORT_CALLS
208  // Connect output port cmdResponseOut
209  for (
210  FwIndexType port = 0;
211  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
212  port++
213  ) {
214  this->m_cmdResponseOut_OutputPort[port].init();
215 
216 #if FW_OBJECT_NAMES == 1
217  Fw::ObjectName portName;
218  portName.format(
219  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
220  this->m_objName.toChar(),
221  port
222  );
223  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
224 #endif
225  }
226 #endif
227 
228 #if !FW_DIRECT_PORT_CALLS
229  // Connect output port eventOut
230  for (
231  FwIndexType port = 0;
232  port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
233  port++
234  ) {
235  this->m_eventOut_OutputPort[port].init();
236 
237 #if FW_OBJECT_NAMES == 1
238  Fw::ObjectName portName;
239  portName.format(
240  "%s_eventOut_OutputPort[%" PRI_FwIndexType "]",
241  this->m_objName.toChar(),
242  port
243  );
244  this->m_eventOut_OutputPort[port].setObjName(portName.toChar());
245 #endif
246  }
247 #endif
248 
249 #if !FW_DIRECT_PORT_CALLS
250  // Connect output port timeCaller
251  for (
252  FwIndexType port = 0;
253  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
254  port++
255  ) {
256  this->m_timeCaller_OutputPort[port].init();
257 
258 #if FW_OBJECT_NAMES == 1
259  Fw::ObjectName portName;
260  portName.format(
261  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
262  this->m_objName.toChar(),
263  port
264  );
265  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
266 #endif
267  }
268 #endif
269 
270 #if !FW_DIRECT_PORT_CALLS
271  // Connect output port tlmOut
272  for (
273  FwIndexType port = 0;
274  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
275  port++
276  ) {
277  this->m_tlmOut_OutputPort[port].init();
278 
279 #if FW_OBJECT_NAMES == 1
280  Fw::ObjectName portName;
281  portName.format(
282  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
283  this->m_objName.toChar(),
284  port
285  );
286  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
287 #endif
288  }
289 #endif
290 
291 #if !FW_DIRECT_PORT_CALLS
292  // Connect output port pingOut
293  for (
294  FwIndexType port = 0;
295  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
296  port++
297  ) {
298  this->m_pingOut_OutputPort[port].init();
299 
300 #if FW_OBJECT_NAMES == 1
301  Fw::ObjectName portName;
302  portName.format(
303  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
304  this->m_objName.toChar(),
305  port
306  );
307  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
308 #endif
309  }
310 #endif
311 
312  // Create the queue
313  Os::Queue::Status qStat = this->createQueue(
314  queueDepth,
315  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
316  );
317  FW_ASSERT(
318  Os::Queue::Status::OP_OK == qStat,
319  static_cast<FwAssertArgType>(qStat)
320  );
321  }
322 
323 #if !FW_DIRECT_PORT_CALLS
324 
325  // ----------------------------------------------------------------------
326  // Getters for special input ports
327  // ----------------------------------------------------------------------
328 
331  {
332  FW_ASSERT(
333  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
334  static_cast<FwAssertArgType>(portNum)
335  );
336 
337  return &this->m_cmdIn_InputPort[portNum];
338  }
339 
340 #endif
341 
342 #if !FW_DIRECT_PORT_CALLS
343 
344  // ----------------------------------------------------------------------
345  // Getters for typed input ports
346  // ----------------------------------------------------------------------
347 
350  {
351  FW_ASSERT(
352  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
353  static_cast<FwAssertArgType>(portNum)
354  );
355 
356  return &this->m_pingIn_InputPort[portNum];
357  }
358 
361  {
362  FW_ASSERT(
363  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
364  static_cast<FwAssertArgType>(portNum)
365  );
366 
367  return &this->m_schedIn_InputPort[portNum];
368  }
369 
370 #endif
371 
372 #if !FW_DIRECT_PORT_CALLS
373 
374  // ----------------------------------------------------------------------
375  // Connect input ports to special output ports
376  // ----------------------------------------------------------------------
377 
378 #if FW_ENABLE_TEXT_LOGGING == 1
379 
380  void FileManagerComponentBase ::
381  set_LogText_OutputPort(
382  FwIndexType portNum,
384  )
385  {
386  FW_ASSERT(
387  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
388  static_cast<FwAssertArgType>(portNum)
389  );
390 
391  this->m_LogText_OutputPort[portNum].addCallPort(port);
392  }
393 
394 #endif
395 
398  FwIndexType portNum,
399  Fw::InputCmdRegPort* port
400  )
401  {
402  FW_ASSERT(
403  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
404  static_cast<FwAssertArgType>(portNum)
405  );
406 
407  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
408  }
409 
412  FwIndexType portNum,
414  )
415  {
416  FW_ASSERT(
417  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
418  static_cast<FwAssertArgType>(portNum)
419  );
420 
421  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
422  }
423 
426  FwIndexType portNum,
427  Fw::InputLogPort* port
428  )
429  {
430  FW_ASSERT(
431  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
432  static_cast<FwAssertArgType>(portNum)
433  );
434 
435  this->m_eventOut_OutputPort[portNum].addCallPort(port);
436  }
437 
440  FwIndexType portNum,
441  Fw::InputTimePort* port
442  )
443  {
444  FW_ASSERT(
445  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
446  static_cast<FwAssertArgType>(portNum)
447  );
448 
449  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
450  }
451 
454  FwIndexType portNum,
455  Fw::InputTlmPort* port
456  )
457  {
458  FW_ASSERT(
459  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
460  static_cast<FwAssertArgType>(portNum)
461  );
462 
463  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
464  }
465 
466 #endif
467 
468 #if !FW_DIRECT_PORT_CALLS
469 
470  // ----------------------------------------------------------------------
471  // Connect typed input ports to typed output ports
472  // ----------------------------------------------------------------------
473 
476  FwIndexType portNum,
477  Svc::InputPingPort* port
478  )
479  {
480  FW_ASSERT(
481  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
482  static_cast<FwAssertArgType>(portNum)
483  );
484 
485  this->m_pingOut_OutputPort[portNum].addCallPort(port);
486  }
487 
488 #endif
489 
490 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
491 
492  // ----------------------------------------------------------------------
493  // Connect serial input ports to special output ports
494  // ----------------------------------------------------------------------
495 
496 #if FW_ENABLE_TEXT_LOGGING == 1
497 
498  void FileManagerComponentBase ::
499  set_LogText_OutputPort(
500  FwIndexType portNum,
501  Fw::InputSerializePort* port
502  )
503  {
504  FW_ASSERT(
505  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
506  static_cast<FwAssertArgType>(portNum)
507  );
508 
509  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
510  }
511 
512 #endif
513 
516  FwIndexType portNum,
517  Fw::InputSerializePort* port
518  )
519  {
520  FW_ASSERT(
521  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
522  static_cast<FwAssertArgType>(portNum)
523  );
524 
525  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
526  }
527 
530  FwIndexType portNum,
531  Fw::InputSerializePort* port
532  )
533  {
534  FW_ASSERT(
535  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
536  static_cast<FwAssertArgType>(portNum)
537  );
538 
539  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
540  }
541 
544  FwIndexType portNum,
545  Fw::InputSerializePort* port
546  )
547  {
548  FW_ASSERT(
549  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
550  static_cast<FwAssertArgType>(portNum)
551  );
552 
553  this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
554  }
555 
558  FwIndexType portNum,
559  Fw::InputSerializePort* port
560  )
561  {
562  FW_ASSERT(
563  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
564  static_cast<FwAssertArgType>(portNum)
565  );
566 
567  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
568  }
569 
572  FwIndexType portNum,
573  Fw::InputSerializePort* port
574  )
575  {
576  FW_ASSERT(
577  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
578  static_cast<FwAssertArgType>(portNum)
579  );
580 
581  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
582  }
583 
584 #endif
585 
586 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
587 
588  // ----------------------------------------------------------------------
589  // Connect serial input ports to typed output ports
590  // ----------------------------------------------------------------------
591 
594  FwIndexType portNum,
595  Fw::InputSerializePort* port
596  )
597  {
598  FW_ASSERT(
599  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
600  static_cast<FwAssertArgType>(portNum)
601  );
602 
603  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
604  }
605 
606 #endif
607 
608  // ----------------------------------------------------------------------
609  // Command registration
610  // ----------------------------------------------------------------------
611 
614  {
616 
617  this->cmdRegOut_out(
618  0,
620  );
621 
622  this->cmdRegOut_out(
623  0,
624  this->getIdBase() + OPCODE_MOVEFILE
625  );
626 
627  this->cmdRegOut_out(
628  0,
630  );
631 
632  this->cmdRegOut_out(
633  0,
634  this->getIdBase() + OPCODE_REMOVEFILE
635  );
636 
637  this->cmdRegOut_out(
638  0,
639  this->getIdBase() + OPCODE_APPENDFILE
640  );
641 
642  this->cmdRegOut_out(
643  0,
644  this->getIdBase() + OPCODE_FILESIZE
645  );
646 
647  this->cmdRegOut_out(
648  0,
650  );
651 
652  this->cmdRegOut_out(
653  0,
655  );
656  }
657 
658  // ----------------------------------------------------------------------
659  // Component construction and destruction
660  // ----------------------------------------------------------------------
661 
663  FileManagerComponentBase(const char* compName) :
664  Fw::ActiveComponentBase(compName)
665  {
666 
667  }
668 
671  {
672 
673  }
674 
675 #if !FW_DIRECT_PORT_CALLS
676 
677  // ----------------------------------------------------------------------
678  // Connection status queries for special output ports
679  // ----------------------------------------------------------------------
680 
681 #if FW_ENABLE_TEXT_LOGGING == 1
682 
683  bool FileManagerComponentBase ::
684  isConnected_LogText_OutputPort(FwIndexType portNum) const
685  {
686  FW_ASSERT(
687  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
688  static_cast<FwAssertArgType>(portNum)
689  );
690 
691  return this->m_LogText_OutputPort[portNum].isConnected();
692  }
693 
694 #endif
695 
698  {
699  FW_ASSERT(
700  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
701  static_cast<FwAssertArgType>(portNum)
702  );
703 
704  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
705  }
706 
709  {
710  FW_ASSERT(
711  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
712  static_cast<FwAssertArgType>(portNum)
713  );
714 
715  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
716  }
717 
720  {
721  FW_ASSERT(
722  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
723  static_cast<FwAssertArgType>(portNum)
724  );
725 
726  return this->m_eventOut_OutputPort[portNum].isConnected();
727  }
728 
731  {
732  FW_ASSERT(
733  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
734  static_cast<FwAssertArgType>(portNum)
735  );
736 
737  return this->m_timeCaller_OutputPort[portNum].isConnected();
738  }
739 
742  {
743  FW_ASSERT(
744  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
745  static_cast<FwAssertArgType>(portNum)
746  );
747 
748  return this->m_tlmOut_OutputPort[portNum].isConnected();
749  }
750 
751 #endif
752 
753 #if !FW_DIRECT_PORT_CALLS
754 
755  // ----------------------------------------------------------------------
756  // Connection status queries for typed output ports
757  // ----------------------------------------------------------------------
758 
761  {
762  FW_ASSERT(
763  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
764  static_cast<FwAssertArgType>(portNum)
765  );
766 
767  return this->m_pingOut_OutputPort[portNum].isConnected();
768  }
769 
770 #endif
771 
772  // ----------------------------------------------------------------------
773  // Port handler base-class functions for special input ports
774  //
775  // Call these functions directly to bypass the corresponding ports
776  // ----------------------------------------------------------------------
777 
780  FwIndexType portNum,
781  FwOpcodeType opCode,
782  U32 cmdSeq,
783  Fw::CmdArgBuffer& args
784  )
785  {
786 
787  const U32 idBase = this->getIdBase();
788  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
789 
790  // Select base class function based on opcode
791  switch (opCode - idBase) {
792  case OPCODE_CREATEDIRECTORY: {
794  opCode,
795  cmdSeq,
796  args
797  );
798  break;
799  }
800 
801  case OPCODE_MOVEFILE: {
803  opCode,
804  cmdSeq,
805  args
806  );
807  break;
808  }
809 
810  case OPCODE_REMOVEDIRECTORY: {
812  opCode,
813  cmdSeq,
814  args
815  );
816  break;
817  }
818 
819  case OPCODE_REMOVEFILE: {
821  opCode,
822  cmdSeq,
823  args
824  );
825  break;
826  }
827 
828  case OPCODE_APPENDFILE: {
830  opCode,
831  cmdSeq,
832  args
833  );
834  break;
835  }
836 
837  case OPCODE_FILESIZE: {
839  opCode,
840  cmdSeq,
841  args
842  );
843  break;
844  }
845 
846  case OPCODE_LISTDIRECTORY: {
848  opCode,
849  cmdSeq,
850  args
851  );
852  break;
853  }
854 
855  case OPCODE_CALCULATECRC: {
857  opCode,
858  cmdSeq,
859  args
860  );
861  break;
862  }
863  default:
864  // Unknown opcode: ignore it
865  break;
866  }
867  }
868 
869  // ----------------------------------------------------------------------
870  // Port handler base-class functions for typed input ports
871  //
872  // Call these functions directly to bypass the corresponding ports
873  // ----------------------------------------------------------------------
874 
877  FwIndexType portNum,
878  U32 key
879  )
880  {
881  // Make sure port number is valid
882  FW_ASSERT(
883  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
884  static_cast<FwAssertArgType>(portNum)
885  );
886 
887  // Call pre-message hook
889  portNum,
890  key
891  );
892  ComponentIpcSerializableBuffer msg;
894 
895  // Serialize message ID
896  _status = msg.serializeFrom(
897  static_cast<FwEnumStoreType>(PINGIN_PING)
898  );
899  FW_ASSERT(
900  _status == Fw::FW_SERIALIZE_OK,
901  static_cast<FwAssertArgType>(_status)
902  );
903 
904  // Serialize port number
905  _status = msg.serializeFrom(portNum);
906  FW_ASSERT(
907  _status == Fw::FW_SERIALIZE_OK,
908  static_cast<FwAssertArgType>(_status)
909  );
910 
911  // Serialize argument key
912  _status = msg.serializeFrom(key);
913  FW_ASSERT(
914  _status == Fw::FW_SERIALIZE_OK,
915  static_cast<FwAssertArgType>(_status)
916  );
917 
918  // Send message
920  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
921 
922  FW_ASSERT(
923  qStatus == Os::Queue::OP_OK,
924  static_cast<FwAssertArgType>(qStatus)
925  );
926  }
927 
930  FwIndexType portNum,
931  U32 context
932  )
933  {
934  // Make sure port number is valid
935  FW_ASSERT(
936  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
937  static_cast<FwAssertArgType>(portNum)
938  );
939 
940  // Call handler function
941  this->schedIn_handler(
942  portNum,
943  context
944  );
945  }
946 
947  // ----------------------------------------------------------------------
948  // Pre-message hooks for typed async input ports
949  //
950  // Each of these functions is invoked just before processing a message
951  // on the corresponding port. By default, they do nothing. You can
952  // override them to provide specific pre-message behavior.
953  // ----------------------------------------------------------------------
954 
957  FwIndexType portNum,
958  U32 key
959  )
960  {
961  // Default: no-op
962  }
963 
964 #if !FW_DIRECT_PORT_CALLS
965 
966  // ----------------------------------------------------------------------
967  // Invocation functions for typed output ports
968  // ----------------------------------------------------------------------
969 
972  FwIndexType portNum,
973  U32 key
974  ) const
975  {
976  FW_ASSERT(
977  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
978  static_cast<FwAssertArgType>(portNum)
979  );
980 
981  FW_ASSERT(
982  this->m_pingOut_OutputPort[portNum].isConnected(),
983  static_cast<FwAssertArgType>(portNum)
984  );
985  this->m_pingOut_OutputPort[portNum].invoke(
986  key
987  );
988  }
989 
990 #endif
991 
992  // ----------------------------------------------------------------------
993  // Internal interface base-class functions
994  // ----------------------------------------------------------------------
995 
998  {
999  ComponentIpcSerializableBuffer msg;
1001 
1002  // Serialize the message ID
1003  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(INT_IF_RUN));
1004  FW_ASSERT (
1005  _status == Fw::FW_SERIALIZE_OK,
1006  static_cast<FwAssertArgType>(_status)
1007  );
1008 
1009  // Fake port number to make message dequeue work
1010  _status = msg.serializeFrom(static_cast<FwIndexType>(0));
1011  FW_ASSERT (
1012  _status == Fw::FW_SERIALIZE_OK,
1013  static_cast<FwAssertArgType>(_status)
1014  );
1015 
1016  // Send message
1018  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1019 
1020  if (qStatus == Os::Queue::Status::FULL) {
1021  this->incNumMsgDropped();
1022  return;
1023  }
1024 
1025  FW_ASSERT(
1026  qStatus == Os::Queue::OP_OK,
1027  static_cast<FwAssertArgType>(qStatus)
1028  );
1029  }
1030 
1031  // ----------------------------------------------------------------------
1032  // Command response
1033  // ----------------------------------------------------------------------
1034 
1037  FwOpcodeType opCode,
1038  U32 cmdSeq,
1039  Fw::CmdResponse response
1040  )
1041  {
1043  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
1044  }
1045 
1046  // ----------------------------------------------------------------------
1047  // Command handler base-class functions
1048  //
1049  // Call these functions directly to bypass the command input port
1050  // ----------------------------------------------------------------------
1051 
1054  FwOpcodeType opCode,
1055  U32 cmdSeq,
1056  Fw::CmdArgBuffer& args
1057  )
1058  {
1059  // Call pre-message hook
1060  this->CreateDirectory_preMsgHook(opCode,cmdSeq);
1061 
1062  // Defer deserializing arguments to the message dispatcher
1063  // to avoid deserializing and reserializing just for IPC
1064  ComponentIpcSerializableBuffer msg;
1066 
1067  // Serialize for IPC
1068  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CREATEDIRECTORY));
1069  FW_ASSERT (
1070  _status == Fw::FW_SERIALIZE_OK,
1071  static_cast<FwAssertArgType>(_status)
1072  );
1073 
1074  // Fake port number to make message dequeue work
1075  FwIndexType port = 0;
1076 
1077  _status = msg.serializeFrom(port);
1078  FW_ASSERT (
1079  _status == Fw::FW_SERIALIZE_OK,
1080  static_cast<FwAssertArgType>(_status)
1081  );
1082 
1083  _status = msg.serializeFrom(opCode);
1084  FW_ASSERT (
1085  _status == Fw::FW_SERIALIZE_OK,
1086  static_cast<FwAssertArgType>(_status)
1087  );
1088 
1089  _status = msg.serializeFrom(cmdSeq);
1090  FW_ASSERT (
1091  _status == Fw::FW_SERIALIZE_OK,
1092  static_cast<FwAssertArgType>(_status)
1093  );
1094 
1095  _status = msg.serializeFrom(args);
1096  FW_ASSERT (
1097  _status == Fw::FW_SERIALIZE_OK,
1098  static_cast<FwAssertArgType>(_status)
1099  );
1100 
1101  // Send message
1103  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1104 
1105  FW_ASSERT(
1106  qStatus == Os::Queue::OP_OK,
1107  static_cast<FwAssertArgType>(qStatus)
1108  );
1109  }
1110 
1113  FwOpcodeType opCode,
1114  U32 cmdSeq,
1115  Fw::CmdArgBuffer& args
1116  )
1117  {
1118  // Call pre-message hook
1119  this->MoveFile_preMsgHook(opCode,cmdSeq);
1120 
1121  // Defer deserializing arguments to the message dispatcher
1122  // to avoid deserializing and reserializing just for IPC
1123  ComponentIpcSerializableBuffer msg;
1125 
1126  // Serialize for IPC
1127  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_MOVEFILE));
1128  FW_ASSERT (
1129  _status == Fw::FW_SERIALIZE_OK,
1130  static_cast<FwAssertArgType>(_status)
1131  );
1132 
1133  // Fake port number to make message dequeue work
1134  FwIndexType port = 0;
1135 
1136  _status = msg.serializeFrom(port);
1137  FW_ASSERT (
1138  _status == Fw::FW_SERIALIZE_OK,
1139  static_cast<FwAssertArgType>(_status)
1140  );
1141 
1142  _status = msg.serializeFrom(opCode);
1143  FW_ASSERT (
1144  _status == Fw::FW_SERIALIZE_OK,
1145  static_cast<FwAssertArgType>(_status)
1146  );
1147 
1148  _status = msg.serializeFrom(cmdSeq);
1149  FW_ASSERT (
1150  _status == Fw::FW_SERIALIZE_OK,
1151  static_cast<FwAssertArgType>(_status)
1152  );
1153 
1154  _status = msg.serializeFrom(args);
1155  FW_ASSERT (
1156  _status == Fw::FW_SERIALIZE_OK,
1157  static_cast<FwAssertArgType>(_status)
1158  );
1159 
1160  // Send message
1162  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1163 
1164  FW_ASSERT(
1165  qStatus == Os::Queue::OP_OK,
1166  static_cast<FwAssertArgType>(qStatus)
1167  );
1168  }
1169 
1172  FwOpcodeType opCode,
1173  U32 cmdSeq,
1174  Fw::CmdArgBuffer& args
1175  )
1176  {
1177  // Call pre-message hook
1178  this->RemoveDirectory_preMsgHook(opCode,cmdSeq);
1179 
1180  // Defer deserializing arguments to the message dispatcher
1181  // to avoid deserializing and reserializing just for IPC
1182  ComponentIpcSerializableBuffer msg;
1184 
1185  // Serialize for IPC
1186  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_REMOVEDIRECTORY));
1187  FW_ASSERT (
1188  _status == Fw::FW_SERIALIZE_OK,
1189  static_cast<FwAssertArgType>(_status)
1190  );
1191 
1192  // Fake port number to make message dequeue work
1193  FwIndexType port = 0;
1194 
1195  _status = msg.serializeFrom(port);
1196  FW_ASSERT (
1197  _status == Fw::FW_SERIALIZE_OK,
1198  static_cast<FwAssertArgType>(_status)
1199  );
1200 
1201  _status = msg.serializeFrom(opCode);
1202  FW_ASSERT (
1203  _status == Fw::FW_SERIALIZE_OK,
1204  static_cast<FwAssertArgType>(_status)
1205  );
1206 
1207  _status = msg.serializeFrom(cmdSeq);
1208  FW_ASSERT (
1209  _status == Fw::FW_SERIALIZE_OK,
1210  static_cast<FwAssertArgType>(_status)
1211  );
1212 
1213  _status = msg.serializeFrom(args);
1214  FW_ASSERT (
1215  _status == Fw::FW_SERIALIZE_OK,
1216  static_cast<FwAssertArgType>(_status)
1217  );
1218 
1219  // Send message
1221  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1222 
1223  FW_ASSERT(
1224  qStatus == Os::Queue::OP_OK,
1225  static_cast<FwAssertArgType>(qStatus)
1226  );
1227  }
1228 
1231  FwOpcodeType opCode,
1232  U32 cmdSeq,
1233  Fw::CmdArgBuffer& args
1234  )
1235  {
1236  // Call pre-message hook
1237  this->RemoveFile_preMsgHook(opCode,cmdSeq);
1238 
1239  // Defer deserializing arguments to the message dispatcher
1240  // to avoid deserializing and reserializing just for IPC
1241  ComponentIpcSerializableBuffer msg;
1243 
1244  // Serialize for IPC
1245  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_REMOVEFILE));
1246  FW_ASSERT (
1247  _status == Fw::FW_SERIALIZE_OK,
1248  static_cast<FwAssertArgType>(_status)
1249  );
1250 
1251  // Fake port number to make message dequeue work
1252  FwIndexType port = 0;
1253 
1254  _status = msg.serializeFrom(port);
1255  FW_ASSERT (
1256  _status == Fw::FW_SERIALIZE_OK,
1257  static_cast<FwAssertArgType>(_status)
1258  );
1259 
1260  _status = msg.serializeFrom(opCode);
1261  FW_ASSERT (
1262  _status == Fw::FW_SERIALIZE_OK,
1263  static_cast<FwAssertArgType>(_status)
1264  );
1265 
1266  _status = msg.serializeFrom(cmdSeq);
1267  FW_ASSERT (
1268  _status == Fw::FW_SERIALIZE_OK,
1269  static_cast<FwAssertArgType>(_status)
1270  );
1271 
1272  _status = msg.serializeFrom(args);
1273  FW_ASSERT (
1274  _status == Fw::FW_SERIALIZE_OK,
1275  static_cast<FwAssertArgType>(_status)
1276  );
1277 
1278  // Send message
1280  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1281 
1282  FW_ASSERT(
1283  qStatus == Os::Queue::OP_OK,
1284  static_cast<FwAssertArgType>(qStatus)
1285  );
1286  }
1287 
1290  FwOpcodeType opCode,
1291  U32 cmdSeq,
1292  Fw::CmdArgBuffer& args
1293  )
1294  {
1295  // Call pre-message hook
1296  this->AppendFile_preMsgHook(opCode,cmdSeq);
1297 
1298  // Defer deserializing arguments to the message dispatcher
1299  // to avoid deserializing and reserializing just for IPC
1300  ComponentIpcSerializableBuffer msg;
1302 
1303  // Serialize for IPC
1304  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_APPENDFILE));
1305  FW_ASSERT (
1306  _status == Fw::FW_SERIALIZE_OK,
1307  static_cast<FwAssertArgType>(_status)
1308  );
1309 
1310  // Fake port number to make message dequeue work
1311  FwIndexType port = 0;
1312 
1313  _status = msg.serializeFrom(port);
1314  FW_ASSERT (
1315  _status == Fw::FW_SERIALIZE_OK,
1316  static_cast<FwAssertArgType>(_status)
1317  );
1318 
1319  _status = msg.serializeFrom(opCode);
1320  FW_ASSERT (
1321  _status == Fw::FW_SERIALIZE_OK,
1322  static_cast<FwAssertArgType>(_status)
1323  );
1324 
1325  _status = msg.serializeFrom(cmdSeq);
1326  FW_ASSERT (
1327  _status == Fw::FW_SERIALIZE_OK,
1328  static_cast<FwAssertArgType>(_status)
1329  );
1330 
1331  _status = msg.serializeFrom(args);
1332  FW_ASSERT (
1333  _status == Fw::FW_SERIALIZE_OK,
1334  static_cast<FwAssertArgType>(_status)
1335  );
1336 
1337  // Send message
1339  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1340 
1341  FW_ASSERT(
1342  qStatus == Os::Queue::OP_OK,
1343  static_cast<FwAssertArgType>(qStatus)
1344  );
1345  }
1346 
1349  FwOpcodeType opCode,
1350  U32 cmdSeq,
1351  Fw::CmdArgBuffer& args
1352  )
1353  {
1354  // Call pre-message hook
1355  this->FileSize_preMsgHook(opCode,cmdSeq);
1356 
1357  // Defer deserializing arguments to the message dispatcher
1358  // to avoid deserializing and reserializing just for IPC
1359  ComponentIpcSerializableBuffer msg;
1361 
1362  // Serialize for IPC
1363  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_FILESIZE));
1364  FW_ASSERT (
1365  _status == Fw::FW_SERIALIZE_OK,
1366  static_cast<FwAssertArgType>(_status)
1367  );
1368 
1369  // Fake port number to make message dequeue work
1370  FwIndexType port = 0;
1371 
1372  _status = msg.serializeFrom(port);
1373  FW_ASSERT (
1374  _status == Fw::FW_SERIALIZE_OK,
1375  static_cast<FwAssertArgType>(_status)
1376  );
1377 
1378  _status = msg.serializeFrom(opCode);
1379  FW_ASSERT (
1380  _status == Fw::FW_SERIALIZE_OK,
1381  static_cast<FwAssertArgType>(_status)
1382  );
1383 
1384  _status = msg.serializeFrom(cmdSeq);
1385  FW_ASSERT (
1386  _status == Fw::FW_SERIALIZE_OK,
1387  static_cast<FwAssertArgType>(_status)
1388  );
1389 
1390  _status = msg.serializeFrom(args);
1391  FW_ASSERT (
1392  _status == Fw::FW_SERIALIZE_OK,
1393  static_cast<FwAssertArgType>(_status)
1394  );
1395 
1396  // Send message
1398  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1399 
1400  FW_ASSERT(
1401  qStatus == Os::Queue::OP_OK,
1402  static_cast<FwAssertArgType>(qStatus)
1403  );
1404  }
1405 
1408  FwOpcodeType opCode,
1409  U32 cmdSeq,
1410  Fw::CmdArgBuffer& args
1411  )
1412  {
1413  // Call pre-message hook
1414  this->ListDirectory_preMsgHook(opCode,cmdSeq);
1415 
1416  // Defer deserializing arguments to the message dispatcher
1417  // to avoid deserializing and reserializing just for IPC
1418  ComponentIpcSerializableBuffer msg;
1420 
1421  // Serialize for IPC
1422  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_LISTDIRECTORY));
1423  FW_ASSERT (
1424  _status == Fw::FW_SERIALIZE_OK,
1425  static_cast<FwAssertArgType>(_status)
1426  );
1427 
1428  // Fake port number to make message dequeue work
1429  FwIndexType port = 0;
1430 
1431  _status = msg.serializeFrom(port);
1432  FW_ASSERT (
1433  _status == Fw::FW_SERIALIZE_OK,
1434  static_cast<FwAssertArgType>(_status)
1435  );
1436 
1437  _status = msg.serializeFrom(opCode);
1438  FW_ASSERT (
1439  _status == Fw::FW_SERIALIZE_OK,
1440  static_cast<FwAssertArgType>(_status)
1441  );
1442 
1443  _status = msg.serializeFrom(cmdSeq);
1444  FW_ASSERT (
1445  _status == Fw::FW_SERIALIZE_OK,
1446  static_cast<FwAssertArgType>(_status)
1447  );
1448 
1449  _status = msg.serializeFrom(args);
1450  FW_ASSERT (
1451  _status == Fw::FW_SERIALIZE_OK,
1452  static_cast<FwAssertArgType>(_status)
1453  );
1454 
1455  // Send message
1457  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1458 
1459  FW_ASSERT(
1460  qStatus == Os::Queue::OP_OK,
1461  static_cast<FwAssertArgType>(qStatus)
1462  );
1463  }
1464 
1467  FwOpcodeType opCode,
1468  U32 cmdSeq,
1469  Fw::CmdArgBuffer& args
1470  )
1471  {
1472  // Call pre-message hook
1473  this->CalculateCrc_preMsgHook(opCode,cmdSeq);
1474 
1475  // Defer deserializing arguments to the message dispatcher
1476  // to avoid deserializing and reserializing just for IPC
1477  ComponentIpcSerializableBuffer msg;
1479 
1480  // Serialize for IPC
1481  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CALCULATECRC));
1482  FW_ASSERT (
1483  _status == Fw::FW_SERIALIZE_OK,
1484  static_cast<FwAssertArgType>(_status)
1485  );
1486 
1487  // Fake port number to make message dequeue work
1488  FwIndexType port = 0;
1489 
1490  _status = msg.serializeFrom(port);
1491  FW_ASSERT (
1492  _status == Fw::FW_SERIALIZE_OK,
1493  static_cast<FwAssertArgType>(_status)
1494  );
1495 
1496  _status = msg.serializeFrom(opCode);
1497  FW_ASSERT (
1498  _status == Fw::FW_SERIALIZE_OK,
1499  static_cast<FwAssertArgType>(_status)
1500  );
1501 
1502  _status = msg.serializeFrom(cmdSeq);
1503  FW_ASSERT (
1504  _status == Fw::FW_SERIALIZE_OK,
1505  static_cast<FwAssertArgType>(_status)
1506  );
1507 
1508  _status = msg.serializeFrom(args);
1509  FW_ASSERT (
1510  _status == Fw::FW_SERIALIZE_OK,
1511  static_cast<FwAssertArgType>(_status)
1512  );
1513 
1514  // Send message
1516  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1517 
1518  FW_ASSERT(
1519  qStatus == Os::Queue::OP_OK,
1520  static_cast<FwAssertArgType>(qStatus)
1521  );
1522  }
1523 
1524  // ----------------------------------------------------------------------
1525  // Pre-message hooks for async commands
1526  //
1527  // Each of these functions is invoked just before processing the
1528  // corresponding command. By default they do nothing. You can
1529  // override them to provide specific pre-command behavior.
1530  // ----------------------------------------------------------------------
1531 
1534  FwOpcodeType opCode,
1535  U32 cmdSeq
1536  )
1537  {
1538  // Defaults to no-op; can be overridden
1539  (void) opCode;
1540  (void) cmdSeq;
1541  }
1542 
1545  FwOpcodeType opCode,
1546  U32 cmdSeq
1547  )
1548  {
1549  // Defaults to no-op; can be overridden
1550  (void) opCode;
1551  (void) cmdSeq;
1552  }
1553 
1556  FwOpcodeType opCode,
1557  U32 cmdSeq
1558  )
1559  {
1560  // Defaults to no-op; can be overridden
1561  (void) opCode;
1562  (void) cmdSeq;
1563  }
1564 
1567  FwOpcodeType opCode,
1568  U32 cmdSeq
1569  )
1570  {
1571  // Defaults to no-op; can be overridden
1572  (void) opCode;
1573  (void) cmdSeq;
1574  }
1575 
1578  FwOpcodeType opCode,
1579  U32 cmdSeq
1580  )
1581  {
1582  // Defaults to no-op; can be overridden
1583  (void) opCode;
1584  (void) cmdSeq;
1585  }
1586 
1589  FwOpcodeType opCode,
1590  U32 cmdSeq
1591  )
1592  {
1593  // Defaults to no-op; can be overridden
1594  (void) opCode;
1595  (void) cmdSeq;
1596  }
1597 
1600  FwOpcodeType opCode,
1601  U32 cmdSeq
1602  )
1603  {
1604  // Defaults to no-op; can be overridden
1605  (void) opCode;
1606  (void) cmdSeq;
1607  }
1608 
1611  FwOpcodeType opCode,
1612  U32 cmdSeq
1613  )
1614  {
1615  // Defaults to no-op; can be overridden
1616  (void) opCode;
1617  (void) cmdSeq;
1618  }
1619 
1620  // ----------------------------------------------------------------------
1621  // Event logging functions
1622  // ----------------------------------------------------------------------
1623 
1626  const Fw::StringBase& dirName,
1627  U32 status
1628  ) const
1629  {
1630  // Get the time
1631  Fw::Time _logTime;
1632  if (this->isConnected_timeCaller_OutputPort(0)) {
1633  this->timeCaller_out(0, _logTime);
1634  }
1635 
1637 
1638  // Emit the event on the log port
1639  if (this->isConnected_eventOut_OutputPort(0)) {
1640  Fw::LogBuffer _logBuff;
1642 
1643 #if FW_AMPCS_COMPATIBLE
1644  // Serialize the number of arguments
1645  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1646  FW_ASSERT(
1647  _status == Fw::FW_SERIALIZE_OK,
1648  static_cast<FwAssertArgType>(_status)
1649  );
1650 #endif
1651 
1652  _status = dirName.serializeTo(
1653  _logBuff,
1654  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
1655  );
1656  FW_ASSERT(
1657  _status == Fw::FW_SERIALIZE_OK,
1658  static_cast<FwAssertArgType>(_status)
1659  );
1660 
1661 #if FW_AMPCS_COMPATIBLE
1662  // Serialize the argument size
1663  _status = _logBuff.serializeFrom(
1664  static_cast<U8>(sizeof(U32))
1665  );
1666  FW_ASSERT(
1667  _status == Fw::FW_SERIALIZE_OK,
1668  static_cast<FwAssertArgType>(_status)
1669  );
1670 #endif
1671  _status = _logBuff.serializeFrom(status);
1672  FW_ASSERT(
1673  _status == Fw::FW_SERIALIZE_OK,
1674  static_cast<FwAssertArgType>(_status)
1675  );
1676 
1677  this->eventOut_out(
1678  0,
1679  _id,
1680  _logTime,
1682  _logBuff
1683  );
1684  }
1685 
1686  // Emit the event on the text log port
1687 #if FW_ENABLE_TEXT_LOGGING
1688  if (this->isConnected_LogText_OutputPort(0)) {
1689 #if FW_OBJECT_NAMES == 1
1690  const char* _formatString =
1691  "(%s) %s: Could not create directory %s, returned status %" PRIu32 "";
1692 #else
1693  const char* _formatString =
1694  "%s: Could not create directory %s, returned status %" PRIu32 "";
1695 #endif
1696 
1697  Fw::TextLogString _logString;
1698  _logString.format(
1699  _formatString,
1700 #if FW_OBJECT_NAMES == 1
1701  this->m_objName.toChar(),
1702 #endif
1703  "DirectoryCreateError ",
1704  dirName.toChar(),
1705  status
1706  );
1707 
1708  this->LogText_out(
1709  0,
1710  _id,
1711  _logTime,
1713  _logString
1714  );
1715  }
1716 #endif
1717  }
1718 
1721  const Fw::StringBase& dirName,
1722  U32 status
1723  ) const
1724  {
1725  // Get the time
1726  Fw::Time _logTime;
1727  if (this->isConnected_timeCaller_OutputPort(0)) {
1728  this->timeCaller_out(0, _logTime);
1729  }
1730 
1732 
1733  // Emit the event on the log port
1734  if (this->isConnected_eventOut_OutputPort(0)) {
1735  Fw::LogBuffer _logBuff;
1737 
1738 #if FW_AMPCS_COMPATIBLE
1739  // Serialize the number of arguments
1740  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1741  FW_ASSERT(
1742  _status == Fw::FW_SERIALIZE_OK,
1743  static_cast<FwAssertArgType>(_status)
1744  );
1745 #endif
1746 
1747  _status = dirName.serializeTo(
1748  _logBuff,
1749  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
1750  );
1751  FW_ASSERT(
1752  _status == Fw::FW_SERIALIZE_OK,
1753  static_cast<FwAssertArgType>(_status)
1754  );
1755 
1756 #if FW_AMPCS_COMPATIBLE
1757  // Serialize the argument size
1758  _status = _logBuff.serializeFrom(
1759  static_cast<U8>(sizeof(U32))
1760  );
1761  FW_ASSERT(
1762  _status == Fw::FW_SERIALIZE_OK,
1763  static_cast<FwAssertArgType>(_status)
1764  );
1765 #endif
1766  _status = _logBuff.serializeFrom(status);
1767  FW_ASSERT(
1768  _status == Fw::FW_SERIALIZE_OK,
1769  static_cast<FwAssertArgType>(_status)
1770  );
1771 
1772  this->eventOut_out(
1773  0,
1774  _id,
1775  _logTime,
1777  _logBuff
1778  );
1779  }
1780 
1781  // Emit the event on the text log port
1782 #if FW_ENABLE_TEXT_LOGGING
1783  if (this->isConnected_LogText_OutputPort(0)) {
1784 #if FW_OBJECT_NAMES == 1
1785  const char* _formatString =
1786  "(%s) %s: Could not remove directory %s, returned status %" PRIu32 "";
1787 #else
1788  const char* _formatString =
1789  "%s: Could not remove directory %s, returned status %" PRIu32 "";
1790 #endif
1791 
1792  Fw::TextLogString _logString;
1793  _logString.format(
1794  _formatString,
1795 #if FW_OBJECT_NAMES == 1
1796  this->m_objName.toChar(),
1797 #endif
1798  "DirectoryRemoveError ",
1799  dirName.toChar(),
1800  status
1801  );
1802 
1803  this->LogText_out(
1804  0,
1805  _id,
1806  _logTime,
1808  _logString
1809  );
1810  }
1811 #endif
1812  }
1813 
1816  const Fw::StringBase& sourceFileName,
1817  const Fw::StringBase& destFileName,
1818  U32 status
1819  ) const
1820  {
1821  // Get the time
1822  Fw::Time _logTime;
1823  if (this->isConnected_timeCaller_OutputPort(0)) {
1824  this->timeCaller_out(0, _logTime);
1825  }
1826 
1827  const FwEventIdType _id = this->getIdBase() + EVENTID_FILEMOVEERROR;
1828 
1829  // Emit the event on the log port
1830  if (this->isConnected_eventOut_OutputPort(0)) {
1831  Fw::LogBuffer _logBuff;
1833 
1834 #if FW_AMPCS_COMPATIBLE
1835  // Serialize the number of arguments
1836  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1837  FW_ASSERT(
1838  _status == Fw::FW_SERIALIZE_OK,
1839  static_cast<FwAssertArgType>(_status)
1840  );
1841 #endif
1842 
1843  _status = sourceFileName.serializeTo(
1844  _logBuff,
1845  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
1846  );
1847  FW_ASSERT(
1848  _status == Fw::FW_SERIALIZE_OK,
1849  static_cast<FwAssertArgType>(_status)
1850  );
1851 
1852  _status = destFileName.serializeTo(
1853  _logBuff,
1854  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
1855  );
1856  FW_ASSERT(
1857  _status == Fw::FW_SERIALIZE_OK,
1858  static_cast<FwAssertArgType>(_status)
1859  );
1860 
1861 #if FW_AMPCS_COMPATIBLE
1862  // Serialize the argument size
1863  _status = _logBuff.serializeFrom(
1864  static_cast<U8>(sizeof(U32))
1865  );
1866  FW_ASSERT(
1867  _status == Fw::FW_SERIALIZE_OK,
1868  static_cast<FwAssertArgType>(_status)
1869  );
1870 #endif
1871  _status = _logBuff.serializeFrom(status);
1872  FW_ASSERT(
1873  _status == Fw::FW_SERIALIZE_OK,
1874  static_cast<FwAssertArgType>(_status)
1875  );
1876 
1877  this->eventOut_out(
1878  0,
1879  _id,
1880  _logTime,
1882  _logBuff
1883  );
1884  }
1885 
1886  // Emit the event on the text log port
1887 #if FW_ENABLE_TEXT_LOGGING
1888  if (this->isConnected_LogText_OutputPort(0)) {
1889 #if FW_OBJECT_NAMES == 1
1890  const char* _formatString =
1891  "(%s) %s: Could not move file %s to file %s, returned status %" PRIu32 "";
1892 #else
1893  const char* _formatString =
1894  "%s: Could not move file %s to file %s, returned status %" PRIu32 "";
1895 #endif
1896 
1897  Fw::TextLogString _logString;
1898  _logString.format(
1899  _formatString,
1900 #if FW_OBJECT_NAMES == 1
1901  this->m_objName.toChar(),
1902 #endif
1903  "FileMoveError ",
1904  sourceFileName.toChar(),
1905  destFileName.toChar(),
1906  status
1907  );
1908 
1909  this->LogText_out(
1910  0,
1911  _id,
1912  _logTime,
1914  _logString
1915  );
1916  }
1917 #endif
1918  }
1919 
1922  const Fw::StringBase& fileName,
1923  U32 status
1924  ) const
1925  {
1926  // Get the time
1927  Fw::Time _logTime;
1928  if (this->isConnected_timeCaller_OutputPort(0)) {
1929  this->timeCaller_out(0, _logTime);
1930  }
1931 
1932  const FwEventIdType _id = this->getIdBase() + EVENTID_FILEREMOVEERROR;
1933 
1934  // Emit the event on the log port
1935  if (this->isConnected_eventOut_OutputPort(0)) {
1936  Fw::LogBuffer _logBuff;
1938 
1939 #if FW_AMPCS_COMPATIBLE
1940  // Serialize the number of arguments
1941  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1942  FW_ASSERT(
1943  _status == Fw::FW_SERIALIZE_OK,
1944  static_cast<FwAssertArgType>(_status)
1945  );
1946 #endif
1947 
1948  _status = fileName.serializeTo(
1949  _logBuff,
1950  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
1951  );
1952  FW_ASSERT(
1953  _status == Fw::FW_SERIALIZE_OK,
1954  static_cast<FwAssertArgType>(_status)
1955  );
1956 
1957 #if FW_AMPCS_COMPATIBLE
1958  // Serialize the argument size
1959  _status = _logBuff.serializeFrom(
1960  static_cast<U8>(sizeof(U32))
1961  );
1962  FW_ASSERT(
1963  _status == Fw::FW_SERIALIZE_OK,
1964  static_cast<FwAssertArgType>(_status)
1965  );
1966 #endif
1967  _status = _logBuff.serializeFrom(status);
1968  FW_ASSERT(
1969  _status == Fw::FW_SERIALIZE_OK,
1970  static_cast<FwAssertArgType>(_status)
1971  );
1972 
1973  this->eventOut_out(
1974  0,
1975  _id,
1976  _logTime,
1978  _logBuff
1979  );
1980  }
1981 
1982  // Emit the event on the text log port
1983 #if FW_ENABLE_TEXT_LOGGING
1984  if (this->isConnected_LogText_OutputPort(0)) {
1985 #if FW_OBJECT_NAMES == 1
1986  const char* _formatString =
1987  "(%s) %s: Could not remove file %s, returned status %" PRIu32 "";
1988 #else
1989  const char* _formatString =
1990  "%s: Could not remove file %s, returned status %" PRIu32 "";
1991 #endif
1992 
1993  Fw::TextLogString _logString;
1994  _logString.format(
1995  _formatString,
1996 #if FW_OBJECT_NAMES == 1
1997  this->m_objName.toChar(),
1998 #endif
1999  "FileRemoveError ",
2000  fileName.toChar(),
2001  status
2002  );
2003 
2004  this->LogText_out(
2005  0,
2006  _id,
2007  _logTime,
2009  _logString
2010  );
2011  }
2012 #endif
2013  }
2014 
2017  const Fw::StringBase& source,
2018  const Fw::StringBase& target,
2019  U32 status
2020  ) const
2021  {
2022  // Get the time
2023  Fw::Time _logTime;
2024  if (this->isConnected_timeCaller_OutputPort(0)) {
2025  this->timeCaller_out(0, _logTime);
2026  }
2027 
2028  const FwEventIdType _id = this->getIdBase() + EVENTID_APPENDFILEFAILED;
2029 
2030  // Emit the event on the log port
2031  if (this->isConnected_eventOut_OutputPort(0)) {
2032  Fw::LogBuffer _logBuff;
2034 
2035 #if FW_AMPCS_COMPATIBLE
2036  // Serialize the number of arguments
2037  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2038  FW_ASSERT(
2039  _status == Fw::FW_SERIALIZE_OK,
2040  static_cast<FwAssertArgType>(_status)
2041  );
2042 #endif
2043 
2044  _status = source.serializeTo(
2045  _logBuff,
2046  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2047  );
2048  FW_ASSERT(
2049  _status == Fw::FW_SERIALIZE_OK,
2050  static_cast<FwAssertArgType>(_status)
2051  );
2052 
2053  _status = target.serializeTo(
2054  _logBuff,
2055  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2056  );
2057  FW_ASSERT(
2058  _status == Fw::FW_SERIALIZE_OK,
2059  static_cast<FwAssertArgType>(_status)
2060  );
2061 
2062 #if FW_AMPCS_COMPATIBLE
2063  // Serialize the argument size
2064  _status = _logBuff.serializeFrom(
2065  static_cast<U8>(sizeof(U32))
2066  );
2067  FW_ASSERT(
2068  _status == Fw::FW_SERIALIZE_OK,
2069  static_cast<FwAssertArgType>(_status)
2070  );
2071 #endif
2072  _status = _logBuff.serializeFrom(status);
2073  FW_ASSERT(
2074  _status == Fw::FW_SERIALIZE_OK,
2075  static_cast<FwAssertArgType>(_status)
2076  );
2077 
2078  this->eventOut_out(
2079  0,
2080  _id,
2081  _logTime,
2083  _logBuff
2084  );
2085  }
2086 
2087  // Emit the event on the text log port
2088 #if FW_ENABLE_TEXT_LOGGING
2089  if (this->isConnected_LogText_OutputPort(0)) {
2090 #if FW_OBJECT_NAMES == 1
2091  const char* _formatString =
2092  "(%s) %s: Appending %s onto %s failed with status %" PRIu32 "";
2093 #else
2094  const char* _formatString =
2095  "%s: Appending %s onto %s failed with status %" PRIu32 "";
2096 #endif
2097 
2098  Fw::TextLogString _logString;
2099  _logString.format(
2100  _formatString,
2101 #if FW_OBJECT_NAMES == 1
2102  this->m_objName.toChar(),
2103 #endif
2104  "AppendFileFailed ",
2105  source.toChar(),
2106  target.toChar(),
2107  status
2108  );
2109 
2110  this->LogText_out(
2111  0,
2112  _id,
2113  _logTime,
2115  _logString
2116  );
2117  }
2118 #endif
2119  }
2120 
2123  const Fw::StringBase& source,
2124  const Fw::StringBase& target
2125  ) const
2126  {
2127  // Get the time
2128  Fw::Time _logTime;
2129  if (this->isConnected_timeCaller_OutputPort(0)) {
2130  this->timeCaller_out(0, _logTime);
2131  }
2132 
2133  const FwEventIdType _id = this->getIdBase() + EVENTID_APPENDFILESUCCEEDED;
2134 
2135  // Emit the event on the log port
2136  if (this->isConnected_eventOut_OutputPort(0)) {
2137  Fw::LogBuffer _logBuff;
2139 
2140 #if FW_AMPCS_COMPATIBLE
2141  // Serialize the number of arguments
2142  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2143  FW_ASSERT(
2144  _status == Fw::FW_SERIALIZE_OK,
2145  static_cast<FwAssertArgType>(_status)
2146  );
2147 #endif
2148 
2149  _status = source.serializeTo(
2150  _logBuff,
2151  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2152  );
2153  FW_ASSERT(
2154  _status == Fw::FW_SERIALIZE_OK,
2155  static_cast<FwAssertArgType>(_status)
2156  );
2157 
2158  _status = target.serializeTo(
2159  _logBuff,
2160  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2161  );
2162  FW_ASSERT(
2163  _status == Fw::FW_SERIALIZE_OK,
2164  static_cast<FwAssertArgType>(_status)
2165  );
2166 
2167  this->eventOut_out(
2168  0,
2169  _id,
2170  _logTime,
2172  _logBuff
2173  );
2174  }
2175 
2176  // Emit the event on the text log port
2177 #if FW_ENABLE_TEXT_LOGGING
2178  if (this->isConnected_LogText_OutputPort(0)) {
2179 #if FW_OBJECT_NAMES == 1
2180  const char* _formatString =
2181  "(%s) %s: Appended %s to the end of %s";
2182 #else
2183  const char* _formatString =
2184  "%s: Appended %s to the end of %s";
2185 #endif
2186 
2187  Fw::TextLogString _logString;
2188  _logString.format(
2189  _formatString,
2190 #if FW_OBJECT_NAMES == 1
2191  this->m_objName.toChar(),
2192 #endif
2193  "AppendFileSucceeded ",
2194  source.toChar(),
2195  target.toChar()
2196  );
2197 
2198  this->LogText_out(
2199  0,
2200  _id,
2201  _logTime,
2203  _logString
2204  );
2205  }
2206 #endif
2207  }
2208 
2211  {
2212  // Get the time
2213  Fw::Time _logTime;
2214  if (this->isConnected_timeCaller_OutputPort(0)) {
2215  this->timeCaller_out(0, _logTime);
2216  }
2217 
2219 
2220  // Emit the event on the log port
2221  if (this->isConnected_eventOut_OutputPort(0)) {
2222  Fw::LogBuffer _logBuff;
2224 
2225 #if FW_AMPCS_COMPATIBLE
2226  // Serialize the number of arguments
2227  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2228  FW_ASSERT(
2229  _status == Fw::FW_SERIALIZE_OK,
2230  static_cast<FwAssertArgType>(_status)
2231  );
2232 #endif
2233 
2234  _status = dirName.serializeTo(
2235  _logBuff,
2236  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2237  );
2238  FW_ASSERT(
2239  _status == Fw::FW_SERIALIZE_OK,
2240  static_cast<FwAssertArgType>(_status)
2241  );
2242 
2243  this->eventOut_out(
2244  0,
2245  _id,
2246  _logTime,
2248  _logBuff
2249  );
2250  }
2251 
2252  // Emit the event on the text log port
2253 #if FW_ENABLE_TEXT_LOGGING
2254  if (this->isConnected_LogText_OutputPort(0)) {
2255 #if FW_OBJECT_NAMES == 1
2256  const char* _formatString =
2257  "(%s) %s: Created directory %s successfully";
2258 #else
2259  const char* _formatString =
2260  "%s: Created directory %s successfully";
2261 #endif
2262 
2263  Fw::TextLogString _logString;
2264  _logString.format(
2265  _formatString,
2266 #if FW_OBJECT_NAMES == 1
2267  this->m_objName.toChar(),
2268 #endif
2269  "CreateDirectorySucceeded ",
2270  dirName.toChar()
2271  );
2272 
2273  this->LogText_out(
2274  0,
2275  _id,
2276  _logTime,
2278  _logString
2279  );
2280  }
2281 #endif
2282  }
2283 
2286  {
2287  // Get the time
2288  Fw::Time _logTime;
2289  if (this->isConnected_timeCaller_OutputPort(0)) {
2290  this->timeCaller_out(0, _logTime);
2291  }
2292 
2294 
2295  // Emit the event on the log port
2296  if (this->isConnected_eventOut_OutputPort(0)) {
2297  Fw::LogBuffer _logBuff;
2299 
2300 #if FW_AMPCS_COMPATIBLE
2301  // Serialize the number of arguments
2302  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2303  FW_ASSERT(
2304  _status == Fw::FW_SERIALIZE_OK,
2305  static_cast<FwAssertArgType>(_status)
2306  );
2307 #endif
2308 
2309  _status = dirName.serializeTo(
2310  _logBuff,
2311  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2312  );
2313  FW_ASSERT(
2314  _status == Fw::FW_SERIALIZE_OK,
2315  static_cast<FwAssertArgType>(_status)
2316  );
2317 
2318  this->eventOut_out(
2319  0,
2320  _id,
2321  _logTime,
2323  _logBuff
2324  );
2325  }
2326 
2327  // Emit the event on the text log port
2328 #if FW_ENABLE_TEXT_LOGGING
2329  if (this->isConnected_LogText_OutputPort(0)) {
2330 #if FW_OBJECT_NAMES == 1
2331  const char* _formatString =
2332  "(%s) %s: Removed directory %s successfully";
2333 #else
2334  const char* _formatString =
2335  "%s: Removed directory %s successfully";
2336 #endif
2337 
2338  Fw::TextLogString _logString;
2339  _logString.format(
2340  _formatString,
2341 #if FW_OBJECT_NAMES == 1
2342  this->m_objName.toChar(),
2343 #endif
2344  "RemoveDirectorySucceeded ",
2345  dirName.toChar()
2346  );
2347 
2348  this->LogText_out(
2349  0,
2350  _id,
2351  _logTime,
2353  _logString
2354  );
2355  }
2356 #endif
2357  }
2358 
2361  const Fw::StringBase& sourceFileName,
2362  const Fw::StringBase& destFileName
2363  ) const
2364  {
2365  // Get the time
2366  Fw::Time _logTime;
2367  if (this->isConnected_timeCaller_OutputPort(0)) {
2368  this->timeCaller_out(0, _logTime);
2369  }
2370 
2371  const FwEventIdType _id = this->getIdBase() + EVENTID_MOVEFILESUCCEEDED;
2372 
2373  // Emit the event on the log port
2374  if (this->isConnected_eventOut_OutputPort(0)) {
2375  Fw::LogBuffer _logBuff;
2377 
2378 #if FW_AMPCS_COMPATIBLE
2379  // Serialize the number of arguments
2380  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2381  FW_ASSERT(
2382  _status == Fw::FW_SERIALIZE_OK,
2383  static_cast<FwAssertArgType>(_status)
2384  );
2385 #endif
2386 
2387  _status = sourceFileName.serializeTo(
2388  _logBuff,
2389  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2390  );
2391  FW_ASSERT(
2392  _status == Fw::FW_SERIALIZE_OK,
2393  static_cast<FwAssertArgType>(_status)
2394  );
2395 
2396  _status = destFileName.serializeTo(
2397  _logBuff,
2398  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2399  );
2400  FW_ASSERT(
2401  _status == Fw::FW_SERIALIZE_OK,
2402  static_cast<FwAssertArgType>(_status)
2403  );
2404 
2405  this->eventOut_out(
2406  0,
2407  _id,
2408  _logTime,
2410  _logBuff
2411  );
2412  }
2413 
2414  // Emit the event on the text log port
2415 #if FW_ENABLE_TEXT_LOGGING
2416  if (this->isConnected_LogText_OutputPort(0)) {
2417 #if FW_OBJECT_NAMES == 1
2418  const char* _formatString =
2419  "(%s) %s: Moved file %s to file %s successfully";
2420 #else
2421  const char* _formatString =
2422  "%s: Moved file %s to file %s successfully";
2423 #endif
2424 
2425  Fw::TextLogString _logString;
2426  _logString.format(
2427  _formatString,
2428 #if FW_OBJECT_NAMES == 1
2429  this->m_objName.toChar(),
2430 #endif
2431  "MoveFileSucceeded ",
2432  sourceFileName.toChar(),
2433  destFileName.toChar()
2434  );
2435 
2436  this->LogText_out(
2437  0,
2438  _id,
2439  _logTime,
2441  _logString
2442  );
2443  }
2444 #endif
2445  }
2446 
2449  {
2450  // Get the time
2451  Fw::Time _logTime;
2452  if (this->isConnected_timeCaller_OutputPort(0)) {
2453  this->timeCaller_out(0, _logTime);
2454  }
2455 
2456  const FwEventIdType _id = this->getIdBase() + EVENTID_REMOVEFILESUCCEEDED;
2457 
2458  // Emit the event on the log port
2459  if (this->isConnected_eventOut_OutputPort(0)) {
2460  Fw::LogBuffer _logBuff;
2462 
2463 #if FW_AMPCS_COMPATIBLE
2464  // Serialize the number of arguments
2465  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2466  FW_ASSERT(
2467  _status == Fw::FW_SERIALIZE_OK,
2468  static_cast<FwAssertArgType>(_status)
2469  );
2470 #endif
2471 
2472  _status = fileName.serializeTo(
2473  _logBuff,
2474  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2475  );
2476  FW_ASSERT(
2477  _status == Fw::FW_SERIALIZE_OK,
2478  static_cast<FwAssertArgType>(_status)
2479  );
2480 
2481  this->eventOut_out(
2482  0,
2483  _id,
2484  _logTime,
2486  _logBuff
2487  );
2488  }
2489 
2490  // Emit the event on the text log port
2491 #if FW_ENABLE_TEXT_LOGGING
2492  if (this->isConnected_LogText_OutputPort(0)) {
2493 #if FW_OBJECT_NAMES == 1
2494  const char* _formatString =
2495  "(%s) %s: Removed file %s successfully";
2496 #else
2497  const char* _formatString =
2498  "%s: Removed file %s successfully";
2499 #endif
2500 
2501  Fw::TextLogString _logString;
2502  _logString.format(
2503  _formatString,
2504 #if FW_OBJECT_NAMES == 1
2505  this->m_objName.toChar(),
2506 #endif
2507  "RemoveFileSucceeded ",
2508  fileName.toChar()
2509  );
2510 
2511  this->LogText_out(
2512  0,
2513  _id,
2514  _logTime,
2516  _logString
2517  );
2518  }
2519 #endif
2520  }
2521 
2524  const Fw::StringBase& source,
2525  const Fw::StringBase& target
2526  ) const
2527  {
2528  // Get the time
2529  Fw::Time _logTime;
2530  if (this->isConnected_timeCaller_OutputPort(0)) {
2531  this->timeCaller_out(0, _logTime);
2532  }
2533 
2534  const FwEventIdType _id = this->getIdBase() + EVENTID_APPENDFILESTARTED;
2535 
2536  // Emit the event on the log port
2537  if (this->isConnected_eventOut_OutputPort(0)) {
2538  Fw::LogBuffer _logBuff;
2540 
2541 #if FW_AMPCS_COMPATIBLE
2542  // Serialize the number of arguments
2543  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2544  FW_ASSERT(
2545  _status == Fw::FW_SERIALIZE_OK,
2546  static_cast<FwAssertArgType>(_status)
2547  );
2548 #endif
2549 
2550  _status = source.serializeTo(
2551  _logBuff,
2552  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2553  );
2554  FW_ASSERT(
2555  _status == Fw::FW_SERIALIZE_OK,
2556  static_cast<FwAssertArgType>(_status)
2557  );
2558 
2559  _status = target.serializeTo(
2560  _logBuff,
2561  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2562  );
2563  FW_ASSERT(
2564  _status == Fw::FW_SERIALIZE_OK,
2565  static_cast<FwAssertArgType>(_status)
2566  );
2567 
2568  this->eventOut_out(
2569  0,
2570  _id,
2571  _logTime,
2573  _logBuff
2574  );
2575  }
2576 
2577  // Emit the event on the text log port
2578 #if FW_ENABLE_TEXT_LOGGING
2579  if (this->isConnected_LogText_OutputPort(0)) {
2580 #if FW_OBJECT_NAMES == 1
2581  const char* _formatString =
2582  "(%s) %s: Appending file %s to the end of %s...";
2583 #else
2584  const char* _formatString =
2585  "%s: Appending file %s to the end of %s...";
2586 #endif
2587 
2588  Fw::TextLogString _logString;
2589  _logString.format(
2590  _formatString,
2591 #if FW_OBJECT_NAMES == 1
2592  this->m_objName.toChar(),
2593 #endif
2594  "AppendFileStarted ",
2595  source.toChar(),
2596  target.toChar()
2597  );
2598 
2599  this->LogText_out(
2600  0,
2601  _id,
2602  _logTime,
2604  _logString
2605  );
2606  }
2607 #endif
2608  }
2609 
2612  {
2613  // Get the time
2614  Fw::Time _logTime;
2615  if (this->isConnected_timeCaller_OutputPort(0)) {
2616  this->timeCaller_out(0, _logTime);
2617  }
2618 
2620 
2621  // Emit the event on the log port
2622  if (this->isConnected_eventOut_OutputPort(0)) {
2623  Fw::LogBuffer _logBuff;
2625 
2626 #if FW_AMPCS_COMPATIBLE
2627  // Serialize the number of arguments
2628  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2629  FW_ASSERT(
2630  _status == Fw::FW_SERIALIZE_OK,
2631  static_cast<FwAssertArgType>(_status)
2632  );
2633 #endif
2634 
2635  _status = dirName.serializeTo(
2636  _logBuff,
2637  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2638  );
2639  FW_ASSERT(
2640  _status == Fw::FW_SERIALIZE_OK,
2641  static_cast<FwAssertArgType>(_status)
2642  );
2643 
2644  this->eventOut_out(
2645  0,
2646  _id,
2647  _logTime,
2649  _logBuff
2650  );
2651  }
2652 
2653  // Emit the event on the text log port
2654 #if FW_ENABLE_TEXT_LOGGING
2655  if (this->isConnected_LogText_OutputPort(0)) {
2656 #if FW_OBJECT_NAMES == 1
2657  const char* _formatString =
2658  "(%s) %s: Creating directory %s...";
2659 #else
2660  const char* _formatString =
2661  "%s: Creating directory %s...";
2662 #endif
2663 
2664  Fw::TextLogString _logString;
2665  _logString.format(
2666  _formatString,
2667 #if FW_OBJECT_NAMES == 1
2668  this->m_objName.toChar(),
2669 #endif
2670  "CreateDirectoryStarted ",
2671  dirName.toChar()
2672  );
2673 
2674  this->LogText_out(
2675  0,
2676  _id,
2677  _logTime,
2679  _logString
2680  );
2681  }
2682 #endif
2683  }
2684 
2687  {
2688  // Get the time
2689  Fw::Time _logTime;
2690  if (this->isConnected_timeCaller_OutputPort(0)) {
2691  this->timeCaller_out(0, _logTime);
2692  }
2693 
2695 
2696  // Emit the event on the log port
2697  if (this->isConnected_eventOut_OutputPort(0)) {
2698  Fw::LogBuffer _logBuff;
2700 
2701 #if FW_AMPCS_COMPATIBLE
2702  // Serialize the number of arguments
2703  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2704  FW_ASSERT(
2705  _status == Fw::FW_SERIALIZE_OK,
2706  static_cast<FwAssertArgType>(_status)
2707  );
2708 #endif
2709 
2710  _status = dirName.serializeTo(
2711  _logBuff,
2712  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2713  );
2714  FW_ASSERT(
2715  _status == Fw::FW_SERIALIZE_OK,
2716  static_cast<FwAssertArgType>(_status)
2717  );
2718 
2719  this->eventOut_out(
2720  0,
2721  _id,
2722  _logTime,
2724  _logBuff
2725  );
2726  }
2727 
2728  // Emit the event on the text log port
2729 #if FW_ENABLE_TEXT_LOGGING
2730  if (this->isConnected_LogText_OutputPort(0)) {
2731 #if FW_OBJECT_NAMES == 1
2732  const char* _formatString =
2733  "(%s) %s: Removing directory %s...";
2734 #else
2735  const char* _formatString =
2736  "%s: Removing directory %s...";
2737 #endif
2738 
2739  Fw::TextLogString _logString;
2740  _logString.format(
2741  _formatString,
2742 #if FW_OBJECT_NAMES == 1
2743  this->m_objName.toChar(),
2744 #endif
2745  "RemoveDirectoryStarted ",
2746  dirName.toChar()
2747  );
2748 
2749  this->LogText_out(
2750  0,
2751  _id,
2752  _logTime,
2754  _logString
2755  );
2756  }
2757 #endif
2758  }
2759 
2762  const Fw::StringBase& sourceFileName,
2763  const Fw::StringBase& destFileName
2764  ) const
2765  {
2766  // Get the time
2767  Fw::Time _logTime;
2768  if (this->isConnected_timeCaller_OutputPort(0)) {
2769  this->timeCaller_out(0, _logTime);
2770  }
2771 
2772  const FwEventIdType _id = this->getIdBase() + EVENTID_MOVEFILESTARTED;
2773 
2774  // Emit the event on the log port
2775  if (this->isConnected_eventOut_OutputPort(0)) {
2776  Fw::LogBuffer _logBuff;
2778 
2779 #if FW_AMPCS_COMPATIBLE
2780  // Serialize the number of arguments
2781  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2782  FW_ASSERT(
2783  _status == Fw::FW_SERIALIZE_OK,
2784  static_cast<FwAssertArgType>(_status)
2785  );
2786 #endif
2787 
2788  _status = sourceFileName.serializeTo(
2789  _logBuff,
2790  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2791  );
2792  FW_ASSERT(
2793  _status == Fw::FW_SERIALIZE_OK,
2794  static_cast<FwAssertArgType>(_status)
2795  );
2796 
2797  _status = destFileName.serializeTo(
2798  _logBuff,
2799  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2800  );
2801  FW_ASSERT(
2802  _status == Fw::FW_SERIALIZE_OK,
2803  static_cast<FwAssertArgType>(_status)
2804  );
2805 
2806  this->eventOut_out(
2807  0,
2808  _id,
2809  _logTime,
2811  _logBuff
2812  );
2813  }
2814 
2815  // Emit the event on the text log port
2816 #if FW_ENABLE_TEXT_LOGGING
2817  if (this->isConnected_LogText_OutputPort(0)) {
2818 #if FW_OBJECT_NAMES == 1
2819  const char* _formatString =
2820  "(%s) %s: Moving file %s to file %s...";
2821 #else
2822  const char* _formatString =
2823  "%s: Moving file %s to file %s...";
2824 #endif
2825 
2826  Fw::TextLogString _logString;
2827  _logString.format(
2828  _formatString,
2829 #if FW_OBJECT_NAMES == 1
2830  this->m_objName.toChar(),
2831 #endif
2832  "MoveFileStarted ",
2833  sourceFileName.toChar(),
2834  destFileName.toChar()
2835  );
2836 
2837  this->LogText_out(
2838  0,
2839  _id,
2840  _logTime,
2842  _logString
2843  );
2844  }
2845 #endif
2846  }
2847 
2850  {
2851  // Get the time
2852  Fw::Time _logTime;
2853  if (this->isConnected_timeCaller_OutputPort(0)) {
2854  this->timeCaller_out(0, _logTime);
2855  }
2856 
2857  const FwEventIdType _id = this->getIdBase() + EVENTID_REMOVEFILESTARTED;
2858 
2859  // Emit the event on the log port
2860  if (this->isConnected_eventOut_OutputPort(0)) {
2861  Fw::LogBuffer _logBuff;
2863 
2864 #if FW_AMPCS_COMPATIBLE
2865  // Serialize the number of arguments
2866  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2867  FW_ASSERT(
2868  _status == Fw::FW_SERIALIZE_OK,
2869  static_cast<FwAssertArgType>(_status)
2870  );
2871 #endif
2872 
2873  _status = fileName.serializeTo(
2874  _logBuff,
2875  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2876  );
2877  FW_ASSERT(
2878  _status == Fw::FW_SERIALIZE_OK,
2879  static_cast<FwAssertArgType>(_status)
2880  );
2881 
2882  this->eventOut_out(
2883  0,
2884  _id,
2885  _logTime,
2887  _logBuff
2888  );
2889  }
2890 
2891  // Emit the event on the text log port
2892 #if FW_ENABLE_TEXT_LOGGING
2893  if (this->isConnected_LogText_OutputPort(0)) {
2894 #if FW_OBJECT_NAMES == 1
2895  const char* _formatString =
2896  "(%s) %s: Removing file %s...";
2897 #else
2898  const char* _formatString =
2899  "%s: Removing file %s...";
2900 #endif
2901 
2902  Fw::TextLogString _logString;
2903  _logString.format(
2904  _formatString,
2905 #if FW_OBJECT_NAMES == 1
2906  this->m_objName.toChar(),
2907 #endif
2908  "RemoveFileStarted ",
2909  fileName.toChar()
2910  );
2911 
2912  this->LogText_out(
2913  0,
2914  _id,
2915  _logTime,
2917  _logString
2918  );
2919  }
2920 #endif
2921  }
2922 
2925  const Fw::StringBase& fileName,
2926  FwSizeType size
2927  ) const
2928  {
2929  // Get the time
2930  Fw::Time _logTime;
2931  if (this->isConnected_timeCaller_OutputPort(0)) {
2932  this->timeCaller_out(0, _logTime);
2933  }
2934 
2935  const FwEventIdType _id = this->getIdBase() + EVENTID_FILESIZESUCCEEDED;
2936 
2937  // Emit the event on the log port
2938  if (this->isConnected_eventOut_OutputPort(0)) {
2939  Fw::LogBuffer _logBuff;
2941 
2942 #if FW_AMPCS_COMPATIBLE
2943  // Serialize the number of arguments
2944  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2945  FW_ASSERT(
2946  _status == Fw::FW_SERIALIZE_OK,
2947  static_cast<FwAssertArgType>(_status)
2948  );
2949 #endif
2950 
2951  _status = fileName.serializeTo(
2952  _logBuff,
2953  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
2954  );
2955  FW_ASSERT(
2956  _status == Fw::FW_SERIALIZE_OK,
2957  static_cast<FwAssertArgType>(_status)
2958  );
2959 
2960 #if FW_AMPCS_COMPATIBLE
2961  // Serialize the argument size
2962  _status = _logBuff.serializeFrom(
2963  static_cast<U8>(sizeof(FwSizeType))
2964  );
2965  FW_ASSERT(
2966  _status == Fw::FW_SERIALIZE_OK,
2967  static_cast<FwAssertArgType>(_status)
2968  );
2969 #endif
2970  _status = _logBuff.serializeFrom(size);
2971  FW_ASSERT(
2972  _status == Fw::FW_SERIALIZE_OK,
2973  static_cast<FwAssertArgType>(_status)
2974  );
2975 
2976  this->eventOut_out(
2977  0,
2978  _id,
2979  _logTime,
2981  _logBuff
2982  );
2983  }
2984 
2985  // Emit the event on the text log port
2986 #if FW_ENABLE_TEXT_LOGGING
2987  if (this->isConnected_LogText_OutputPort(0)) {
2988 #if FW_OBJECT_NAMES == 1
2989  const char* _formatString =
2990  "(%s) %s: The size of file %s is %" PRIu64 " B";
2991 #else
2992  const char* _formatString =
2993  "%s: The size of file %s is %" PRIu64 " B";
2994 #endif
2995 
2996  Fw::TextLogString _logString;
2997  _logString.format(
2998  _formatString,
2999 #if FW_OBJECT_NAMES == 1
3000  this->m_objName.toChar(),
3001 #endif
3002  "FileSizeSucceeded ",
3003  fileName.toChar(),
3004  size
3005  );
3006 
3007  this->LogText_out(
3008  0,
3009  _id,
3010  _logTime,
3012  _logString
3013  );
3014  }
3015 #endif
3016  }
3017 
3020  const Fw::StringBase& fileName,
3021  U32 status
3022  ) const
3023  {
3024  // Get the time
3025  Fw::Time _logTime;
3026  if (this->isConnected_timeCaller_OutputPort(0)) {
3027  this->timeCaller_out(0, _logTime);
3028  }
3029 
3030  const FwEventIdType _id = this->getIdBase() + EVENTID_FILESIZEERROR;
3031 
3032  // Emit the event on the log port
3033  if (this->isConnected_eventOut_OutputPort(0)) {
3034  Fw::LogBuffer _logBuff;
3036 
3037 #if FW_AMPCS_COMPATIBLE
3038  // Serialize the number of arguments
3039  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3040  FW_ASSERT(
3041  _status == Fw::FW_SERIALIZE_OK,
3042  static_cast<FwAssertArgType>(_status)
3043  );
3044 #endif
3045 
3046  _status = fileName.serializeTo(
3047  _logBuff,
3048  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
3049  );
3050  FW_ASSERT(
3051  _status == Fw::FW_SERIALIZE_OK,
3052  static_cast<FwAssertArgType>(_status)
3053  );
3054 
3055 #if FW_AMPCS_COMPATIBLE
3056  // Serialize the argument size
3057  _status = _logBuff.serializeFrom(
3058  static_cast<U8>(sizeof(U32))
3059  );
3060  FW_ASSERT(
3061  _status == Fw::FW_SERIALIZE_OK,
3062  static_cast<FwAssertArgType>(_status)
3063  );
3064 #endif
3065  _status = _logBuff.serializeFrom(status);
3066  FW_ASSERT(
3067  _status == Fw::FW_SERIALIZE_OK,
3068  static_cast<FwAssertArgType>(_status)
3069  );
3070 
3071  this->eventOut_out(
3072  0,
3073  _id,
3074  _logTime,
3076  _logBuff
3077  );
3078  }
3079 
3080  // Emit the event on the text log port
3081 #if FW_ENABLE_TEXT_LOGGING
3082  if (this->isConnected_LogText_OutputPort(0)) {
3083 #if FW_OBJECT_NAMES == 1
3084  const char* _formatString =
3085  "(%s) %s: Failed to get the size of file %s, returned status %" PRIu32 "";
3086 #else
3087  const char* _formatString =
3088  "%s: Failed to get the size of file %s, returned status %" PRIu32 "";
3089 #endif
3090 
3091  Fw::TextLogString _logString;
3092  _logString.format(
3093  _formatString,
3094 #if FW_OBJECT_NAMES == 1
3095  this->m_objName.toChar(),
3096 #endif
3097  "FileSizeError ",
3098  fileName.toChar(),
3099  status
3100  );
3101 
3102  this->LogText_out(
3103  0,
3104  _id,
3105  _logTime,
3107  _logString
3108  );
3109  }
3110 #endif
3111  }
3112 
3115  {
3116  // Get the time
3117  Fw::Time _logTime;
3118  if (this->isConnected_timeCaller_OutputPort(0)) {
3119  this->timeCaller_out(0, _logTime);
3120  }
3121 
3122  const FwEventIdType _id = this->getIdBase() + EVENTID_FILESIZESTARTED;
3123 
3124  // Emit the event on the log port
3125  if (this->isConnected_eventOut_OutputPort(0)) {
3126  Fw::LogBuffer _logBuff;
3128 
3129 #if FW_AMPCS_COMPATIBLE
3130  // Serialize the number of arguments
3131  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3132  FW_ASSERT(
3133  _status == Fw::FW_SERIALIZE_OK,
3134  static_cast<FwAssertArgType>(_status)
3135  );
3136 #endif
3137 
3138  _status = fileName.serializeTo(
3139  _logBuff,
3140  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
3141  );
3142  FW_ASSERT(
3143  _status == Fw::FW_SERIALIZE_OK,
3144  static_cast<FwAssertArgType>(_status)
3145  );
3146 
3147  this->eventOut_out(
3148  0,
3149  _id,
3150  _logTime,
3152  _logBuff
3153  );
3154  }
3155 
3156  // Emit the event on the text log port
3157 #if FW_ENABLE_TEXT_LOGGING
3158  if (this->isConnected_LogText_OutputPort(0)) {
3159 #if FW_OBJECT_NAMES == 1
3160  const char* _formatString =
3161  "(%s) %s: Checking size of file %s...";
3162 #else
3163  const char* _formatString =
3164  "%s: Checking size of file %s...";
3165 #endif
3166 
3167  Fw::TextLogString _logString;
3168  _logString.format(
3169  _formatString,
3170 #if FW_OBJECT_NAMES == 1
3171  this->m_objName.toChar(),
3172 #endif
3173  "FileSizeStarted ",
3174  fileName.toChar()
3175  );
3176 
3177  this->LogText_out(
3178  0,
3179  _id,
3180  _logTime,
3182  _logString
3183  );
3184  }
3185 #endif
3186  }
3187 
3190  {
3191  // Get the time
3192  Fw::Time _logTime;
3193  if (this->isConnected_timeCaller_OutputPort(0)) {
3194  this->timeCaller_out(0, _logTime);
3195  }
3196 
3198 
3199  // Emit the event on the log port
3200  if (this->isConnected_eventOut_OutputPort(0)) {
3201  Fw::LogBuffer _logBuff;
3203 
3204 #if FW_AMPCS_COMPATIBLE
3205  // Serialize the number of arguments
3206  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3207  FW_ASSERT(
3208  _status == Fw::FW_SERIALIZE_OK,
3209  static_cast<FwAssertArgType>(_status)
3210  );
3211 #endif
3212 
3213  _status = dirName.serializeTo(
3214  _logBuff,
3215  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
3216  );
3217  FW_ASSERT(
3218  _status == Fw::FW_SERIALIZE_OK,
3219  static_cast<FwAssertArgType>(_status)
3220  );
3221 
3222  this->eventOut_out(
3223  0,
3224  _id,
3225  _logTime,
3227  _logBuff
3228  );
3229  }
3230 
3231  // Emit the event on the text log port
3232 #if FW_ENABLE_TEXT_LOGGING
3233  if (this->isConnected_LogText_OutputPort(0)) {
3234 #if FW_OBJECT_NAMES == 1
3235  const char* _formatString =
3236  "(%s) %s: Listing contents of directory %s...";
3237 #else
3238  const char* _formatString =
3239  "%s: Listing contents of directory %s...";
3240 #endif
3241 
3242  Fw::TextLogString _logString;
3243  _logString.format(
3244  _formatString,
3245 #if FW_OBJECT_NAMES == 1
3246  this->m_objName.toChar(),
3247 #endif
3248  "ListDirectoryStarted ",
3249  dirName.toChar()
3250  );
3251 
3252  this->LogText_out(
3253  0,
3254  _id,
3255  _logTime,
3257  _logString
3258  );
3259  }
3260 #endif
3261  }
3262 
3265  const Fw::StringBase& dirName,
3266  U32 fileCount
3267  ) const
3268  {
3269  // Get the time
3270  Fw::Time _logTime;
3271  if (this->isConnected_timeCaller_OutputPort(0)) {
3272  this->timeCaller_out(0, _logTime);
3273  }
3274 
3276 
3277  // Emit the event on the log port
3278  if (this->isConnected_eventOut_OutputPort(0)) {
3279  Fw::LogBuffer _logBuff;
3281 
3282 #if FW_AMPCS_COMPATIBLE
3283  // Serialize the number of arguments
3284  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3285  FW_ASSERT(
3286  _status == Fw::FW_SERIALIZE_OK,
3287  static_cast<FwAssertArgType>(_status)
3288  );
3289 #endif
3290 
3291  _status = dirName.serializeTo(
3292  _logBuff,
3293  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
3294  );
3295  FW_ASSERT(
3296  _status == Fw::FW_SERIALIZE_OK,
3297  static_cast<FwAssertArgType>(_status)
3298  );
3299 
3300 #if FW_AMPCS_COMPATIBLE
3301  // Serialize the argument size
3302  _status = _logBuff.serializeFrom(
3303  static_cast<U8>(sizeof(U32))
3304  );
3305  FW_ASSERT(
3306  _status == Fw::FW_SERIALIZE_OK,
3307  static_cast<FwAssertArgType>(_status)
3308  );
3309 #endif
3310  _status = _logBuff.serializeFrom(fileCount);
3311  FW_ASSERT(
3312  _status == Fw::FW_SERIALIZE_OK,
3313  static_cast<FwAssertArgType>(_status)
3314  );
3315 
3316  this->eventOut_out(
3317  0,
3318  _id,
3319  _logTime,
3321  _logBuff
3322  );
3323  }
3324 
3325  // Emit the event on the text log port
3326 #if FW_ENABLE_TEXT_LOGGING
3327  if (this->isConnected_LogText_OutputPort(0)) {
3328 #if FW_OBJECT_NAMES == 1
3329  const char* _formatString =
3330  "(%s) %s: Directory %s contains %" PRIu32 " files";
3331 #else
3332  const char* _formatString =
3333  "%s: Directory %s contains %" PRIu32 " files";
3334 #endif
3335 
3336  Fw::TextLogString _logString;
3337  _logString.format(
3338  _formatString,
3339 #if FW_OBJECT_NAMES == 1
3340  this->m_objName.toChar(),
3341 #endif
3342  "ListDirectorySucceeded ",
3343  dirName.toChar(),
3344  fileCount
3345  );
3346 
3347  this->LogText_out(
3348  0,
3349  _id,
3350  _logTime,
3352  _logString
3353  );
3354  }
3355 #endif
3356  }
3357 
3360  const Fw::StringBase& dirName,
3361  U32 status
3362  ) const
3363  {
3364  // Get the time
3365  Fw::Time _logTime;
3366  if (this->isConnected_timeCaller_OutputPort(0)) {
3367  this->timeCaller_out(0, _logTime);
3368  }
3369 
3370  const FwEventIdType _id = this->getIdBase() + EVENTID_LISTDIRECTORYERROR;
3371 
3372  // Emit the event on the log port
3373  if (this->isConnected_eventOut_OutputPort(0)) {
3374  Fw::LogBuffer _logBuff;
3376 
3377 #if FW_AMPCS_COMPATIBLE
3378  // Serialize the number of arguments
3379  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3380  FW_ASSERT(
3381  _status == Fw::FW_SERIALIZE_OK,
3382  static_cast<FwAssertArgType>(_status)
3383  );
3384 #endif
3385 
3386  _status = dirName.serializeTo(
3387  _logBuff,
3388  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
3389  );
3390  FW_ASSERT(
3391  _status == Fw::FW_SERIALIZE_OK,
3392  static_cast<FwAssertArgType>(_status)
3393  );
3394 
3395 #if FW_AMPCS_COMPATIBLE
3396  // Serialize the argument size
3397  _status = _logBuff.serializeFrom(
3398  static_cast<U8>(sizeof(U32))
3399  );
3400  FW_ASSERT(
3401  _status == Fw::FW_SERIALIZE_OK,
3402  static_cast<FwAssertArgType>(_status)
3403  );
3404 #endif
3405  _status = _logBuff.serializeFrom(status);
3406  FW_ASSERT(
3407  _status == Fw::FW_SERIALIZE_OK,
3408  static_cast<FwAssertArgType>(_status)
3409  );
3410 
3411  this->eventOut_out(
3412  0,
3413  _id,
3414  _logTime,
3416  _logBuff
3417  );
3418  }
3419 
3420  // Emit the event on the text log port
3421 #if FW_ENABLE_TEXT_LOGGING
3422  if (this->isConnected_LogText_OutputPort(0)) {
3423 #if FW_OBJECT_NAMES == 1
3424  const char* _formatString =
3425  "(%s) %s: Failed to list directory %s, returned status %" PRIu32 "";
3426 #else
3427  const char* _formatString =
3428  "%s: Failed to list directory %s, returned status %" PRIu32 "";
3429 #endif
3430 
3431  Fw::TextLogString _logString;
3432  _logString.format(
3433  _formatString,
3434 #if FW_OBJECT_NAMES == 1
3435  this->m_objName.toChar(),
3436 #endif
3437  "ListDirectoryError ",
3438  dirName.toChar(),
3439  status
3440  );
3441 
3442  this->LogText_out(
3443  0,
3444  _id,
3445  _logTime,
3447  _logString
3448  );
3449  }
3450 #endif
3451  }
3452 
3455  const Fw::StringBase& dirName,
3456  const Fw::StringBase& fileName,
3457  FwSizeType fileSize
3458  ) const
3459  {
3460  // Get the time
3461  Fw::Time _logTime;
3462  if (this->isConnected_timeCaller_OutputPort(0)) {
3463  this->timeCaller_out(0, _logTime);
3464  }
3465 
3466  const FwEventIdType _id = this->getIdBase() + EVENTID_DIRECTORYLISTING;
3467 
3468  // Emit the event on the log port
3469  if (this->isConnected_eventOut_OutputPort(0)) {
3470  Fw::LogBuffer _logBuff;
3472 
3473 #if FW_AMPCS_COMPATIBLE
3474  // Serialize the number of arguments
3475  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3476  FW_ASSERT(
3477  _status == Fw::FW_SERIALIZE_OK,
3478  static_cast<FwAssertArgType>(_status)
3479  );
3480 #endif
3481 
3482  _status = dirName.serializeTo(
3483  _logBuff,
3484  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
3485  );
3486  FW_ASSERT(
3487  _status == Fw::FW_SERIALIZE_OK,
3488  static_cast<FwAssertArgType>(_status)
3489  );
3490 
3491  _status = fileName.serializeTo(
3492  _logBuff,
3493  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
3494  );
3495  FW_ASSERT(
3496  _status == Fw::FW_SERIALIZE_OK,
3497  static_cast<FwAssertArgType>(_status)
3498  );
3499 
3500 #if FW_AMPCS_COMPATIBLE
3501  // Serialize the argument size
3502  _status = _logBuff.serializeFrom(
3503  static_cast<U8>(sizeof(FwSizeType))
3504  );
3505  FW_ASSERT(
3506  _status == Fw::FW_SERIALIZE_OK,
3507  static_cast<FwAssertArgType>(_status)
3508  );
3509 #endif
3510  _status = _logBuff.serializeFrom(fileSize);
3511  FW_ASSERT(
3512  _status == Fw::FW_SERIALIZE_OK,
3513  static_cast<FwAssertArgType>(_status)
3514  );
3515 
3516  this->eventOut_out(
3517  0,
3518  _id,
3519  _logTime,
3521  _logBuff
3522  );
3523  }
3524 
3525  // Emit the event on the text log port
3526 #if FW_ENABLE_TEXT_LOGGING
3527  if (this->isConnected_LogText_OutputPort(0)) {
3528 #if FW_OBJECT_NAMES == 1
3529  const char* _formatString =
3530  "(%s) %s: Directory %s: %s (%" PRIu64 " bytes)";
3531 #else
3532  const char* _formatString =
3533  "%s: Directory %s: %s (%" PRIu64 " bytes)";
3534 #endif
3535 
3536  Fw::TextLogString _logString;
3537  _logString.format(
3538  _formatString,
3539 #if FW_OBJECT_NAMES == 1
3540  this->m_objName.toChar(),
3541 #endif
3542  "DirectoryListing ",
3543  dirName.toChar(),
3544  fileName.toChar(),
3545  fileSize
3546  );
3547 
3548  this->LogText_out(
3549  0,
3550  _id,
3551  _logTime,
3553  _logString
3554  );
3555  }
3556 #endif
3557  }
3558 
3561  const Fw::StringBase& dirName,
3562  const Fw::StringBase& subdirName
3563  ) const
3564  {
3565  // Get the time
3566  Fw::Time _logTime;
3567  if (this->isConnected_timeCaller_OutputPort(0)) {
3568  this->timeCaller_out(0, _logTime);
3569  }
3570 
3572 
3573  // Emit the event on the log port
3574  if (this->isConnected_eventOut_OutputPort(0)) {
3575  Fw::LogBuffer _logBuff;
3577 
3578 #if FW_AMPCS_COMPATIBLE
3579  // Serialize the number of arguments
3580  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3581  FW_ASSERT(
3582  _status == Fw::FW_SERIALIZE_OK,
3583  static_cast<FwAssertArgType>(_status)
3584  );
3585 #endif
3586 
3587  _status = dirName.serializeTo(
3588  _logBuff,
3589  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
3590  );
3591  FW_ASSERT(
3592  _status == Fw::FW_SERIALIZE_OK,
3593  static_cast<FwAssertArgType>(_status)
3594  );
3595 
3596  _status = subdirName.serializeTo(
3597  _logBuff,
3598  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
3599  );
3600  FW_ASSERT(
3601  _status == Fw::FW_SERIALIZE_OK,
3602  static_cast<FwAssertArgType>(_status)
3603  );
3604 
3605  this->eventOut_out(
3606  0,
3607  _id,
3608  _logTime,
3610  _logBuff
3611  );
3612  }
3613 
3614  // Emit the event on the text log port
3615 #if FW_ENABLE_TEXT_LOGGING
3616  if (this->isConnected_LogText_OutputPort(0)) {
3617 #if FW_OBJECT_NAMES == 1
3618  const char* _formatString =
3619  "(%s) %s: Directory %s: %s";
3620 #else
3621  const char* _formatString =
3622  "%s: Directory %s: %s";
3623 #endif
3624 
3625  Fw::TextLogString _logString;
3626  _logString.format(
3627  _formatString,
3628 #if FW_OBJECT_NAMES == 1
3629  this->m_objName.toChar(),
3630 #endif
3631  "DirectoryListingSubdir ",
3632  dirName.toChar(),
3633  subdirName.toChar()
3634  );
3635 
3636  this->LogText_out(
3637  0,
3638  _id,
3639  _logTime,
3641  _logString
3642  );
3643  }
3644 #endif
3645  }
3646 
3649  {
3650  // Get the time
3651  Fw::Time _logTime;
3652  if (this->isConnected_timeCaller_OutputPort(0)) {
3653  this->timeCaller_out(0, _logTime);
3654  }
3655 
3656  const FwEventIdType _id = this->getIdBase() + EVENTID_CALCULATECRCSTARTED;
3657 
3658  // Emit the event on the log port
3659  if (this->isConnected_eventOut_OutputPort(0)) {
3660  Fw::LogBuffer _logBuff;
3662 
3663 #if FW_AMPCS_COMPATIBLE
3664  // Serialize the number of arguments
3665  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3666  FW_ASSERT(
3667  _status == Fw::FW_SERIALIZE_OK,
3668  static_cast<FwAssertArgType>(_status)
3669  );
3670 #endif
3671 
3672  _status = fileName.serializeTo(
3673  _logBuff,
3674  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
3675  );
3676  FW_ASSERT(
3677  _status == Fw::FW_SERIALIZE_OK,
3678  static_cast<FwAssertArgType>(_status)
3679  );
3680 
3681  this->eventOut_out(
3682  0,
3683  _id,
3684  _logTime,
3686  _logBuff
3687  );
3688  }
3689 
3690  // Emit the event on the text log port
3691 #if FW_ENABLE_TEXT_LOGGING
3692  if (this->isConnected_LogText_OutputPort(0)) {
3693 #if FW_OBJECT_NAMES == 1
3694  const char* _formatString =
3695  "(%s) %s: Started CRC calculation for file %s";
3696 #else
3697  const char* _formatString =
3698  "%s: Started CRC calculation for file %s";
3699 #endif
3700 
3701  Fw::TextLogString _logString;
3702  _logString.format(
3703  _formatString,
3704 #if FW_OBJECT_NAMES == 1
3705  this->m_objName.toChar(),
3706 #endif
3707  "CalculateCrcStarted ",
3708  fileName.toChar()
3709  );
3710 
3711  this->LogText_out(
3712  0,
3713  _id,
3714  _logTime,
3716  _logString
3717  );
3718  }
3719 #endif
3720  }
3721 
3724  const Fw::StringBase& fileName,
3725  U32 status
3726  ) const
3727  {
3728  // Get the time
3729  Fw::Time _logTime;
3730  if (this->isConnected_timeCaller_OutputPort(0)) {
3731  this->timeCaller_out(0, _logTime);
3732  }
3733 
3734  const FwEventIdType _id = this->getIdBase() + EVENTID_CALCULATECRCFAILED;
3735 
3736  // Emit the event on the log port
3737  if (this->isConnected_eventOut_OutputPort(0)) {
3738  Fw::LogBuffer _logBuff;
3740 
3741 #if FW_AMPCS_COMPATIBLE
3742  // Serialize the number of arguments
3743  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3744  FW_ASSERT(
3745  _status == Fw::FW_SERIALIZE_OK,
3746  static_cast<FwAssertArgType>(_status)
3747  );
3748 #endif
3749 
3750  _status = fileName.serializeTo(
3751  _logBuff,
3752  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
3753  );
3754  FW_ASSERT(
3755  _status == Fw::FW_SERIALIZE_OK,
3756  static_cast<FwAssertArgType>(_status)
3757  );
3758 
3759 #if FW_AMPCS_COMPATIBLE
3760  // Serialize the argument size
3761  _status = _logBuff.serializeFrom(
3762  static_cast<U8>(sizeof(U32))
3763  );
3764  FW_ASSERT(
3765  _status == Fw::FW_SERIALIZE_OK,
3766  static_cast<FwAssertArgType>(_status)
3767  );
3768 #endif
3769  _status = _logBuff.serializeFrom(status);
3770  FW_ASSERT(
3771  _status == Fw::FW_SERIALIZE_OK,
3772  static_cast<FwAssertArgType>(_status)
3773  );
3774 
3775  this->eventOut_out(
3776  0,
3777  _id,
3778  _logTime,
3780  _logBuff
3781  );
3782  }
3783 
3784  // Emit the event on the text log port
3785 #if FW_ENABLE_TEXT_LOGGING
3786  if (this->isConnected_LogText_OutputPort(0)) {
3787 #if FW_OBJECT_NAMES == 1
3788  const char* _formatString =
3789  "(%s) %s: Failed CRC calculation for file %s, returned status %" PRIu32 "";
3790 #else
3791  const char* _formatString =
3792  "%s: Failed CRC calculation for file %s, returned status %" PRIu32 "";
3793 #endif
3794 
3795  Fw::TextLogString _logString;
3796  _logString.format(
3797  _formatString,
3798 #if FW_OBJECT_NAMES == 1
3799  this->m_objName.toChar(),
3800 #endif
3801  "CalculateCrcFailed ",
3802  fileName.toChar(),
3803  status
3804  );
3805 
3806  this->LogText_out(
3807  0,
3808  _id,
3809  _logTime,
3811  _logString
3812  );
3813  }
3814 #endif
3815  }
3816 
3819  const Fw::StringBase& fileName,
3820  U32 crc
3821  ) const
3822  {
3823  // Get the time
3824  Fw::Time _logTime;
3825  if (this->isConnected_timeCaller_OutputPort(0)) {
3826  this->timeCaller_out(0, _logTime);
3827  }
3828 
3830 
3831  // Emit the event on the log port
3832  if (this->isConnected_eventOut_OutputPort(0)) {
3833  Fw::LogBuffer _logBuff;
3835 
3836 #if FW_AMPCS_COMPATIBLE
3837  // Serialize the number of arguments
3838  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3839  FW_ASSERT(
3840  _status == Fw::FW_SERIALIZE_OK,
3841  static_cast<FwAssertArgType>(_status)
3842  );
3843 #endif
3844 
3845  _status = fileName.serializeTo(
3846  _logBuff,
3847  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 200)
3848  );
3849  FW_ASSERT(
3850  _status == Fw::FW_SERIALIZE_OK,
3851  static_cast<FwAssertArgType>(_status)
3852  );
3853 
3854 #if FW_AMPCS_COMPATIBLE
3855  // Serialize the argument size
3856  _status = _logBuff.serializeFrom(
3857  static_cast<U8>(sizeof(U32))
3858  );
3859  FW_ASSERT(
3860  _status == Fw::FW_SERIALIZE_OK,
3861  static_cast<FwAssertArgType>(_status)
3862  );
3863 #endif
3864  _status = _logBuff.serializeFrom(crc);
3865  FW_ASSERT(
3866  _status == Fw::FW_SERIALIZE_OK,
3867  static_cast<FwAssertArgType>(_status)
3868  );
3869 
3870  this->eventOut_out(
3871  0,
3872  _id,
3873  _logTime,
3875  _logBuff
3876  );
3877  }
3878 
3879  // Emit the event on the text log port
3880 #if FW_ENABLE_TEXT_LOGGING
3881  if (this->isConnected_LogText_OutputPort(0)) {
3882 #if FW_OBJECT_NAMES == 1
3883  const char* _formatString =
3884  "(%s) %s: %s has CRC value 0x%" PRIx32 "";
3885 #else
3886  const char* _formatString =
3887  "%s: %s has CRC value 0x%" PRIx32 "";
3888 #endif
3889 
3890  Fw::TextLogString _logString;
3891  _logString.format(
3892  _formatString,
3893 #if FW_OBJECT_NAMES == 1
3894  this->m_objName.toChar(),
3895 #endif
3896  "CalculateCrcSucceeded ",
3897  fileName.toChar(),
3898  crc
3899  );
3900 
3901  this->LogText_out(
3902  0,
3903  _id,
3904  _logTime,
3906  _logString
3907  );
3908  }
3909 #endif
3910  }
3911 
3912  // ----------------------------------------------------------------------
3913  // Telemetry write functions
3914  // ----------------------------------------------------------------------
3915 
3918  U32 arg,
3919  Fw::Time _tlmTime
3920  ) const
3921  {
3922  if (this->isConnected_tlmOut_OutputPort(0)) {
3923  if (
3925  (_tlmTime == Fw::ZERO_TIME)
3926  ) {
3927  this->timeCaller_out(0, _tlmTime);
3928  }
3929 
3930  Fw::TlmBuffer _tlmBuff;
3931  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
3932  FW_ASSERT(
3933  _stat == Fw::FW_SERIALIZE_OK,
3934  static_cast<FwAssertArgType>(_stat)
3935  );
3936 
3937  FwChanIdType _id;
3938 
3939  _id = this->getIdBase() + CHANNELID_COMMANDSEXECUTED;
3940 
3941  this->tlmOut_out(
3942  0,
3943  _id,
3944  _tlmTime,
3945  _tlmBuff
3946  );
3947  }
3948  }
3949 
3952  U32 arg,
3953  Fw::Time _tlmTime
3954  ) const
3955  {
3956  if (this->isConnected_tlmOut_OutputPort(0)) {
3957  if (
3959  (_tlmTime == Fw::ZERO_TIME)
3960  ) {
3961  this->timeCaller_out(0, _tlmTime);
3962  }
3963 
3964  Fw::TlmBuffer _tlmBuff;
3965  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
3966  FW_ASSERT(
3967  _stat == Fw::FW_SERIALIZE_OK,
3968  static_cast<FwAssertArgType>(_stat)
3969  );
3970 
3971  FwChanIdType _id;
3972 
3973  _id = this->getIdBase() + CHANNELID_ERRORS;
3974 
3975  this->tlmOut_out(
3976  0,
3977  _id,
3978  _tlmTime,
3979  _tlmBuff
3980  );
3981  }
3982  }
3983 
3984  // ----------------------------------------------------------------------
3985  // Time
3986  // ----------------------------------------------------------------------
3987 
3989  getTime() const
3990  {
3991  if (this->isConnected_timeCaller_OutputPort(0)) {
3992  Fw::Time _time;
3993  this->timeCaller_out(0, _time);
3994  return _time;
3995  }
3996  else {
3997  return Fw::Time(TimeBase::TB_NONE, 0, 0);
3998  }
3999  }
4000 
4001  // ----------------------------------------------------------------------
4002  // Message dispatch functions
4003  // ----------------------------------------------------------------------
4004 
4005  Fw::QueuedComponentBase::MsgDispatchStatus FileManagerComponentBase ::
4006  doDispatch()
4007  {
4008  ComponentIpcSerializableBuffer _msg;
4009  FwQueuePriorityType _priority = 0;
4010 
4011  Os::Queue::Status _msgStatus = this->m_queue.receive(
4012  _msg,
4014  _priority
4015  );
4016  FW_ASSERT(
4017  _msgStatus == Os::Queue::OP_OK,
4018  static_cast<FwAssertArgType>(_msgStatus)
4019  );
4020 
4021  // Reset to beginning of buffer
4022  _msg.resetDeser();
4023 
4024  FwEnumStoreType _desMsg = 0;
4025  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
4026  FW_ASSERT(
4027  _deserStatus == Fw::FW_SERIALIZE_OK,
4028  static_cast<FwAssertArgType>(_deserStatus)
4029  );
4030 
4031  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
4032 
4033  if (_msgType == FILEMANAGER_COMPONENT_EXIT) {
4034  return MSG_DISPATCH_EXIT;
4035  }
4036 
4037  FwIndexType portNum = 0;
4038  _deserStatus = _msg.deserializeTo(portNum);
4039  FW_ASSERT(
4040  _deserStatus == Fw::FW_SERIALIZE_OK,
4041  static_cast<FwAssertArgType>(_deserStatus)
4042  );
4043 
4044  switch (_msgType) {
4045  // Handle async input port pingIn
4046  case PINGIN_PING: {
4047  // Deserialize argument key
4048  U32 key;
4049  _deserStatus = _msg.deserializeTo(key);
4050  FW_ASSERT(
4051  _deserStatus == Fw::FW_SERIALIZE_OK,
4052  static_cast<FwAssertArgType>(_deserStatus)
4053  );
4054  // Call handler function
4055  this->pingIn_handler(
4056  portNum,
4057  key
4058  );
4059 
4060  break;
4061  }
4062 
4063  // Handle command CreateDirectory
4064  case CMD_CREATEDIRECTORY: {
4065  // Deserialize opcode
4066  FwOpcodeType _opCode = 0;
4067  _deserStatus = _msg.deserializeTo(_opCode);
4068  FW_ASSERT (
4069  _deserStatus == Fw::FW_SERIALIZE_OK,
4070  static_cast<FwAssertArgType>(_deserStatus)
4071  );
4072 
4073  // Deserialize command sequence
4074  U32 _cmdSeq = 0;
4075  _deserStatus = _msg.deserializeTo(_cmdSeq);
4076  FW_ASSERT (
4077  _deserStatus == Fw::FW_SERIALIZE_OK,
4078  static_cast<FwAssertArgType>(_deserStatus)
4079  );
4080 
4081  // Deserialize command argument buffer
4082  Fw::CmdArgBuffer args;
4083  _deserStatus = _msg.deserializeTo(args);
4084  FW_ASSERT (
4085  _deserStatus == Fw::FW_SERIALIZE_OK,
4086  static_cast<FwAssertArgType>(_deserStatus)
4087  );
4088 
4089  // Reset buffer
4090  args.resetDeser();
4091 
4092  // Deserialize argument dirName
4093  Fw::CmdStringArg dirName;
4094  _deserStatus = args.deserializeTo(dirName);
4095  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4097  this->cmdResponse_out(
4098  _opCode,
4099  _cmdSeq,
4101  );
4102  }
4103  // Don't crash the task if bad arguments were passed from the ground
4104  break;
4105  }
4106 
4107  // Make sure there was no data left over.
4108  // That means the argument buffer size was incorrect.
4109 #if FW_CMD_CHECK_RESIDUAL
4110  if (args.getDeserializeSizeLeft() != 0) {
4112  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4113  }
4114  // Don't crash the task if bad arguments were passed from the ground
4115  break;
4116  }
4117 #endif
4118 
4119  // Call handler function
4121  _opCode, _cmdSeq,
4122  dirName
4123  );
4124 
4125  break;
4126  }
4127 
4128  // Handle command MoveFile
4129  case CMD_MOVEFILE: {
4130  // Deserialize opcode
4131  FwOpcodeType _opCode = 0;
4132  _deserStatus = _msg.deserializeTo(_opCode);
4133  FW_ASSERT (
4134  _deserStatus == Fw::FW_SERIALIZE_OK,
4135  static_cast<FwAssertArgType>(_deserStatus)
4136  );
4137 
4138  // Deserialize command sequence
4139  U32 _cmdSeq = 0;
4140  _deserStatus = _msg.deserializeTo(_cmdSeq);
4141  FW_ASSERT (
4142  _deserStatus == Fw::FW_SERIALIZE_OK,
4143  static_cast<FwAssertArgType>(_deserStatus)
4144  );
4145 
4146  // Deserialize command argument buffer
4147  Fw::CmdArgBuffer args;
4148  _deserStatus = _msg.deserializeTo(args);
4149  FW_ASSERT (
4150  _deserStatus == Fw::FW_SERIALIZE_OK,
4151  static_cast<FwAssertArgType>(_deserStatus)
4152  );
4153 
4154  // Reset buffer
4155  args.resetDeser();
4156 
4157  // Deserialize argument sourceFileName
4158  Fw::CmdStringArg sourceFileName;
4159  _deserStatus = args.deserializeTo(sourceFileName);
4160  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4162  this->cmdResponse_out(
4163  _opCode,
4164  _cmdSeq,
4166  );
4167  }
4168  // Don't crash the task if bad arguments were passed from the ground
4169  break;
4170  }
4171 
4172  // Deserialize argument destFileName
4173  Fw::CmdStringArg destFileName;
4174  _deserStatus = args.deserializeTo(destFileName);
4175  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4177  this->cmdResponse_out(
4178  _opCode,
4179  _cmdSeq,
4181  );
4182  }
4183  // Don't crash the task if bad arguments were passed from the ground
4184  break;
4185  }
4186 
4187  // Make sure there was no data left over.
4188  // That means the argument buffer size was incorrect.
4189 #if FW_CMD_CHECK_RESIDUAL
4190  if (args.getDeserializeSizeLeft() != 0) {
4192  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4193  }
4194  // Don't crash the task if bad arguments were passed from the ground
4195  break;
4196  }
4197 #endif
4198 
4199  // Call handler function
4200  this->MoveFile_cmdHandler(
4201  _opCode, _cmdSeq,
4202  sourceFileName,
4203  destFileName
4204  );
4205 
4206  break;
4207  }
4208 
4209  // Handle command RemoveDirectory
4210  case CMD_REMOVEDIRECTORY: {
4211  // Deserialize opcode
4212  FwOpcodeType _opCode = 0;
4213  _deserStatus = _msg.deserializeTo(_opCode);
4214  FW_ASSERT (
4215  _deserStatus == Fw::FW_SERIALIZE_OK,
4216  static_cast<FwAssertArgType>(_deserStatus)
4217  );
4218 
4219  // Deserialize command sequence
4220  U32 _cmdSeq = 0;
4221  _deserStatus = _msg.deserializeTo(_cmdSeq);
4222  FW_ASSERT (
4223  _deserStatus == Fw::FW_SERIALIZE_OK,
4224  static_cast<FwAssertArgType>(_deserStatus)
4225  );
4226 
4227  // Deserialize command argument buffer
4228  Fw::CmdArgBuffer args;
4229  _deserStatus = _msg.deserializeTo(args);
4230  FW_ASSERT (
4231  _deserStatus == Fw::FW_SERIALIZE_OK,
4232  static_cast<FwAssertArgType>(_deserStatus)
4233  );
4234 
4235  // Reset buffer
4236  args.resetDeser();
4237 
4238  // Deserialize argument dirName
4239  Fw::CmdStringArg dirName;
4240  _deserStatus = args.deserializeTo(dirName);
4241  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4243  this->cmdResponse_out(
4244  _opCode,
4245  _cmdSeq,
4247  );
4248  }
4249  // Don't crash the task if bad arguments were passed from the ground
4250  break;
4251  }
4252 
4253  // Make sure there was no data left over.
4254  // That means the argument buffer size was incorrect.
4255 #if FW_CMD_CHECK_RESIDUAL
4256  if (args.getDeserializeSizeLeft() != 0) {
4258  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4259  }
4260  // Don't crash the task if bad arguments were passed from the ground
4261  break;
4262  }
4263 #endif
4264 
4265  // Call handler function
4267  _opCode, _cmdSeq,
4268  dirName
4269  );
4270 
4271  break;
4272  }
4273 
4274  // Handle command RemoveFile
4275  case CMD_REMOVEFILE: {
4276  // Deserialize opcode
4277  FwOpcodeType _opCode = 0;
4278  _deserStatus = _msg.deserializeTo(_opCode);
4279  FW_ASSERT (
4280  _deserStatus == Fw::FW_SERIALIZE_OK,
4281  static_cast<FwAssertArgType>(_deserStatus)
4282  );
4283 
4284  // Deserialize command sequence
4285  U32 _cmdSeq = 0;
4286  _deserStatus = _msg.deserializeTo(_cmdSeq);
4287  FW_ASSERT (
4288  _deserStatus == Fw::FW_SERIALIZE_OK,
4289  static_cast<FwAssertArgType>(_deserStatus)
4290  );
4291 
4292  // Deserialize command argument buffer
4293  Fw::CmdArgBuffer args;
4294  _deserStatus = _msg.deserializeTo(args);
4295  FW_ASSERT (
4296  _deserStatus == Fw::FW_SERIALIZE_OK,
4297  static_cast<FwAssertArgType>(_deserStatus)
4298  );
4299 
4300  // Reset buffer
4301  args.resetDeser();
4302 
4303  // Deserialize argument fileName
4304  Fw::CmdStringArg fileName;
4305  _deserStatus = args.deserializeTo(fileName);
4306  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4308  this->cmdResponse_out(
4309  _opCode,
4310  _cmdSeq,
4312  );
4313  }
4314  // Don't crash the task if bad arguments were passed from the ground
4315  break;
4316  }
4317 
4318  // Deserialize argument ignoreErrors
4319  bool ignoreErrors;
4320  _deserStatus = args.deserializeTo(ignoreErrors);
4321  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4323  this->cmdResponse_out(
4324  _opCode,
4325  _cmdSeq,
4327  );
4328  }
4329  // Don't crash the task if bad arguments were passed from the ground
4330  break;
4331  }
4332 
4333  // Make sure there was no data left over.
4334  // That means the argument buffer size was incorrect.
4335 #if FW_CMD_CHECK_RESIDUAL
4336  if (args.getDeserializeSizeLeft() != 0) {
4338  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4339  }
4340  // Don't crash the task if bad arguments were passed from the ground
4341  break;
4342  }
4343 #endif
4344 
4345  // Call handler function
4346  this->RemoveFile_cmdHandler(
4347  _opCode, _cmdSeq,
4348  fileName,
4349  ignoreErrors
4350  );
4351 
4352  break;
4353  }
4354 
4355  // Handle command AppendFile
4356  case CMD_APPENDFILE: {
4357  // Deserialize opcode
4358  FwOpcodeType _opCode = 0;
4359  _deserStatus = _msg.deserializeTo(_opCode);
4360  FW_ASSERT (
4361  _deserStatus == Fw::FW_SERIALIZE_OK,
4362  static_cast<FwAssertArgType>(_deserStatus)
4363  );
4364 
4365  // Deserialize command sequence
4366  U32 _cmdSeq = 0;
4367  _deserStatus = _msg.deserializeTo(_cmdSeq);
4368  FW_ASSERT (
4369  _deserStatus == Fw::FW_SERIALIZE_OK,
4370  static_cast<FwAssertArgType>(_deserStatus)
4371  );
4372 
4373  // Deserialize command argument buffer
4374  Fw::CmdArgBuffer args;
4375  _deserStatus = _msg.deserializeTo(args);
4376  FW_ASSERT (
4377  _deserStatus == Fw::FW_SERIALIZE_OK,
4378  static_cast<FwAssertArgType>(_deserStatus)
4379  );
4380 
4381  // Reset buffer
4382  args.resetDeser();
4383 
4384  // Deserialize argument source
4385  Fw::CmdStringArg source;
4386  _deserStatus = args.deserializeTo(source);
4387  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4389  this->cmdResponse_out(
4390  _opCode,
4391  _cmdSeq,
4393  );
4394  }
4395  // Don't crash the task if bad arguments were passed from the ground
4396  break;
4397  }
4398 
4399  // Deserialize argument target
4400  Fw::CmdStringArg target;
4401  _deserStatus = args.deserializeTo(target);
4402  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4404  this->cmdResponse_out(
4405  _opCode,
4406  _cmdSeq,
4408  );
4409  }
4410  // Don't crash the task if bad arguments were passed from the ground
4411  break;
4412  }
4413 
4414  // Make sure there was no data left over.
4415  // That means the argument buffer size was incorrect.
4416 #if FW_CMD_CHECK_RESIDUAL
4417  if (args.getDeserializeSizeLeft() != 0) {
4419  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4420  }
4421  // Don't crash the task if bad arguments were passed from the ground
4422  break;
4423  }
4424 #endif
4425 
4426  // Call handler function
4427  this->AppendFile_cmdHandler(
4428  _opCode, _cmdSeq,
4429  source,
4430  target
4431  );
4432 
4433  break;
4434  }
4435 
4436  // Handle command FileSize
4437  case CMD_FILESIZE: {
4438  // Deserialize opcode
4439  FwOpcodeType _opCode = 0;
4440  _deserStatus = _msg.deserializeTo(_opCode);
4441  FW_ASSERT (
4442  _deserStatus == Fw::FW_SERIALIZE_OK,
4443  static_cast<FwAssertArgType>(_deserStatus)
4444  );
4445 
4446  // Deserialize command sequence
4447  U32 _cmdSeq = 0;
4448  _deserStatus = _msg.deserializeTo(_cmdSeq);
4449  FW_ASSERT (
4450  _deserStatus == Fw::FW_SERIALIZE_OK,
4451  static_cast<FwAssertArgType>(_deserStatus)
4452  );
4453 
4454  // Deserialize command argument buffer
4455  Fw::CmdArgBuffer args;
4456  _deserStatus = _msg.deserializeTo(args);
4457  FW_ASSERT (
4458  _deserStatus == Fw::FW_SERIALIZE_OK,
4459  static_cast<FwAssertArgType>(_deserStatus)
4460  );
4461 
4462  // Reset buffer
4463  args.resetDeser();
4464 
4465  // Deserialize argument fileName
4466  Fw::CmdStringArg fileName;
4467  _deserStatus = args.deserializeTo(fileName);
4468  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4470  this->cmdResponse_out(
4471  _opCode,
4472  _cmdSeq,
4474  );
4475  }
4476  // Don't crash the task if bad arguments were passed from the ground
4477  break;
4478  }
4479 
4480  // Make sure there was no data left over.
4481  // That means the argument buffer size was incorrect.
4482 #if FW_CMD_CHECK_RESIDUAL
4483  if (args.getDeserializeSizeLeft() != 0) {
4485  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4486  }
4487  // Don't crash the task if bad arguments were passed from the ground
4488  break;
4489  }
4490 #endif
4491 
4492  // Call handler function
4493  this->FileSize_cmdHandler(
4494  _opCode, _cmdSeq,
4495  fileName
4496  );
4497 
4498  break;
4499  }
4500 
4501  // Handle command ListDirectory
4502  case CMD_LISTDIRECTORY: {
4503  // Deserialize opcode
4504  FwOpcodeType _opCode = 0;
4505  _deserStatus = _msg.deserializeTo(_opCode);
4506  FW_ASSERT (
4507  _deserStatus == Fw::FW_SERIALIZE_OK,
4508  static_cast<FwAssertArgType>(_deserStatus)
4509  );
4510 
4511  // Deserialize command sequence
4512  U32 _cmdSeq = 0;
4513  _deserStatus = _msg.deserializeTo(_cmdSeq);
4514  FW_ASSERT (
4515  _deserStatus == Fw::FW_SERIALIZE_OK,
4516  static_cast<FwAssertArgType>(_deserStatus)
4517  );
4518 
4519  // Deserialize command argument buffer
4520  Fw::CmdArgBuffer args;
4521  _deserStatus = _msg.deserializeTo(args);
4522  FW_ASSERT (
4523  _deserStatus == Fw::FW_SERIALIZE_OK,
4524  static_cast<FwAssertArgType>(_deserStatus)
4525  );
4526 
4527  // Reset buffer
4528  args.resetDeser();
4529 
4530  // Deserialize argument dirName
4531  Fw::CmdStringArg dirName;
4532  _deserStatus = args.deserializeTo(dirName);
4533  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4535  this->cmdResponse_out(
4536  _opCode,
4537  _cmdSeq,
4539  );
4540  }
4541  // Don't crash the task if bad arguments were passed from the ground
4542  break;
4543  }
4544 
4545  // Make sure there was no data left over.
4546  // That means the argument buffer size was incorrect.
4547 #if FW_CMD_CHECK_RESIDUAL
4548  if (args.getDeserializeSizeLeft() != 0) {
4550  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4551  }
4552  // Don't crash the task if bad arguments were passed from the ground
4553  break;
4554  }
4555 #endif
4556 
4557  // Call handler function
4559  _opCode, _cmdSeq,
4560  dirName
4561  );
4562 
4563  break;
4564  }
4565 
4566  // Handle command CalculateCrc
4567  case CMD_CALCULATECRC: {
4568  // Deserialize opcode
4569  FwOpcodeType _opCode = 0;
4570  _deserStatus = _msg.deserializeTo(_opCode);
4571  FW_ASSERT (
4572  _deserStatus == Fw::FW_SERIALIZE_OK,
4573  static_cast<FwAssertArgType>(_deserStatus)
4574  );
4575 
4576  // Deserialize command sequence
4577  U32 _cmdSeq = 0;
4578  _deserStatus = _msg.deserializeTo(_cmdSeq);
4579  FW_ASSERT (
4580  _deserStatus == Fw::FW_SERIALIZE_OK,
4581  static_cast<FwAssertArgType>(_deserStatus)
4582  );
4583 
4584  // Deserialize command argument buffer
4585  Fw::CmdArgBuffer args;
4586  _deserStatus = _msg.deserializeTo(args);
4587  FW_ASSERT (
4588  _deserStatus == Fw::FW_SERIALIZE_OK,
4589  static_cast<FwAssertArgType>(_deserStatus)
4590  );
4591 
4592  // Reset buffer
4593  args.resetDeser();
4594 
4595  // Deserialize argument filename
4596  Fw::CmdStringArg filename;
4597  _deserStatus = args.deserializeTo(filename);
4598  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4600  this->cmdResponse_out(
4601  _opCode,
4602  _cmdSeq,
4604  );
4605  }
4606  // Don't crash the task if bad arguments were passed from the ground
4607  break;
4608  }
4609 
4610  // Make sure there was no data left over.
4611  // That means the argument buffer size was incorrect.
4612 #if FW_CMD_CHECK_RESIDUAL
4613  if (args.getDeserializeSizeLeft() != 0) {
4615  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4616  }
4617  // Don't crash the task if bad arguments were passed from the ground
4618  break;
4619  }
4620 #endif
4621 
4622  // Call handler function
4624  _opCode, _cmdSeq,
4625  filename
4626  );
4627 
4628  break;
4629  }
4630 
4631  // Handle internal interface run
4632  case INT_IF_RUN: {
4633  // Make sure there was no data left over.
4634  // That means the buffer size was incorrect.
4635  FW_ASSERT(
4636  _msg.getDeserializeSizeLeft() == 0,
4637  static_cast<FwAssertArgType>(_msg.getDeserializeSizeLeft())
4638  );
4639 
4640  // Call handler function
4642 
4643  break;
4644  }
4645 
4646  default:
4647  return MSG_DISPATCH_ERROR;
4648  }
4649 
4650  return MSG_DISPATCH_OK;
4651  }
4652 
4653  // ----------------------------------------------------------------------
4654  // Calls for messages received on special input ports
4655  // ----------------------------------------------------------------------
4656 
4657  void FileManagerComponentBase ::
4658  m_p_cmdIn_in(
4659  Fw::PassiveComponentBase* callComp,
4660  FwIndexType portNum,
4661  FwOpcodeType opCode,
4662  U32 cmdSeq,
4663  Fw::CmdArgBuffer& args
4664  )
4665  {
4666  FW_ASSERT(callComp);
4667  FileManagerComponentBase* compPtr = static_cast<FileManagerComponentBase*>(callComp);
4668  compPtr->cmdIn_handlerBase(
4669  portNum,
4670  opCode,
4671  cmdSeq,
4672  args
4673  );
4674  }
4675 
4676  // ----------------------------------------------------------------------
4677  // Calls for messages received on typed input ports
4678  // ----------------------------------------------------------------------
4679 
4680  void FileManagerComponentBase ::
4681  m_p_pingIn_in(
4682  Fw::PassiveComponentBase* callComp,
4683  FwIndexType portNum,
4684  U32 key
4685  )
4686  {
4687  FW_ASSERT(callComp);
4688  FileManagerComponentBase* compPtr = static_cast<FileManagerComponentBase*>(callComp);
4689  compPtr->pingIn_handlerBase(
4690  portNum,
4691  key
4692  );
4693  }
4694 
4695  void FileManagerComponentBase ::
4696  m_p_schedIn_in(
4697  Fw::PassiveComponentBase* callComp,
4698  FwIndexType portNum,
4699  U32 context
4700  )
4701  {
4702  FW_ASSERT(callComp);
4703  FileManagerComponentBase* compPtr = static_cast<FileManagerComponentBase*>(callComp);
4704  compPtr->schedIn_handlerBase(
4705  portNum,
4706  context
4707  );
4708  }
4709 
4710 #if !FW_DIRECT_PORT_CALLS
4711 
4712  // ----------------------------------------------------------------------
4713  // Invocation functions for special output ports
4714  // ----------------------------------------------------------------------
4715 
4716 #if FW_ENABLE_TEXT_LOGGING
4717 
4718  void FileManagerComponentBase ::
4719  LogText_out(
4720  FwIndexType portNum,
4721  FwEventIdType id,
4722  Fw::Time& timeTag,
4723  const Fw::LogSeverity& severity,
4724  Fw::TextLogString& text
4725  ) const
4726  {
4727  FW_ASSERT(
4728  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
4729  static_cast<FwAssertArgType>(portNum)
4730  );
4731 
4732  FW_ASSERT(
4733  this->m_LogText_OutputPort[portNum].isConnected(),
4734  static_cast<FwAssertArgType>(portNum)
4735  );
4736  this->m_LogText_OutputPort[portNum].invoke(
4737  id,
4738  timeTag,
4739  severity,
4740  text
4741  );
4742  }
4743 
4744 #endif
4745 
4746  void FileManagerComponentBase ::
4747  cmdRegOut_out(
4748  FwIndexType portNum,
4749  FwOpcodeType opCode
4750  ) const
4751  {
4752  FW_ASSERT(
4753  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
4754  static_cast<FwAssertArgType>(portNum)
4755  );
4756 
4757  FW_ASSERT(
4758  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
4759  static_cast<FwAssertArgType>(portNum)
4760  );
4761  this->m_cmdRegOut_OutputPort[portNum].invoke(
4762  opCode
4763  );
4764  }
4765 
4766  void FileManagerComponentBase ::
4767  cmdResponseOut_out(
4768  FwIndexType portNum,
4769  FwOpcodeType opCode,
4770  U32 cmdSeq,
4771  const Fw::CmdResponse& response
4772  ) const
4773  {
4774  FW_ASSERT(
4775  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
4776  static_cast<FwAssertArgType>(portNum)
4777  );
4778 
4779  FW_ASSERT(
4780  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
4781  static_cast<FwAssertArgType>(portNum)
4782  );
4783  this->m_cmdResponseOut_OutputPort[portNum].invoke(
4784  opCode,
4785  cmdSeq,
4786  response
4787  );
4788  }
4789 
4790  void FileManagerComponentBase ::
4791  eventOut_out(
4792  FwIndexType portNum,
4793  FwEventIdType id,
4794  Fw::Time& timeTag,
4795  const Fw::LogSeverity& severity,
4796  Fw::LogBuffer& args
4797  ) const
4798  {
4799  FW_ASSERT(
4800  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
4801  static_cast<FwAssertArgType>(portNum)
4802  );
4803 
4804  FW_ASSERT(
4805  this->m_eventOut_OutputPort[portNum].isConnected(),
4806  static_cast<FwAssertArgType>(portNum)
4807  );
4808  this->m_eventOut_OutputPort[portNum].invoke(
4809  id,
4810  timeTag,
4811  severity,
4812  args
4813  );
4814  }
4815 
4816  void FileManagerComponentBase ::
4817  timeCaller_out(
4818  FwIndexType portNum,
4819  Fw::Time& time
4820  ) const
4821  {
4822  FW_ASSERT(
4823  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
4824  static_cast<FwAssertArgType>(portNum)
4825  );
4826 
4827  FW_ASSERT(
4828  this->m_timeCaller_OutputPort[portNum].isConnected(),
4829  static_cast<FwAssertArgType>(portNum)
4830  );
4831  this->m_timeCaller_OutputPort[portNum].invoke(
4832  time
4833  );
4834  }
4835 
4836  void FileManagerComponentBase ::
4837  tlmOut_out(
4838  FwIndexType portNum,
4839  FwChanIdType id,
4840  Fw::Time& timeTag,
4841  Fw::TlmBuffer& val
4842  ) const
4843  {
4844  FW_ASSERT(
4845  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
4846  static_cast<FwAssertArgType>(portNum)
4847  );
4848 
4849  FW_ASSERT(
4850  this->m_tlmOut_OutputPort[portNum].isConnected(),
4851  static_cast<FwAssertArgType>(portNum)
4852  );
4853  this->m_tlmOut_OutputPort[portNum].invoke(
4854  id,
4855  timeTag,
4856  val
4857  );
4858  }
4859 
4860 #endif
4861 
4862 }
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
virtual void run_internalInterfaceHandler()=0
Internal interface handler for run.
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 log_ACTIVITY_HI_CreateDirectoryStarted(const Fw::StringBase &dirName) const
The File System component appended 2 files without error.
FwIdType FwOpcodeType
The type of a command opcode.
The File System component deleted and existing directory without error.
Operation succeeded.
Definition: Os.hpp:26
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
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 log_ACTIVITY_HI_DirectoryListing(const Fw::StringBase &dirName, const Fw::StringBase &fileName, FwSizeType fileSize) const
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.
The File System component moved a file to a new location without error.
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
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
void run_internalInterfaceInvoke()
Internal interface base-class function for run.
The File System component created a new directory without error.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
void init()
Initialization function.
Definition: SchedPortAc.cpp:73
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
void FileSize_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Base-class handler function for command FileSize.
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
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.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
void invoke(U32 key) const
Invoke a port connection.
Definition: PingPortAc.cpp:170
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()
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.
An error occurred while attempting to move a file.
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
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
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)
void init()
Object initializer.
Definition: ObjBase.cpp:24
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
Message will block until space is available.
Definition: Queue.hpp:47
void log_ACTIVITY_HI_CreateDirectorySucceeded(const Fw::StringBase &dirName) const
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
The File System component began moving a file to a new location.
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
An error occurred while attempting to remove a file.
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
static constexpr FwSizeType CAPACITY
Definition: PingPortAc.hpp:34
The File System component began deleting an existing file.
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
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:94
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.
const char * toChar() const
Convert to a C-style char*.
Definition: ObjectName.hpp:50
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
virtual void FileSize_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command FileSize.
FwIdType FwChanIdType
The type of a telemetry channel identifier.
FwSizeType SizeType
The File System component deleted an existing file without error.
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
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.
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
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
Definition: TlmPortAc.cpp:190
bool isConnected() const
Definition: PortBase.cpp:38
void log_ACTIVITY_HI_FileSizeStarted(const Fw::StringBase &fileName) const
Enum representing event severity.
virtual ~FileManagerComponentBase()
Destroy FileManagerComponentBase object.
An error occurred while attempting to create a directory.
#define PRI_FwIndexType
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
void init()
Initialization function.
Definition: LogPortAc.cpp:180
void MoveFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
void schedIn_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port schedIn.
An error occurred while attempting to remove a directory.
BlockingType
message type
Definition: Queue.hpp:46
virtual void FileSize_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName)=0
Handler for command FileSize.
void log_ACTIVITY_HI_MoveFileSucceeded(const Fw::StringBase &sourceFileName, const Fw::StringBase &destFileName) const
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.
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 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
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
PlatformIndexType FwIndexType
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
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
static constexpr FwIndexType getNum_cmdIn_InputPorts()
Append 1 file&#39;s contents to the end of another.
RateGroupDivider component implementation.
The File System component began creating a new directory.
The File System component appended 2 files without error.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
message sent/received okay
Definition: Queue.hpp:31
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
U8 BYTE
byte type
Definition: BasicTypes.h:56
void 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.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:79
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
virtual void RemoveDirectory_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RemoveDirectory.
void init()
Initialization function.
void log_WARNING_HI_DirectoryCreateError(const Fw::StringBase &dirName, U32 status) const
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 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
The File System component returned status non-zero when trying to append 2 files together.
The File System component began deleting a directory.
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
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
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.
message to exit active component task
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.
virtual void AppendFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &source, const Fw::CmdStringArg &target)=0