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 
8 #include "Fw/Types/Assert.hpp"
10 #if FW_ENABLE_TEXT_LOGGING
11 #include "Fw/Types/String.hpp"
12 #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_SHELLCOMMAND,
25  CMD_APPENDFILE,
26  CMD_FILESIZE,
27  };
28 
29  // Get the max size by constructing a union of the async input, command, and
30  // internal port serialization sizes
31  union BuffUnion {
34  };
35 
36  // Define a message buffer class large enough to handle all the
37  // asynchronous inputs to the component
38  class ComponentIpcSerializableBuffer :
40  {
41 
42  public:
43 
44  enum {
45  // Offset into data in buffer: Size of message ID and port number
46  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
47  // Max data size
48  MAX_DATA_SIZE = sizeof(BuffUnion),
49  // Max message size: Size of message id + size of port + max data size
50  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
51  };
52 
53  Fw::Serializable::SizeType getBuffCapacity() const {
54  return sizeof(m_buff);
55  }
56 
57  U8* getBuffAddr() {
58  return m_buff;
59  }
60 
61  const U8* getBuffAddr() const {
62  return m_buff;
63  }
64 
65  private:
66  // Should be the max of all the input ports serialized sizes...
67  U8 m_buff[SERIALIZATION_SIZE];
68 
69  };
70  }
71 
72  // ----------------------------------------------------------------------
73  // Component initialization
74  // ----------------------------------------------------------------------
75 
78  FwSizeType queueDepth,
79  FwEnumStoreType instance
80  )
81  {
82  // Initialize base class
84 
85  // Connect input port cmdIn
86  for (
87  FwIndexType port = 0;
88  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
89  port++
90  ) {
91  this->m_cmdIn_InputPort[port].init();
92  this->m_cmdIn_InputPort[port].addCallComp(
93  this,
94  m_p_cmdIn_in
95  );
96  this->m_cmdIn_InputPort[port].setPortNum(port);
97 
98 #if FW_OBJECT_NAMES == 1
99  Fw::ObjectName portName;
100  portName.format(
101  "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]",
102  this->m_objName.toChar(),
103  port
104  );
105  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
106 #endif
107  }
108 
109  // Connect input port pingIn
110  for (
111  FwIndexType port = 0;
112  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
113  port++
114  ) {
115  this->m_pingIn_InputPort[port].init();
116  this->m_pingIn_InputPort[port].addCallComp(
117  this,
118  m_p_pingIn_in
119  );
120  this->m_pingIn_InputPort[port].setPortNum(port);
121 
122 #if FW_OBJECT_NAMES == 1
123  Fw::ObjectName portName;
124  portName.format(
125  "%s_pingIn_InputPort[%" PRI_PlatformIntType "]",
126  this->m_objName.toChar(),
127  port
128  );
129  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
130 #endif
131  }
132 
133 #if FW_ENABLE_TEXT_LOGGING == 1
134  // Connect output port LogText
135  for (
136  FwIndexType port = 0;
137  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
138  port++
139  ) {
140  this->m_LogText_OutputPort[port].init();
141 
142 #if FW_OBJECT_NAMES == 1
143  Fw::ObjectName portName;
144  portName.format(
145  "%s_LogText_OutputPort[%" PRI_PlatformIntType "]",
146  this->m_objName.toChar(),
147  port
148  );
149  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
150 #endif
151  }
152 #endif
153 
154  // Connect output port cmdRegOut
155  for (
156  FwIndexType port = 0;
157  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
158  port++
159  ) {
160  this->m_cmdRegOut_OutputPort[port].init();
161 
162 #if FW_OBJECT_NAMES == 1
163  Fw::ObjectName portName;
164  portName.format(
165  "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]",
166  this->m_objName.toChar(),
167  port
168  );
169  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
170 #endif
171  }
172 
173  // Connect output port cmdResponseOut
174  for (
175  FwIndexType port = 0;
176  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
177  port++
178  ) {
179  this->m_cmdResponseOut_OutputPort[port].init();
180 
181 #if FW_OBJECT_NAMES == 1
182  Fw::ObjectName portName;
183  portName.format(
184  "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]",
185  this->m_objName.toChar(),
186  port
187  );
188  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
189 #endif
190  }
191 
192  // Connect output port eventOut
193  for (
194  FwIndexType port = 0;
195  port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
196  port++
197  ) {
198  this->m_eventOut_OutputPort[port].init();
199 
200 #if FW_OBJECT_NAMES == 1
201  Fw::ObjectName portName;
202  portName.format(
203  "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]",
204  this->m_objName.toChar(),
205  port
206  );
207  this->m_eventOut_OutputPort[port].setObjName(portName.toChar());
208 #endif
209  }
210 
211  // Connect output port timeCaller
212  for (
213  FwIndexType port = 0;
214  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
215  port++
216  ) {
217  this->m_timeCaller_OutputPort[port].init();
218 
219 #if FW_OBJECT_NAMES == 1
220  Fw::ObjectName portName;
221  portName.format(
222  "%s_timeCaller_OutputPort[%" PRI_PlatformIntType "]",
223  this->m_objName.toChar(),
224  port
225  );
226  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
227 #endif
228  }
229 
230  // Connect output port tlmOut
231  for (
232  FwIndexType port = 0;
233  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
234  port++
235  ) {
236  this->m_tlmOut_OutputPort[port].init();
237 
238 #if FW_OBJECT_NAMES == 1
239  Fw::ObjectName portName;
240  portName.format(
241  "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]",
242  this->m_objName.toChar(),
243  port
244  );
245  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
246 #endif
247  }
248 
249  // Connect output port pingOut
250  for (
251  FwIndexType port = 0;
252  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
253  port++
254  ) {
255  this->m_pingOut_OutputPort[port].init();
256 
257 #if FW_OBJECT_NAMES == 1
258  Fw::ObjectName portName;
259  portName.format(
260  "%s_pingOut_OutputPort[%" PRI_PlatformIntType "]",
261  this->m_objName.toChar(),
262  port
263  );
264  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
265 #endif
266  }
267 
268  // Create the queue
269  Os::Queue::Status qStat = this->createQueue(
270  queueDepth,
271  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
272  );
273  FW_ASSERT(
274  Os::Queue::Status::OP_OK == qStat,
275  static_cast<FwAssertArgType>(qStat)
276  );
277  }
278 
279  // ----------------------------------------------------------------------
280  // Getters for special input ports
281  // ----------------------------------------------------------------------
282 
285  {
286  FW_ASSERT(
287  portNum < this->getNum_cmdIn_InputPorts(),
288  static_cast<FwAssertArgType>(portNum)
289  );
290 
291  return &this->m_cmdIn_InputPort[portNum];
292  }
293 
294  // ----------------------------------------------------------------------
295  // Getters for typed input ports
296  // ----------------------------------------------------------------------
297 
300  {
301  FW_ASSERT(
302  portNum < this->getNum_pingIn_InputPorts(),
303  static_cast<FwAssertArgType>(portNum)
304  );
305 
306  return &this->m_pingIn_InputPort[portNum];
307  }
308 
309  // ----------------------------------------------------------------------
310  // Connect input ports to special output ports
311  // ----------------------------------------------------------------------
312 
313 #if FW_ENABLE_TEXT_LOGGING == 1
314 
315  void FileManagerComponentBase ::
316  set_LogText_OutputPort(
317  FwIndexType portNum,
319  )
320  {
321  FW_ASSERT(
322  portNum < this->getNum_LogText_OutputPorts(),
323  static_cast<FwAssertArgType>(portNum)
324  );
325 
326  this->m_LogText_OutputPort[portNum].addCallPort(port);
327  }
328 
329 #endif
330 
333  FwIndexType portNum,
334  Fw::InputCmdRegPort* port
335  )
336  {
337  FW_ASSERT(
338  portNum < this->getNum_cmdRegOut_OutputPorts(),
339  static_cast<FwAssertArgType>(portNum)
340  );
341 
342  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
343  }
344 
347  FwIndexType portNum,
349  )
350  {
351  FW_ASSERT(
352  portNum < this->getNum_cmdResponseOut_OutputPorts(),
353  static_cast<FwAssertArgType>(portNum)
354  );
355 
356  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
357  }
358 
361  FwIndexType portNum,
362  Fw::InputLogPort* port
363  )
364  {
365  FW_ASSERT(
366  portNum < this->getNum_eventOut_OutputPorts(),
367  static_cast<FwAssertArgType>(portNum)
368  );
369 
370  this->m_eventOut_OutputPort[portNum].addCallPort(port);
371  }
372 
375  FwIndexType portNum,
376  Fw::InputTimePort* port
377  )
378  {
379  FW_ASSERT(
380  portNum < this->getNum_timeCaller_OutputPorts(),
381  static_cast<FwAssertArgType>(portNum)
382  );
383 
384  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
385  }
386 
389  FwIndexType portNum,
390  Fw::InputTlmPort* port
391  )
392  {
393  FW_ASSERT(
394  portNum < this->getNum_tlmOut_OutputPorts(),
395  static_cast<FwAssertArgType>(portNum)
396  );
397 
398  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
399  }
400 
401  // ----------------------------------------------------------------------
402  // Connect typed input ports to typed output ports
403  // ----------------------------------------------------------------------
404 
407  FwIndexType portNum,
408  Svc::InputPingPort* port
409  )
410  {
411  FW_ASSERT(
412  portNum < this->getNum_pingOut_OutputPorts(),
413  static_cast<FwAssertArgType>(portNum)
414  );
415 
416  this->m_pingOut_OutputPort[portNum].addCallPort(port);
417  }
418 
419 #if FW_PORT_SERIALIZATION
420 
421  // ----------------------------------------------------------------------
422  // Connect serial input ports to special output ports
423  // ----------------------------------------------------------------------
424 
425 #if FW_ENABLE_TEXT_LOGGING == 1
426 
427  void FileManagerComponentBase ::
428  set_LogText_OutputPort(
429  FwIndexType portNum,
430  Fw::InputSerializePort* port
431  )
432  {
433  FW_ASSERT(
434  portNum < this->getNum_LogText_OutputPorts(),
435  static_cast<FwAssertArgType>(portNum)
436  );
437 
438  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
439  }
440 
441 #endif
442 
445  FwIndexType portNum,
446  Fw::InputSerializePort* port
447  )
448  {
449  FW_ASSERT(
450  portNum < this->getNum_cmdRegOut_OutputPorts(),
451  static_cast<FwAssertArgType>(portNum)
452  );
453 
454  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
455  }
456 
459  FwIndexType portNum,
460  Fw::InputSerializePort* port
461  )
462  {
463  FW_ASSERT(
464  portNum < this->getNum_cmdResponseOut_OutputPorts(),
465  static_cast<FwAssertArgType>(portNum)
466  );
467 
468  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
469  }
470 
473  FwIndexType portNum,
474  Fw::InputSerializePort* port
475  )
476  {
477  FW_ASSERT(
478  portNum < this->getNum_eventOut_OutputPorts(),
479  static_cast<FwAssertArgType>(portNum)
480  );
481 
482  this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
483  }
484 
487  FwIndexType portNum,
488  Fw::InputSerializePort* port
489  )
490  {
491  FW_ASSERT(
492  portNum < this->getNum_timeCaller_OutputPorts(),
493  static_cast<FwAssertArgType>(portNum)
494  );
495 
496  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
497  }
498 
501  FwIndexType portNum,
502  Fw::InputSerializePort* port
503  )
504  {
505  FW_ASSERT(
506  portNum < this->getNum_tlmOut_OutputPorts(),
507  static_cast<FwAssertArgType>(portNum)
508  );
509 
510  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
511  }
512 
513 #endif
514 
515 #if FW_PORT_SERIALIZATION
516 
517  // ----------------------------------------------------------------------
518  // Connect serial input ports to typed output ports
519  // ----------------------------------------------------------------------
520 
523  FwIndexType portNum,
524  Fw::InputSerializePort* port
525  )
526  {
527  FW_ASSERT(
528  portNum < this->getNum_pingOut_OutputPorts(),
529  static_cast<FwAssertArgType>(portNum)
530  );
531 
532  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
533  }
534 
535 #endif
536 
537  // ----------------------------------------------------------------------
538  // Command registration
539  // ----------------------------------------------------------------------
540 
543  {
544  FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
545 
546  this->m_cmdRegOut_OutputPort[0].invoke(
548  );
549 
550  this->m_cmdRegOut_OutputPort[0].invoke(
551  this->getIdBase() + OPCODE_MOVEFILE
552  );
553 
554  this->m_cmdRegOut_OutputPort[0].invoke(
556  );
557 
558  this->m_cmdRegOut_OutputPort[0].invoke(
559  this->getIdBase() + OPCODE_REMOVEFILE
560  );
561 
562  this->m_cmdRegOut_OutputPort[0].invoke(
564  );
565 
566  this->m_cmdRegOut_OutputPort[0].invoke(
567  this->getIdBase() + OPCODE_APPENDFILE
568  );
569 
570  this->m_cmdRegOut_OutputPort[0].invoke(
571  this->getIdBase() + OPCODE_FILESIZE
572  );
573  }
574 
575  // ----------------------------------------------------------------------
576  // Component construction and destruction
577  // ----------------------------------------------------------------------
578 
580  FileManagerComponentBase(const char* compName) :
581  Fw::ActiveComponentBase(compName)
582  {
583 
584  }
585 
588  {
589 
590  }
591 
592  // ----------------------------------------------------------------------
593  // Getters for numbers of special input ports
594  // ----------------------------------------------------------------------
595 
598  {
599  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
600  }
601 
602  // ----------------------------------------------------------------------
603  // Getters for numbers of typed input ports
604  // ----------------------------------------------------------------------
605 
608  {
609  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_pingIn_InputPort));
610  }
611 
612  // ----------------------------------------------------------------------
613  // Getters for numbers of special output ports
614  // ----------------------------------------------------------------------
615 
616 #if FW_ENABLE_TEXT_LOGGING == 1
617 
618  FwIndexType FileManagerComponentBase ::
619  getNum_LogText_OutputPorts() const
620  {
621  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
622  }
623 
624 #endif
625 
628  {
629  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
630  }
631 
634  {
635  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
636  }
637 
640  {
641  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_eventOut_OutputPort));
642  }
643 
646  {
647  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_timeCaller_OutputPort));
648  }
649 
652  {
653  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
654  }
655 
656  // ----------------------------------------------------------------------
657  // Getters for numbers of typed output ports
658  // ----------------------------------------------------------------------
659 
662  {
663  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_pingOut_OutputPort));
664  }
665 
666  // ----------------------------------------------------------------------
667  // Connection status queries for special output ports
668  // ----------------------------------------------------------------------
669 
670 #if FW_ENABLE_TEXT_LOGGING == 1
671 
672  bool FileManagerComponentBase ::
673  isConnected_LogText_OutputPort(FwIndexType portNum)
674  {
675  FW_ASSERT(
676  portNum < this->getNum_LogText_OutputPorts(),
677  static_cast<FwAssertArgType>(portNum)
678  );
679 
680  return this->m_LogText_OutputPort[portNum].isConnected();
681  }
682 
683 #endif
684 
687  {
688  FW_ASSERT(
689  portNum < this->getNum_cmdRegOut_OutputPorts(),
690  static_cast<FwAssertArgType>(portNum)
691  );
692 
693  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
694  }
695 
698  {
699  FW_ASSERT(
700  portNum < this->getNum_cmdResponseOut_OutputPorts(),
701  static_cast<FwAssertArgType>(portNum)
702  );
703 
704  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
705  }
706 
709  {
710  FW_ASSERT(
711  portNum < this->getNum_eventOut_OutputPorts(),
712  static_cast<FwAssertArgType>(portNum)
713  );
714 
715  return this->m_eventOut_OutputPort[portNum].isConnected();
716  }
717 
720  {
721  FW_ASSERT(
722  portNum < this->getNum_timeCaller_OutputPorts(),
723  static_cast<FwAssertArgType>(portNum)
724  );
725 
726  return this->m_timeCaller_OutputPort[portNum].isConnected();
727  }
728 
731  {
732  FW_ASSERT(
733  portNum < this->getNum_tlmOut_OutputPorts(),
734  static_cast<FwAssertArgType>(portNum)
735  );
736 
737  return this->m_tlmOut_OutputPort[portNum].isConnected();
738  }
739 
740  // ----------------------------------------------------------------------
741  // Connection status queries for typed output ports
742  // ----------------------------------------------------------------------
743 
746  {
747  FW_ASSERT(
748  portNum < this->getNum_pingOut_OutputPorts(),
749  static_cast<FwAssertArgType>(portNum)
750  );
751 
752  return this->m_pingOut_OutputPort[portNum].isConnected();
753  }
754 
755  // ----------------------------------------------------------------------
756  // Port handler base-class functions for typed input ports
757  //
758  // Call these functions directly to bypass the corresponding ports
759  // ----------------------------------------------------------------------
760 
763  FwIndexType portNum,
764  U32 key
765  )
766  {
767  // Make sure port number is valid
768  FW_ASSERT(
769  portNum < this->getNum_pingIn_InputPorts(),
770  static_cast<FwAssertArgType>(portNum)
771  );
772 
773  // Call pre-message hook
775  portNum,
776  key
777  );
778  ComponentIpcSerializableBuffer msg;
780 
781  // Serialize message ID
782  _status = msg.serialize(
783  static_cast<FwEnumStoreType>(PINGIN_PING)
784  );
785  FW_ASSERT(
786  _status == Fw::FW_SERIALIZE_OK,
787  static_cast<FwAssertArgType>(_status)
788  );
789 
790  // Serialize port number
791  _status = msg.serialize(portNum);
792  FW_ASSERT(
793  _status == Fw::FW_SERIALIZE_OK,
794  static_cast<FwAssertArgType>(_status)
795  );
796 
797  // Serialize argument key
798  _status = msg.serialize(key);
799  FW_ASSERT(
800  _status == Fw::FW_SERIALIZE_OK,
801  static_cast<FwAssertArgType>(_status)
802  );
803 
804  // Send message
806  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
807 
808  FW_ASSERT(
809  qStatus == Os::Queue::OP_OK,
810  static_cast<FwAssertArgType>(qStatus)
811  );
812  }
813 
814  // ----------------------------------------------------------------------
815  // Pre-message hooks for typed async input ports
816  //
817  // Each of these functions is invoked just before processing a message
818  // on the corresponding port. By default, they do nothing. You can
819  // override them to provide specific pre-message behavior.
820  // ----------------------------------------------------------------------
821 
824  FwIndexType portNum,
825  U32 key
826  )
827  {
828  // Default: no-op
829  }
830 
831  // ----------------------------------------------------------------------
832  // Invocation functions for typed output ports
833  // ----------------------------------------------------------------------
834 
837  FwIndexType portNum,
838  U32 key
839  )
840  {
841  FW_ASSERT(
842  portNum < this->getNum_pingOut_OutputPorts(),
843  static_cast<FwAssertArgType>(portNum)
844  );
845 
846  FW_ASSERT(
847  this->m_pingOut_OutputPort[portNum].isConnected(),
848  static_cast<FwAssertArgType>(portNum)
849  );
850  this->m_pingOut_OutputPort[portNum].invoke(
851  key
852  );
853  }
854 
855  // ----------------------------------------------------------------------
856  // Command response
857  // ----------------------------------------------------------------------
858 
861  FwOpcodeType opCode,
862  U32 cmdSeq,
863  Fw::CmdResponse response
864  )
865  {
866  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
867  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
868  }
869 
870  // ----------------------------------------------------------------------
871  // Command handler base-class functions
872  //
873  // Call these functions directly to bypass the command input port
874  // ----------------------------------------------------------------------
875 
878  FwOpcodeType opCode,
879  U32 cmdSeq,
880  Fw::CmdArgBuffer& args
881  )
882  {
883  // Call pre-message hook
884  this->CreateDirectory_preMsgHook(opCode,cmdSeq);
885 
886  // Defer deserializing arguments to the message dispatcher
887  // to avoid deserializing and reserializing just for IPC
888  ComponentIpcSerializableBuffer msg;
890 
891  // Serialize for IPC
892  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CREATEDIRECTORY));
893  FW_ASSERT (
894  _status == Fw::FW_SERIALIZE_OK,
895  static_cast<FwAssertArgType>(_status)
896  );
897 
898  // Fake port number to make message dequeue work
899  FwIndexType port = 0;
900 
901  _status = msg.serialize(port);
902  FW_ASSERT (
903  _status == Fw::FW_SERIALIZE_OK,
904  static_cast<FwAssertArgType>(_status)
905  );
906 
907  _status = msg.serialize(opCode);
908  FW_ASSERT (
909  _status == Fw::FW_SERIALIZE_OK,
910  static_cast<FwAssertArgType>(_status)
911  );
912 
913  _status = msg.serialize(cmdSeq);
914  FW_ASSERT (
915  _status == Fw::FW_SERIALIZE_OK,
916  static_cast<FwAssertArgType>(_status)
917  );
918 
919  _status = msg.serialize(args);
920  FW_ASSERT (
921  _status == Fw::FW_SERIALIZE_OK,
922  static_cast<FwAssertArgType>(_status)
923  );
924 
925  // Send message
927  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
928 
929  FW_ASSERT(
930  qStatus == Os::Queue::OP_OK,
931  static_cast<FwAssertArgType>(qStatus)
932  );
933  }
934 
937  FwOpcodeType opCode,
938  U32 cmdSeq,
939  Fw::CmdArgBuffer& args
940  )
941  {
942  // Call pre-message hook
943  this->MoveFile_preMsgHook(opCode,cmdSeq);
944 
945  // Defer deserializing arguments to the message dispatcher
946  // to avoid deserializing and reserializing just for IPC
947  ComponentIpcSerializableBuffer msg;
949 
950  // Serialize for IPC
951  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_MOVEFILE));
952  FW_ASSERT (
953  _status == Fw::FW_SERIALIZE_OK,
954  static_cast<FwAssertArgType>(_status)
955  );
956 
957  // Fake port number to make message dequeue work
958  FwIndexType port = 0;
959 
960  _status = msg.serialize(port);
961  FW_ASSERT (
962  _status == Fw::FW_SERIALIZE_OK,
963  static_cast<FwAssertArgType>(_status)
964  );
965 
966  _status = msg.serialize(opCode);
967  FW_ASSERT (
968  _status == Fw::FW_SERIALIZE_OK,
969  static_cast<FwAssertArgType>(_status)
970  );
971 
972  _status = msg.serialize(cmdSeq);
973  FW_ASSERT (
974  _status == Fw::FW_SERIALIZE_OK,
975  static_cast<FwAssertArgType>(_status)
976  );
977 
978  _status = msg.serialize(args);
979  FW_ASSERT (
980  _status == Fw::FW_SERIALIZE_OK,
981  static_cast<FwAssertArgType>(_status)
982  );
983 
984  // Send message
986  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
987 
988  FW_ASSERT(
989  qStatus == Os::Queue::OP_OK,
990  static_cast<FwAssertArgType>(qStatus)
991  );
992  }
993 
996  FwOpcodeType opCode,
997  U32 cmdSeq,
998  Fw::CmdArgBuffer& args
999  )
1000  {
1001  // Call pre-message hook
1002  this->RemoveDirectory_preMsgHook(opCode,cmdSeq);
1003 
1004  // Defer deserializing arguments to the message dispatcher
1005  // to avoid deserializing and reserializing just for IPC
1006  ComponentIpcSerializableBuffer msg;
1008 
1009  // Serialize for IPC
1010  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_REMOVEDIRECTORY));
1011  FW_ASSERT (
1012  _status == Fw::FW_SERIALIZE_OK,
1013  static_cast<FwAssertArgType>(_status)
1014  );
1015 
1016  // Fake port number to make message dequeue work
1017  FwIndexType port = 0;
1018 
1019  _status = msg.serialize(port);
1020  FW_ASSERT (
1021  _status == Fw::FW_SERIALIZE_OK,
1022  static_cast<FwAssertArgType>(_status)
1023  );
1024 
1025  _status = msg.serialize(opCode);
1026  FW_ASSERT (
1027  _status == Fw::FW_SERIALIZE_OK,
1028  static_cast<FwAssertArgType>(_status)
1029  );
1030 
1031  _status = msg.serialize(cmdSeq);
1032  FW_ASSERT (
1033  _status == Fw::FW_SERIALIZE_OK,
1034  static_cast<FwAssertArgType>(_status)
1035  );
1036 
1037  _status = msg.serialize(args);
1038  FW_ASSERT (
1039  _status == Fw::FW_SERIALIZE_OK,
1040  static_cast<FwAssertArgType>(_status)
1041  );
1042 
1043  // Send message
1045  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1046 
1047  FW_ASSERT(
1048  qStatus == Os::Queue::OP_OK,
1049  static_cast<FwAssertArgType>(qStatus)
1050  );
1051  }
1052 
1055  FwOpcodeType opCode,
1056  U32 cmdSeq,
1057  Fw::CmdArgBuffer& args
1058  )
1059  {
1060  // Call pre-message hook
1061  this->RemoveFile_preMsgHook(opCode,cmdSeq);
1062 
1063  // Defer deserializing arguments to the message dispatcher
1064  // to avoid deserializing and reserializing just for IPC
1065  ComponentIpcSerializableBuffer msg;
1067 
1068  // Serialize for IPC
1069  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_REMOVEFILE));
1070  FW_ASSERT (
1071  _status == Fw::FW_SERIALIZE_OK,
1072  static_cast<FwAssertArgType>(_status)
1073  );
1074 
1075  // Fake port number to make message dequeue work
1076  FwIndexType port = 0;
1077 
1078  _status = msg.serialize(port);
1079  FW_ASSERT (
1080  _status == Fw::FW_SERIALIZE_OK,
1081  static_cast<FwAssertArgType>(_status)
1082  );
1083 
1084  _status = msg.serialize(opCode);
1085  FW_ASSERT (
1086  _status == Fw::FW_SERIALIZE_OK,
1087  static_cast<FwAssertArgType>(_status)
1088  );
1089 
1090  _status = msg.serialize(cmdSeq);
1091  FW_ASSERT (
1092  _status == Fw::FW_SERIALIZE_OK,
1093  static_cast<FwAssertArgType>(_status)
1094  );
1095 
1096  _status = msg.serialize(args);
1097  FW_ASSERT (
1098  _status == Fw::FW_SERIALIZE_OK,
1099  static_cast<FwAssertArgType>(_status)
1100  );
1101 
1102  // Send message
1104  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1105 
1106  FW_ASSERT(
1107  qStatus == Os::Queue::OP_OK,
1108  static_cast<FwAssertArgType>(qStatus)
1109  );
1110  }
1111 
1114  FwOpcodeType opCode,
1115  U32 cmdSeq,
1116  Fw::CmdArgBuffer& args
1117  )
1118  {
1119  // Call pre-message hook
1120  this->ShellCommand_preMsgHook(opCode,cmdSeq);
1121 
1122  // Defer deserializing arguments to the message dispatcher
1123  // to avoid deserializing and reserializing just for IPC
1124  ComponentIpcSerializableBuffer msg;
1126 
1127  // Serialize for IPC
1128  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_SHELLCOMMAND));
1129  FW_ASSERT (
1130  _status == Fw::FW_SERIALIZE_OK,
1131  static_cast<FwAssertArgType>(_status)
1132  );
1133 
1134  // Fake port number to make message dequeue work
1135  FwIndexType port = 0;
1136 
1137  _status = msg.serialize(port);
1138  FW_ASSERT (
1139  _status == Fw::FW_SERIALIZE_OK,
1140  static_cast<FwAssertArgType>(_status)
1141  );
1142 
1143  _status = msg.serialize(opCode);
1144  FW_ASSERT (
1145  _status == Fw::FW_SERIALIZE_OK,
1146  static_cast<FwAssertArgType>(_status)
1147  );
1148 
1149  _status = msg.serialize(cmdSeq);
1150  FW_ASSERT (
1151  _status == Fw::FW_SERIALIZE_OK,
1152  static_cast<FwAssertArgType>(_status)
1153  );
1154 
1155  _status = msg.serialize(args);
1156  FW_ASSERT (
1157  _status == Fw::FW_SERIALIZE_OK,
1158  static_cast<FwAssertArgType>(_status)
1159  );
1160 
1161  // Send message
1163  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1164 
1165  FW_ASSERT(
1166  qStatus == Os::Queue::OP_OK,
1167  static_cast<FwAssertArgType>(qStatus)
1168  );
1169  }
1170 
1173  FwOpcodeType opCode,
1174  U32 cmdSeq,
1175  Fw::CmdArgBuffer& args
1176  )
1177  {
1178  // Call pre-message hook
1179  this->AppendFile_preMsgHook(opCode,cmdSeq);
1180 
1181  // Defer deserializing arguments to the message dispatcher
1182  // to avoid deserializing and reserializing just for IPC
1183  ComponentIpcSerializableBuffer msg;
1185 
1186  // Serialize for IPC
1187  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_APPENDFILE));
1188  FW_ASSERT (
1189  _status == Fw::FW_SERIALIZE_OK,
1190  static_cast<FwAssertArgType>(_status)
1191  );
1192 
1193  // Fake port number to make message dequeue work
1194  FwIndexType port = 0;
1195 
1196  _status = msg.serialize(port);
1197  FW_ASSERT (
1198  _status == Fw::FW_SERIALIZE_OK,
1199  static_cast<FwAssertArgType>(_status)
1200  );
1201 
1202  _status = msg.serialize(opCode);
1203  FW_ASSERT (
1204  _status == Fw::FW_SERIALIZE_OK,
1205  static_cast<FwAssertArgType>(_status)
1206  );
1207 
1208  _status = msg.serialize(cmdSeq);
1209  FW_ASSERT (
1210  _status == Fw::FW_SERIALIZE_OK,
1211  static_cast<FwAssertArgType>(_status)
1212  );
1213 
1214  _status = msg.serialize(args);
1215  FW_ASSERT (
1216  _status == Fw::FW_SERIALIZE_OK,
1217  static_cast<FwAssertArgType>(_status)
1218  );
1219 
1220  // Send message
1222  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1223 
1224  FW_ASSERT(
1225  qStatus == Os::Queue::OP_OK,
1226  static_cast<FwAssertArgType>(qStatus)
1227  );
1228  }
1229 
1232  FwOpcodeType opCode,
1233  U32 cmdSeq,
1234  Fw::CmdArgBuffer& args
1235  )
1236  {
1237  // Call pre-message hook
1238  this->FileSize_preMsgHook(opCode,cmdSeq);
1239 
1240  // Defer deserializing arguments to the message dispatcher
1241  // to avoid deserializing and reserializing just for IPC
1242  ComponentIpcSerializableBuffer msg;
1244 
1245  // Serialize for IPC
1246  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_FILESIZE));
1247  FW_ASSERT (
1248  _status == Fw::FW_SERIALIZE_OK,
1249  static_cast<FwAssertArgType>(_status)
1250  );
1251 
1252  // Fake port number to make message dequeue work
1253  FwIndexType port = 0;
1254 
1255  _status = msg.serialize(port);
1256  FW_ASSERT (
1257  _status == Fw::FW_SERIALIZE_OK,
1258  static_cast<FwAssertArgType>(_status)
1259  );
1260 
1261  _status = msg.serialize(opCode);
1262  FW_ASSERT (
1263  _status == Fw::FW_SERIALIZE_OK,
1264  static_cast<FwAssertArgType>(_status)
1265  );
1266 
1267  _status = msg.serialize(cmdSeq);
1268  FW_ASSERT (
1269  _status == Fw::FW_SERIALIZE_OK,
1270  static_cast<FwAssertArgType>(_status)
1271  );
1272 
1273  _status = msg.serialize(args);
1274  FW_ASSERT (
1275  _status == Fw::FW_SERIALIZE_OK,
1276  static_cast<FwAssertArgType>(_status)
1277  );
1278 
1279  // Send message
1281  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1282 
1283  FW_ASSERT(
1284  qStatus == Os::Queue::OP_OK,
1285  static_cast<FwAssertArgType>(qStatus)
1286  );
1287  }
1288 
1289  // ----------------------------------------------------------------------
1290  // Pre-message hooks for async commands
1291  //
1292  // Each of these functions is invoked just before processing the
1293  // corresponding command. By default they do nothing. You can
1294  // override them to provide specific pre-command behavior.
1295  // ----------------------------------------------------------------------
1296 
1299  FwOpcodeType opCode,
1300  U32 cmdSeq
1301  )
1302  {
1303  // Defaults to no-op; can be overridden
1304  (void) opCode;
1305  (void) cmdSeq;
1306  }
1307 
1310  FwOpcodeType opCode,
1311  U32 cmdSeq
1312  )
1313  {
1314  // Defaults to no-op; can be overridden
1315  (void) opCode;
1316  (void) cmdSeq;
1317  }
1318 
1321  FwOpcodeType opCode,
1322  U32 cmdSeq
1323  )
1324  {
1325  // Defaults to no-op; can be overridden
1326  (void) opCode;
1327  (void) cmdSeq;
1328  }
1329 
1332  FwOpcodeType opCode,
1333  U32 cmdSeq
1334  )
1335  {
1336  // Defaults to no-op; can be overridden
1337  (void) opCode;
1338  (void) cmdSeq;
1339  }
1340 
1343  FwOpcodeType opCode,
1344  U32 cmdSeq
1345  )
1346  {
1347  // Defaults to no-op; can be overridden
1348  (void) opCode;
1349  (void) cmdSeq;
1350  }
1351 
1354  FwOpcodeType opCode,
1355  U32 cmdSeq
1356  )
1357  {
1358  // Defaults to no-op; can be overridden
1359  (void) opCode;
1360  (void) cmdSeq;
1361  }
1362 
1365  FwOpcodeType opCode,
1366  U32 cmdSeq
1367  )
1368  {
1369  // Defaults to no-op; can be overridden
1370  (void) opCode;
1371  (void) cmdSeq;
1372  }
1373 
1374  // ----------------------------------------------------------------------
1375  // Event logging functions
1376  // ----------------------------------------------------------------------
1377 
1380  const Fw::StringBase& dirName,
1381  U32 status
1382  ) const
1383  {
1384  // Get the time
1385  Fw::Time _logTime;
1386  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1387  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1388  }
1389 
1390  FwEventIdType _id = static_cast<FwEventIdType>(0);
1391 
1392  _id = this->getIdBase() + EVENTID_DIRECTORYCREATEERROR;
1393 
1394  // Emit the event on the log port
1395  if (this->m_eventOut_OutputPort[0].isConnected()) {
1396  Fw::LogBuffer _logBuff;
1398 
1399 #if FW_AMPCS_COMPATIBLE
1400  // Serialize the number of arguments
1401  _status = _logBuff.serialize(static_cast<U8>(2));
1402  FW_ASSERT(
1403  _status == Fw::FW_SERIALIZE_OK,
1404  static_cast<FwAssertArgType>(_status)
1405  );
1406 #endif
1407 
1408  _status = dirName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1409  FW_ASSERT(
1410  _status == Fw::FW_SERIALIZE_OK,
1411  static_cast<FwAssertArgType>(_status)
1412  );
1413 
1414 #if FW_AMPCS_COMPATIBLE
1415  // Serialize the argument size
1416  _status = _logBuff.serialize(
1417  static_cast<U8>(sizeof(U32))
1418  );
1419  FW_ASSERT(
1420  _status == Fw::FW_SERIALIZE_OK,
1421  static_cast<FwAssertArgType>(_status)
1422  );
1423 #endif
1424  _status = _logBuff.serialize(status);
1425  FW_ASSERT(
1426  _status == Fw::FW_SERIALIZE_OK,
1427  static_cast<FwAssertArgType>(_status)
1428  );
1429 
1430  this->m_eventOut_OutputPort[0].invoke(
1431  _id,
1432  _logTime,
1434  _logBuff
1435  );
1436  }
1437 
1438  // Emit the event on the text log port
1439 #if FW_ENABLE_TEXT_LOGGING
1440  if (this->m_LogText_OutputPort[0].isConnected()) {
1441 #if FW_OBJECT_NAMES == 1
1442  const char* _formatString =
1443  "(%s) %s: Could not create directory %s, returned status %" PRIu32 "";
1444 #else
1445  const char* _formatString =
1446  "%s: Could not create directory %s, returned status %" PRIu32 "";
1447 #endif
1448 
1449  Fw::TextLogString _logString;
1450  _logString.format(
1451  _formatString,
1452 #if FW_OBJECT_NAMES == 1
1453  this->m_objName.toChar(),
1454 #endif
1455  "DirectoryCreateError ",
1456  dirName.toChar(),
1457  status
1458  );
1459 
1460  this->m_LogText_OutputPort[0].invoke(
1461  _id,
1462  _logTime,
1464  _logString
1465  );
1466  }
1467 #endif
1468  }
1469 
1472  const Fw::StringBase& dirName,
1473  U32 status
1474  ) const
1475  {
1476  // Get the time
1477  Fw::Time _logTime;
1478  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1479  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1480  }
1481 
1482  FwEventIdType _id = static_cast<FwEventIdType>(0);
1483 
1484  _id = this->getIdBase() + EVENTID_DIRECTORYREMOVEERROR;
1485 
1486  // Emit the event on the log port
1487  if (this->m_eventOut_OutputPort[0].isConnected()) {
1488  Fw::LogBuffer _logBuff;
1490 
1491 #if FW_AMPCS_COMPATIBLE
1492  // Serialize the number of arguments
1493  _status = _logBuff.serialize(static_cast<U8>(2));
1494  FW_ASSERT(
1495  _status == Fw::FW_SERIALIZE_OK,
1496  static_cast<FwAssertArgType>(_status)
1497  );
1498 #endif
1499 
1500  _status = dirName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1501  FW_ASSERT(
1502  _status == Fw::FW_SERIALIZE_OK,
1503  static_cast<FwAssertArgType>(_status)
1504  );
1505 
1506 #if FW_AMPCS_COMPATIBLE
1507  // Serialize the argument size
1508  _status = _logBuff.serialize(
1509  static_cast<U8>(sizeof(U32))
1510  );
1511  FW_ASSERT(
1512  _status == Fw::FW_SERIALIZE_OK,
1513  static_cast<FwAssertArgType>(_status)
1514  );
1515 #endif
1516  _status = _logBuff.serialize(status);
1517  FW_ASSERT(
1518  _status == Fw::FW_SERIALIZE_OK,
1519  static_cast<FwAssertArgType>(_status)
1520  );
1521 
1522  this->m_eventOut_OutputPort[0].invoke(
1523  _id,
1524  _logTime,
1526  _logBuff
1527  );
1528  }
1529 
1530  // Emit the event on the text log port
1531 #if FW_ENABLE_TEXT_LOGGING
1532  if (this->m_LogText_OutputPort[0].isConnected()) {
1533 #if FW_OBJECT_NAMES == 1
1534  const char* _formatString =
1535  "(%s) %s: Could not remove directory %s, returned status %" PRIu32 "";
1536 #else
1537  const char* _formatString =
1538  "%s: Could not remove directory %s, returned status %" PRIu32 "";
1539 #endif
1540 
1541  Fw::TextLogString _logString;
1542  _logString.format(
1543  _formatString,
1544 #if FW_OBJECT_NAMES == 1
1545  this->m_objName.toChar(),
1546 #endif
1547  "DirectoryRemoveError ",
1548  dirName.toChar(),
1549  status
1550  );
1551 
1552  this->m_LogText_OutputPort[0].invoke(
1553  _id,
1554  _logTime,
1556  _logString
1557  );
1558  }
1559 #endif
1560  }
1561 
1564  const Fw::StringBase& sourceFileName,
1565  const Fw::StringBase& destFileName,
1566  U32 status
1567  ) const
1568  {
1569  // Get the time
1570  Fw::Time _logTime;
1571  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1572  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1573  }
1574 
1575  FwEventIdType _id = static_cast<FwEventIdType>(0);
1576 
1577  _id = this->getIdBase() + EVENTID_FILEMOVEERROR;
1578 
1579  // Emit the event on the log port
1580  if (this->m_eventOut_OutputPort[0].isConnected()) {
1581  Fw::LogBuffer _logBuff;
1583 
1584 #if FW_AMPCS_COMPATIBLE
1585  // Serialize the number of arguments
1586  _status = _logBuff.serialize(static_cast<U8>(3));
1587  FW_ASSERT(
1588  _status == Fw::FW_SERIALIZE_OK,
1589  static_cast<FwAssertArgType>(_status)
1590  );
1591 #endif
1592 
1593  _status = sourceFileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1594  FW_ASSERT(
1595  _status == Fw::FW_SERIALIZE_OK,
1596  static_cast<FwAssertArgType>(_status)
1597  );
1598 
1599  _status = destFileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1600  FW_ASSERT(
1601  _status == Fw::FW_SERIALIZE_OK,
1602  static_cast<FwAssertArgType>(_status)
1603  );
1604 
1605 #if FW_AMPCS_COMPATIBLE
1606  // Serialize the argument size
1607  _status = _logBuff.serialize(
1608  static_cast<U8>(sizeof(U32))
1609  );
1610  FW_ASSERT(
1611  _status == Fw::FW_SERIALIZE_OK,
1612  static_cast<FwAssertArgType>(_status)
1613  );
1614 #endif
1615  _status = _logBuff.serialize(status);
1616  FW_ASSERT(
1617  _status == Fw::FW_SERIALIZE_OK,
1618  static_cast<FwAssertArgType>(_status)
1619  );
1620 
1621  this->m_eventOut_OutputPort[0].invoke(
1622  _id,
1623  _logTime,
1625  _logBuff
1626  );
1627  }
1628 
1629  // Emit the event on the text log port
1630 #if FW_ENABLE_TEXT_LOGGING
1631  if (this->m_LogText_OutputPort[0].isConnected()) {
1632 #if FW_OBJECT_NAMES == 1
1633  const char* _formatString =
1634  "(%s) %s: Could not move file %s to file %s, returned status %" PRIu32 "";
1635 #else
1636  const char* _formatString =
1637  "%s: Could not move file %s to file %s, returned status %" PRIu32 "";
1638 #endif
1639 
1640  Fw::TextLogString _logString;
1641  _logString.format(
1642  _formatString,
1643 #if FW_OBJECT_NAMES == 1
1644  this->m_objName.toChar(),
1645 #endif
1646  "FileMoveError ",
1647  sourceFileName.toChar(),
1648  destFileName.toChar(),
1649  status
1650  );
1651 
1652  this->m_LogText_OutputPort[0].invoke(
1653  _id,
1654  _logTime,
1656  _logString
1657  );
1658  }
1659 #endif
1660  }
1661 
1664  const Fw::StringBase& fileName,
1665  U32 status
1666  ) const
1667  {
1668  // Get the time
1669  Fw::Time _logTime;
1670  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1671  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1672  }
1673 
1674  FwEventIdType _id = static_cast<FwEventIdType>(0);
1675 
1676  _id = this->getIdBase() + EVENTID_FILEREMOVEERROR;
1677 
1678  // Emit the event on the log port
1679  if (this->m_eventOut_OutputPort[0].isConnected()) {
1680  Fw::LogBuffer _logBuff;
1682 
1683 #if FW_AMPCS_COMPATIBLE
1684  // Serialize the number of arguments
1685  _status = _logBuff.serialize(static_cast<U8>(2));
1686  FW_ASSERT(
1687  _status == Fw::FW_SERIALIZE_OK,
1688  static_cast<FwAssertArgType>(_status)
1689  );
1690 #endif
1691 
1692  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1693  FW_ASSERT(
1694  _status == Fw::FW_SERIALIZE_OK,
1695  static_cast<FwAssertArgType>(_status)
1696  );
1697 
1698 #if FW_AMPCS_COMPATIBLE
1699  // Serialize the argument size
1700  _status = _logBuff.serialize(
1701  static_cast<U8>(sizeof(U32))
1702  );
1703  FW_ASSERT(
1704  _status == Fw::FW_SERIALIZE_OK,
1705  static_cast<FwAssertArgType>(_status)
1706  );
1707 #endif
1708  _status = _logBuff.serialize(status);
1709  FW_ASSERT(
1710  _status == Fw::FW_SERIALIZE_OK,
1711  static_cast<FwAssertArgType>(_status)
1712  );
1713 
1714  this->m_eventOut_OutputPort[0].invoke(
1715  _id,
1716  _logTime,
1718  _logBuff
1719  );
1720  }
1721 
1722  // Emit the event on the text log port
1723 #if FW_ENABLE_TEXT_LOGGING
1724  if (this->m_LogText_OutputPort[0].isConnected()) {
1725 #if FW_OBJECT_NAMES == 1
1726  const char* _formatString =
1727  "(%s) %s: Could not remove file %s, returned status %" PRIu32 "";
1728 #else
1729  const char* _formatString =
1730  "%s: Could not remove file %s, returned status %" PRIu32 "";
1731 #endif
1732 
1733  Fw::TextLogString _logString;
1734  _logString.format(
1735  _formatString,
1736 #if FW_OBJECT_NAMES == 1
1737  this->m_objName.toChar(),
1738 #endif
1739  "FileRemoveError ",
1740  fileName.toChar(),
1741  status
1742  );
1743 
1744  this->m_LogText_OutputPort[0].invoke(
1745  _id,
1746  _logTime,
1748  _logString
1749  );
1750  }
1751 #endif
1752  }
1753 
1756  const Fw::StringBase& command,
1757  U32 status
1758  ) const
1759  {
1760  // Get the time
1761  Fw::Time _logTime;
1762  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1763  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1764  }
1765 
1766  FwEventIdType _id = static_cast<FwEventIdType>(0);
1767 
1768  _id = this->getIdBase() + EVENTID_SHELLCOMMANDFAILED;
1769 
1770  // Emit the event on the log port
1771  if (this->m_eventOut_OutputPort[0].isConnected()) {
1772  Fw::LogBuffer _logBuff;
1774 
1775 #if FW_AMPCS_COMPATIBLE
1776  // Serialize the number of arguments
1777  _status = _logBuff.serialize(static_cast<U8>(2));
1778  FW_ASSERT(
1779  _status == Fw::FW_SERIALIZE_OK,
1780  static_cast<FwAssertArgType>(_status)
1781  );
1782 #endif
1783 
1784  _status = command.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1785  FW_ASSERT(
1786  _status == Fw::FW_SERIALIZE_OK,
1787  static_cast<FwAssertArgType>(_status)
1788  );
1789 
1790 #if FW_AMPCS_COMPATIBLE
1791  // Serialize the argument size
1792  _status = _logBuff.serialize(
1793  static_cast<U8>(sizeof(U32))
1794  );
1795  FW_ASSERT(
1796  _status == Fw::FW_SERIALIZE_OK,
1797  static_cast<FwAssertArgType>(_status)
1798  );
1799 #endif
1800  _status = _logBuff.serialize(status);
1801  FW_ASSERT(
1802  _status == Fw::FW_SERIALIZE_OK,
1803  static_cast<FwAssertArgType>(_status)
1804  );
1805 
1806  this->m_eventOut_OutputPort[0].invoke(
1807  _id,
1808  _logTime,
1810  _logBuff
1811  );
1812  }
1813 
1814  // Emit the event on the text log port
1815 #if FW_ENABLE_TEXT_LOGGING
1816  if (this->m_LogText_OutputPort[0].isConnected()) {
1817 #if FW_OBJECT_NAMES == 1
1818  const char* _formatString =
1819  "(%s) %s: Shell command %s failed with status %" PRIu32 "";
1820 #else
1821  const char* _formatString =
1822  "%s: Shell command %s failed with status %" PRIu32 "";
1823 #endif
1824 
1825  Fw::TextLogString _logString;
1826  _logString.format(
1827  _formatString,
1828 #if FW_OBJECT_NAMES == 1
1829  this->m_objName.toChar(),
1830 #endif
1831  "ShellCommandFailed ",
1832  command.toChar(),
1833  status
1834  );
1835 
1836  this->m_LogText_OutputPort[0].invoke(
1837  _id,
1838  _logTime,
1840  _logString
1841  );
1842  }
1843 #endif
1844  }
1845 
1848  const Fw::StringBase& source,
1849  const Fw::StringBase& target,
1850  U32 status
1851  ) const
1852  {
1853  // Get the time
1854  Fw::Time _logTime;
1855  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1856  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1857  }
1858 
1859  FwEventIdType _id = static_cast<FwEventIdType>(0);
1860 
1861  _id = this->getIdBase() + EVENTID_APPENDFILEFAILED;
1862 
1863  // Emit the event on the log port
1864  if (this->m_eventOut_OutputPort[0].isConnected()) {
1865  Fw::LogBuffer _logBuff;
1867 
1868 #if FW_AMPCS_COMPATIBLE
1869  // Serialize the number of arguments
1870  _status = _logBuff.serialize(static_cast<U8>(3));
1871  FW_ASSERT(
1872  _status == Fw::FW_SERIALIZE_OK,
1873  static_cast<FwAssertArgType>(_status)
1874  );
1875 #endif
1876 
1877  _status = source.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1878  FW_ASSERT(
1879  _status == Fw::FW_SERIALIZE_OK,
1880  static_cast<FwAssertArgType>(_status)
1881  );
1882 
1883  _status = target.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1884  FW_ASSERT(
1885  _status == Fw::FW_SERIALIZE_OK,
1886  static_cast<FwAssertArgType>(_status)
1887  );
1888 
1889 #if FW_AMPCS_COMPATIBLE
1890  // Serialize the argument size
1891  _status = _logBuff.serialize(
1892  static_cast<U8>(sizeof(U32))
1893  );
1894  FW_ASSERT(
1895  _status == Fw::FW_SERIALIZE_OK,
1896  static_cast<FwAssertArgType>(_status)
1897  );
1898 #endif
1899  _status = _logBuff.serialize(status);
1900  FW_ASSERT(
1901  _status == Fw::FW_SERIALIZE_OK,
1902  static_cast<FwAssertArgType>(_status)
1903  );
1904 
1905  this->m_eventOut_OutputPort[0].invoke(
1906  _id,
1907  _logTime,
1909  _logBuff
1910  );
1911  }
1912 
1913  // Emit the event on the text log port
1914 #if FW_ENABLE_TEXT_LOGGING
1915  if (this->m_LogText_OutputPort[0].isConnected()) {
1916 #if FW_OBJECT_NAMES == 1
1917  const char* _formatString =
1918  "(%s) %s: Appending %s onto %s failed with status %" PRIu32 "";
1919 #else
1920  const char* _formatString =
1921  "%s: Appending %s onto %s failed with status %" PRIu32 "";
1922 #endif
1923 
1924  Fw::TextLogString _logString;
1925  _logString.format(
1926  _formatString,
1927 #if FW_OBJECT_NAMES == 1
1928  this->m_objName.toChar(),
1929 #endif
1930  "AppendFileFailed ",
1931  source.toChar(),
1932  target.toChar(),
1933  status
1934  );
1935 
1936  this->m_LogText_OutputPort[0].invoke(
1937  _id,
1938  _logTime,
1940  _logString
1941  );
1942  }
1943 #endif
1944  }
1945 
1948  const Fw::StringBase& source,
1949  const Fw::StringBase& target
1950  ) const
1951  {
1952  // Get the time
1953  Fw::Time _logTime;
1954  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1955  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1956  }
1957 
1958  FwEventIdType _id = static_cast<FwEventIdType>(0);
1959 
1960  _id = this->getIdBase() + EVENTID_APPENDFILESUCCEEDED;
1961 
1962  // Emit the event on the log port
1963  if (this->m_eventOut_OutputPort[0].isConnected()) {
1964  Fw::LogBuffer _logBuff;
1966 
1967 #if FW_AMPCS_COMPATIBLE
1968  // Serialize the number of arguments
1969  _status = _logBuff.serialize(static_cast<U8>(2));
1970  FW_ASSERT(
1971  _status == Fw::FW_SERIALIZE_OK,
1972  static_cast<FwAssertArgType>(_status)
1973  );
1974 #endif
1975 
1976  _status = source.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1977  FW_ASSERT(
1978  _status == Fw::FW_SERIALIZE_OK,
1979  static_cast<FwAssertArgType>(_status)
1980  );
1981 
1982  _status = target.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1983  FW_ASSERT(
1984  _status == Fw::FW_SERIALIZE_OK,
1985  static_cast<FwAssertArgType>(_status)
1986  );
1987 
1988  this->m_eventOut_OutputPort[0].invoke(
1989  _id,
1990  _logTime,
1992  _logBuff
1993  );
1994  }
1995 
1996  // Emit the event on the text log port
1997 #if FW_ENABLE_TEXT_LOGGING
1998  if (this->m_LogText_OutputPort[0].isConnected()) {
1999 #if FW_OBJECT_NAMES == 1
2000  const char* _formatString =
2001  "(%s) %s: Appended %s to the end of %s";
2002 #else
2003  const char* _formatString =
2004  "%s: Appended %s to the end of %s";
2005 #endif
2006 
2007  Fw::TextLogString _logString;
2008  _logString.format(
2009  _formatString,
2010 #if FW_OBJECT_NAMES == 1
2011  this->m_objName.toChar(),
2012 #endif
2013  "AppendFileSucceeded ",
2014  source.toChar(),
2015  target.toChar()
2016  );
2017 
2018  this->m_LogText_OutputPort[0].invoke(
2019  _id,
2020  _logTime,
2022  _logString
2023  );
2024  }
2025 #endif
2026  }
2027 
2030  {
2031  // Get the time
2032  Fw::Time _logTime;
2033  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2034  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2035  }
2036 
2037  FwEventIdType _id = static_cast<FwEventIdType>(0);
2038 
2039  _id = this->getIdBase() + EVENTID_SHELLCOMMANDSUCCEEDED;
2040 
2041  // Emit the event on the log port
2042  if (this->m_eventOut_OutputPort[0].isConnected()) {
2043  Fw::LogBuffer _logBuff;
2045 
2046 #if FW_AMPCS_COMPATIBLE
2047  // Serialize the number of arguments
2048  _status = _logBuff.serialize(static_cast<U8>(1));
2049  FW_ASSERT(
2050  _status == Fw::FW_SERIALIZE_OK,
2051  static_cast<FwAssertArgType>(_status)
2052  );
2053 #endif
2054 
2055  _status = command.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2056  FW_ASSERT(
2057  _status == Fw::FW_SERIALIZE_OK,
2058  static_cast<FwAssertArgType>(_status)
2059  );
2060 
2061  this->m_eventOut_OutputPort[0].invoke(
2062  _id,
2063  _logTime,
2065  _logBuff
2066  );
2067  }
2068 
2069  // Emit the event on the text log port
2070 #if FW_ENABLE_TEXT_LOGGING
2071  if (this->m_LogText_OutputPort[0].isConnected()) {
2072 #if FW_OBJECT_NAMES == 1
2073  const char* _formatString =
2074  "(%s) %s: Shell command %s succeeded";
2075 #else
2076  const char* _formatString =
2077  "%s: Shell command %s succeeded";
2078 #endif
2079 
2080  Fw::TextLogString _logString;
2081  _logString.format(
2082  _formatString,
2083 #if FW_OBJECT_NAMES == 1
2084  this->m_objName.toChar(),
2085 #endif
2086  "ShellCommandSucceeded ",
2087  command.toChar()
2088  );
2089 
2090  this->m_LogText_OutputPort[0].invoke(
2091  _id,
2092  _logTime,
2094  _logString
2095  );
2096  }
2097 #endif
2098  }
2099 
2102  {
2103  // Get the time
2104  Fw::Time _logTime;
2105  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2106  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2107  }
2108 
2109  FwEventIdType _id = static_cast<FwEventIdType>(0);
2110 
2112 
2113  // Emit the event on the log port
2114  if (this->m_eventOut_OutputPort[0].isConnected()) {
2115  Fw::LogBuffer _logBuff;
2117 
2118 #if FW_AMPCS_COMPATIBLE
2119  // Serialize the number of arguments
2120  _status = _logBuff.serialize(static_cast<U8>(1));
2121  FW_ASSERT(
2122  _status == Fw::FW_SERIALIZE_OK,
2123  static_cast<FwAssertArgType>(_status)
2124  );
2125 #endif
2126 
2127  _status = dirName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2128  FW_ASSERT(
2129  _status == Fw::FW_SERIALIZE_OK,
2130  static_cast<FwAssertArgType>(_status)
2131  );
2132 
2133  this->m_eventOut_OutputPort[0].invoke(
2134  _id,
2135  _logTime,
2137  _logBuff
2138  );
2139  }
2140 
2141  // Emit the event on the text log port
2142 #if FW_ENABLE_TEXT_LOGGING
2143  if (this->m_LogText_OutputPort[0].isConnected()) {
2144 #if FW_OBJECT_NAMES == 1
2145  const char* _formatString =
2146  "(%s) %s: Created directory %s successfully";
2147 #else
2148  const char* _formatString =
2149  "%s: Created directory %s successfully";
2150 #endif
2151 
2152  Fw::TextLogString _logString;
2153  _logString.format(
2154  _formatString,
2155 #if FW_OBJECT_NAMES == 1
2156  this->m_objName.toChar(),
2157 #endif
2158  "CreateDirectorySucceeded ",
2159  dirName.toChar()
2160  );
2161 
2162  this->m_LogText_OutputPort[0].invoke(
2163  _id,
2164  _logTime,
2166  _logString
2167  );
2168  }
2169 #endif
2170  }
2171 
2174  {
2175  // Get the time
2176  Fw::Time _logTime;
2177  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2178  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2179  }
2180 
2181  FwEventIdType _id = static_cast<FwEventIdType>(0);
2182 
2184 
2185  // Emit the event on the log port
2186  if (this->m_eventOut_OutputPort[0].isConnected()) {
2187  Fw::LogBuffer _logBuff;
2189 
2190 #if FW_AMPCS_COMPATIBLE
2191  // Serialize the number of arguments
2192  _status = _logBuff.serialize(static_cast<U8>(1));
2193  FW_ASSERT(
2194  _status == Fw::FW_SERIALIZE_OK,
2195  static_cast<FwAssertArgType>(_status)
2196  );
2197 #endif
2198 
2199  _status = dirName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2200  FW_ASSERT(
2201  _status == Fw::FW_SERIALIZE_OK,
2202  static_cast<FwAssertArgType>(_status)
2203  );
2204 
2205  this->m_eventOut_OutputPort[0].invoke(
2206  _id,
2207  _logTime,
2209  _logBuff
2210  );
2211  }
2212 
2213  // Emit the event on the text log port
2214 #if FW_ENABLE_TEXT_LOGGING
2215  if (this->m_LogText_OutputPort[0].isConnected()) {
2216 #if FW_OBJECT_NAMES == 1
2217  const char* _formatString =
2218  "(%s) %s: Removed directory %s successfully";
2219 #else
2220  const char* _formatString =
2221  "%s: Removed directory %s successfully";
2222 #endif
2223 
2224  Fw::TextLogString _logString;
2225  _logString.format(
2226  _formatString,
2227 #if FW_OBJECT_NAMES == 1
2228  this->m_objName.toChar(),
2229 #endif
2230  "RemoveDirectorySucceeded ",
2231  dirName.toChar()
2232  );
2233 
2234  this->m_LogText_OutputPort[0].invoke(
2235  _id,
2236  _logTime,
2238  _logString
2239  );
2240  }
2241 #endif
2242  }
2243 
2246  const Fw::StringBase& sourceFileName,
2247  const Fw::StringBase& destFileName
2248  ) const
2249  {
2250  // Get the time
2251  Fw::Time _logTime;
2252  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2253  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2254  }
2255 
2256  FwEventIdType _id = static_cast<FwEventIdType>(0);
2257 
2258  _id = this->getIdBase() + EVENTID_MOVEFILESUCCEEDED;
2259 
2260  // Emit the event on the log port
2261  if (this->m_eventOut_OutputPort[0].isConnected()) {
2262  Fw::LogBuffer _logBuff;
2264 
2265 #if FW_AMPCS_COMPATIBLE
2266  // Serialize the number of arguments
2267  _status = _logBuff.serialize(static_cast<U8>(2));
2268  FW_ASSERT(
2269  _status == Fw::FW_SERIALIZE_OK,
2270  static_cast<FwAssertArgType>(_status)
2271  );
2272 #endif
2273 
2274  _status = sourceFileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2275  FW_ASSERT(
2276  _status == Fw::FW_SERIALIZE_OK,
2277  static_cast<FwAssertArgType>(_status)
2278  );
2279 
2280  _status = destFileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2281  FW_ASSERT(
2282  _status == Fw::FW_SERIALIZE_OK,
2283  static_cast<FwAssertArgType>(_status)
2284  );
2285 
2286  this->m_eventOut_OutputPort[0].invoke(
2287  _id,
2288  _logTime,
2290  _logBuff
2291  );
2292  }
2293 
2294  // Emit the event on the text log port
2295 #if FW_ENABLE_TEXT_LOGGING
2296  if (this->m_LogText_OutputPort[0].isConnected()) {
2297 #if FW_OBJECT_NAMES == 1
2298  const char* _formatString =
2299  "(%s) %s: Moved file %s to file %s successfully";
2300 #else
2301  const char* _formatString =
2302  "%s: Moved file %s to file %s successfully";
2303 #endif
2304 
2305  Fw::TextLogString _logString;
2306  _logString.format(
2307  _formatString,
2308 #if FW_OBJECT_NAMES == 1
2309  this->m_objName.toChar(),
2310 #endif
2311  "MoveFileSucceeded ",
2312  sourceFileName.toChar(),
2313  destFileName.toChar()
2314  );
2315 
2316  this->m_LogText_OutputPort[0].invoke(
2317  _id,
2318  _logTime,
2320  _logString
2321  );
2322  }
2323 #endif
2324  }
2325 
2328  {
2329  // Get the time
2330  Fw::Time _logTime;
2331  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2332  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2333  }
2334 
2335  FwEventIdType _id = static_cast<FwEventIdType>(0);
2336 
2337  _id = this->getIdBase() + EVENTID_REMOVEFILESUCCEEDED;
2338 
2339  // Emit the event on the log port
2340  if (this->m_eventOut_OutputPort[0].isConnected()) {
2341  Fw::LogBuffer _logBuff;
2343 
2344 #if FW_AMPCS_COMPATIBLE
2345  // Serialize the number of arguments
2346  _status = _logBuff.serialize(static_cast<U8>(1));
2347  FW_ASSERT(
2348  _status == Fw::FW_SERIALIZE_OK,
2349  static_cast<FwAssertArgType>(_status)
2350  );
2351 #endif
2352 
2353  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2354  FW_ASSERT(
2355  _status == Fw::FW_SERIALIZE_OK,
2356  static_cast<FwAssertArgType>(_status)
2357  );
2358 
2359  this->m_eventOut_OutputPort[0].invoke(
2360  _id,
2361  _logTime,
2363  _logBuff
2364  );
2365  }
2366 
2367  // Emit the event on the text log port
2368 #if FW_ENABLE_TEXT_LOGGING
2369  if (this->m_LogText_OutputPort[0].isConnected()) {
2370 #if FW_OBJECT_NAMES == 1
2371  const char* _formatString =
2372  "(%s) %s: Removed file %s successfully";
2373 #else
2374  const char* _formatString =
2375  "%s: Removed file %s successfully";
2376 #endif
2377 
2378  Fw::TextLogString _logString;
2379  _logString.format(
2380  _formatString,
2381 #if FW_OBJECT_NAMES == 1
2382  this->m_objName.toChar(),
2383 #endif
2384  "RemoveFileSucceeded ",
2385  fileName.toChar()
2386  );
2387 
2388  this->m_LogText_OutputPort[0].invoke(
2389  _id,
2390  _logTime,
2392  _logString
2393  );
2394  }
2395 #endif
2396  }
2397 
2400  const Fw::StringBase& source,
2401  const Fw::StringBase& target
2402  ) const
2403  {
2404  // Get the time
2405  Fw::Time _logTime;
2406  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2407  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2408  }
2409 
2410  FwEventIdType _id = static_cast<FwEventIdType>(0);
2411 
2412  _id = this->getIdBase() + EVENTID_APPENDFILESTARTED;
2413 
2414  // Emit the event on the log port
2415  if (this->m_eventOut_OutputPort[0].isConnected()) {
2416  Fw::LogBuffer _logBuff;
2418 
2419 #if FW_AMPCS_COMPATIBLE
2420  // Serialize the number of arguments
2421  _status = _logBuff.serialize(static_cast<U8>(2));
2422  FW_ASSERT(
2423  _status == Fw::FW_SERIALIZE_OK,
2424  static_cast<FwAssertArgType>(_status)
2425  );
2426 #endif
2427 
2428  _status = source.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2429  FW_ASSERT(
2430  _status == Fw::FW_SERIALIZE_OK,
2431  static_cast<FwAssertArgType>(_status)
2432  );
2433 
2434  _status = target.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2435  FW_ASSERT(
2436  _status == Fw::FW_SERIALIZE_OK,
2437  static_cast<FwAssertArgType>(_status)
2438  );
2439 
2440  this->m_eventOut_OutputPort[0].invoke(
2441  _id,
2442  _logTime,
2444  _logBuff
2445  );
2446  }
2447 
2448  // Emit the event on the text log port
2449 #if FW_ENABLE_TEXT_LOGGING
2450  if (this->m_LogText_OutputPort[0].isConnected()) {
2451 #if FW_OBJECT_NAMES == 1
2452  const char* _formatString =
2453  "(%s) %s: Appending file %s to the end of %s...";
2454 #else
2455  const char* _formatString =
2456  "%s: Appending file %s to the end of %s...";
2457 #endif
2458 
2459  Fw::TextLogString _logString;
2460  _logString.format(
2461  _formatString,
2462 #if FW_OBJECT_NAMES == 1
2463  this->m_objName.toChar(),
2464 #endif
2465  "AppendFileStarted ",
2466  source.toChar(),
2467  target.toChar()
2468  );
2469 
2470  this->m_LogText_OutputPort[0].invoke(
2471  _id,
2472  _logTime,
2474  _logString
2475  );
2476  }
2477 #endif
2478  }
2479 
2482  {
2483  // Get the time
2484  Fw::Time _logTime;
2485  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2486  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2487  }
2488 
2489  FwEventIdType _id = static_cast<FwEventIdType>(0);
2490 
2491  _id = this->getIdBase() + EVENTID_SHELLCOMMANDSTARTED;
2492 
2493  // Emit the event on the log port
2494  if (this->m_eventOut_OutputPort[0].isConnected()) {
2495  Fw::LogBuffer _logBuff;
2497 
2498 #if FW_AMPCS_COMPATIBLE
2499  // Serialize the number of arguments
2500  _status = _logBuff.serialize(static_cast<U8>(1));
2501  FW_ASSERT(
2502  _status == Fw::FW_SERIALIZE_OK,
2503  static_cast<FwAssertArgType>(_status)
2504  );
2505 #endif
2506 
2507  _status = command.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2508  FW_ASSERT(
2509  _status == Fw::FW_SERIALIZE_OK,
2510  static_cast<FwAssertArgType>(_status)
2511  );
2512 
2513  this->m_eventOut_OutputPort[0].invoke(
2514  _id,
2515  _logTime,
2517  _logBuff
2518  );
2519  }
2520 
2521  // Emit the event on the text log port
2522 #if FW_ENABLE_TEXT_LOGGING
2523  if (this->m_LogText_OutputPort[0].isConnected()) {
2524 #if FW_OBJECT_NAMES == 1
2525  const char* _formatString =
2526  "(%s) %s: Running shell command %s...";
2527 #else
2528  const char* _formatString =
2529  "%s: Running shell command %s...";
2530 #endif
2531 
2532  Fw::TextLogString _logString;
2533  _logString.format(
2534  _formatString,
2535 #if FW_OBJECT_NAMES == 1
2536  this->m_objName.toChar(),
2537 #endif
2538  "ShellCommandStarted ",
2539  command.toChar()
2540  );
2541 
2542  this->m_LogText_OutputPort[0].invoke(
2543  _id,
2544  _logTime,
2546  _logString
2547  );
2548  }
2549 #endif
2550  }
2551 
2554  {
2555  // Get the time
2556  Fw::Time _logTime;
2557  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2558  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2559  }
2560 
2561  FwEventIdType _id = static_cast<FwEventIdType>(0);
2562 
2563  _id = this->getIdBase() + EVENTID_CREATEDIRECTORYSTARTED;
2564 
2565  // Emit the event on the log port
2566  if (this->m_eventOut_OutputPort[0].isConnected()) {
2567  Fw::LogBuffer _logBuff;
2569 
2570 #if FW_AMPCS_COMPATIBLE
2571  // Serialize the number of arguments
2572  _status = _logBuff.serialize(static_cast<U8>(1));
2573  FW_ASSERT(
2574  _status == Fw::FW_SERIALIZE_OK,
2575  static_cast<FwAssertArgType>(_status)
2576  );
2577 #endif
2578 
2579  _status = dirName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2580  FW_ASSERT(
2581  _status == Fw::FW_SERIALIZE_OK,
2582  static_cast<FwAssertArgType>(_status)
2583  );
2584 
2585  this->m_eventOut_OutputPort[0].invoke(
2586  _id,
2587  _logTime,
2589  _logBuff
2590  );
2591  }
2592 
2593  // Emit the event on the text log port
2594 #if FW_ENABLE_TEXT_LOGGING
2595  if (this->m_LogText_OutputPort[0].isConnected()) {
2596 #if FW_OBJECT_NAMES == 1
2597  const char* _formatString =
2598  "(%s) %s: Creating directory %s...";
2599 #else
2600  const char* _formatString =
2601  "%s: Creating directory %s...";
2602 #endif
2603 
2604  Fw::TextLogString _logString;
2605  _logString.format(
2606  _formatString,
2607 #if FW_OBJECT_NAMES == 1
2608  this->m_objName.toChar(),
2609 #endif
2610  "CreateDirectoryStarted ",
2611  dirName.toChar()
2612  );
2613 
2614  this->m_LogText_OutputPort[0].invoke(
2615  _id,
2616  _logTime,
2618  _logString
2619  );
2620  }
2621 #endif
2622  }
2623 
2626  {
2627  // Get the time
2628  Fw::Time _logTime;
2629  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2630  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2631  }
2632 
2633  FwEventIdType _id = static_cast<FwEventIdType>(0);
2634 
2635  _id = this->getIdBase() + EVENTID_REMOVEDIRECTORYSTARTED;
2636 
2637  // Emit the event on the log port
2638  if (this->m_eventOut_OutputPort[0].isConnected()) {
2639  Fw::LogBuffer _logBuff;
2641 
2642 #if FW_AMPCS_COMPATIBLE
2643  // Serialize the number of arguments
2644  _status = _logBuff.serialize(static_cast<U8>(1));
2645  FW_ASSERT(
2646  _status == Fw::FW_SERIALIZE_OK,
2647  static_cast<FwAssertArgType>(_status)
2648  );
2649 #endif
2650 
2651  _status = dirName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2652  FW_ASSERT(
2653  _status == Fw::FW_SERIALIZE_OK,
2654  static_cast<FwAssertArgType>(_status)
2655  );
2656 
2657  this->m_eventOut_OutputPort[0].invoke(
2658  _id,
2659  _logTime,
2661  _logBuff
2662  );
2663  }
2664 
2665  // Emit the event on the text log port
2666 #if FW_ENABLE_TEXT_LOGGING
2667  if (this->m_LogText_OutputPort[0].isConnected()) {
2668 #if FW_OBJECT_NAMES == 1
2669  const char* _formatString =
2670  "(%s) %s: Removing directory %s...";
2671 #else
2672  const char* _formatString =
2673  "%s: Removing directory %s...";
2674 #endif
2675 
2676  Fw::TextLogString _logString;
2677  _logString.format(
2678  _formatString,
2679 #if FW_OBJECT_NAMES == 1
2680  this->m_objName.toChar(),
2681 #endif
2682  "RemoveDirectoryStarted ",
2683  dirName.toChar()
2684  );
2685 
2686  this->m_LogText_OutputPort[0].invoke(
2687  _id,
2688  _logTime,
2690  _logString
2691  );
2692  }
2693 #endif
2694  }
2695 
2698  const Fw::StringBase& sourceFileName,
2699  const Fw::StringBase& destFileName
2700  ) const
2701  {
2702  // Get the time
2703  Fw::Time _logTime;
2704  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2705  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2706  }
2707 
2708  FwEventIdType _id = static_cast<FwEventIdType>(0);
2709 
2710  _id = this->getIdBase() + EVENTID_MOVEFILESTARTED;
2711 
2712  // Emit the event on the log port
2713  if (this->m_eventOut_OutputPort[0].isConnected()) {
2714  Fw::LogBuffer _logBuff;
2716 
2717 #if FW_AMPCS_COMPATIBLE
2718  // Serialize the number of arguments
2719  _status = _logBuff.serialize(static_cast<U8>(2));
2720  FW_ASSERT(
2721  _status == Fw::FW_SERIALIZE_OK,
2722  static_cast<FwAssertArgType>(_status)
2723  );
2724 #endif
2725 
2726  _status = sourceFileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2727  FW_ASSERT(
2728  _status == Fw::FW_SERIALIZE_OK,
2729  static_cast<FwAssertArgType>(_status)
2730  );
2731 
2732  _status = destFileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2733  FW_ASSERT(
2734  _status == Fw::FW_SERIALIZE_OK,
2735  static_cast<FwAssertArgType>(_status)
2736  );
2737 
2738  this->m_eventOut_OutputPort[0].invoke(
2739  _id,
2740  _logTime,
2742  _logBuff
2743  );
2744  }
2745 
2746  // Emit the event on the text log port
2747 #if FW_ENABLE_TEXT_LOGGING
2748  if (this->m_LogText_OutputPort[0].isConnected()) {
2749 #if FW_OBJECT_NAMES == 1
2750  const char* _formatString =
2751  "(%s) %s: Moving file %s to file %s...";
2752 #else
2753  const char* _formatString =
2754  "%s: Moving file %s to file %s...";
2755 #endif
2756 
2757  Fw::TextLogString _logString;
2758  _logString.format(
2759  _formatString,
2760 #if FW_OBJECT_NAMES == 1
2761  this->m_objName.toChar(),
2762 #endif
2763  "MoveFileStarted ",
2764  sourceFileName.toChar(),
2765  destFileName.toChar()
2766  );
2767 
2768  this->m_LogText_OutputPort[0].invoke(
2769  _id,
2770  _logTime,
2772  _logString
2773  );
2774  }
2775 #endif
2776  }
2777 
2780  {
2781  // Get the time
2782  Fw::Time _logTime;
2783  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2784  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2785  }
2786 
2787  FwEventIdType _id = static_cast<FwEventIdType>(0);
2788 
2789  _id = this->getIdBase() + EVENTID_REMOVEFILESTARTED;
2790 
2791  // Emit the event on the log port
2792  if (this->m_eventOut_OutputPort[0].isConnected()) {
2793  Fw::LogBuffer _logBuff;
2795 
2796 #if FW_AMPCS_COMPATIBLE
2797  // Serialize the number of arguments
2798  _status = _logBuff.serialize(static_cast<U8>(1));
2799  FW_ASSERT(
2800  _status == Fw::FW_SERIALIZE_OK,
2801  static_cast<FwAssertArgType>(_status)
2802  );
2803 #endif
2804 
2805  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2806  FW_ASSERT(
2807  _status == Fw::FW_SERIALIZE_OK,
2808  static_cast<FwAssertArgType>(_status)
2809  );
2810 
2811  this->m_eventOut_OutputPort[0].invoke(
2812  _id,
2813  _logTime,
2815  _logBuff
2816  );
2817  }
2818 
2819  // Emit the event on the text log port
2820 #if FW_ENABLE_TEXT_LOGGING
2821  if (this->m_LogText_OutputPort[0].isConnected()) {
2822 #if FW_OBJECT_NAMES == 1
2823  const char* _formatString =
2824  "(%s) %s: Removing file %s...";
2825 #else
2826  const char* _formatString =
2827  "%s: Removing file %s...";
2828 #endif
2829 
2830  Fw::TextLogString _logString;
2831  _logString.format(
2832  _formatString,
2833 #if FW_OBJECT_NAMES == 1
2834  this->m_objName.toChar(),
2835 #endif
2836  "RemoveFileStarted ",
2837  fileName.toChar()
2838  );
2839 
2840  this->m_LogText_OutputPort[0].invoke(
2841  _id,
2842  _logTime,
2844  _logString
2845  );
2846  }
2847 #endif
2848  }
2849 
2852  const Fw::StringBase& fileName,
2853  U64 size
2854  ) const
2855  {
2856  // Get the time
2857  Fw::Time _logTime;
2858  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2859  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2860  }
2861 
2862  FwEventIdType _id = static_cast<FwEventIdType>(0);
2863 
2864  _id = this->getIdBase() + EVENTID_FILESIZESUCCEEDED;
2865 
2866  // Emit the event on the log port
2867  if (this->m_eventOut_OutputPort[0].isConnected()) {
2868  Fw::LogBuffer _logBuff;
2870 
2871 #if FW_AMPCS_COMPATIBLE
2872  // Serialize the number of arguments
2873  _status = _logBuff.serialize(static_cast<U8>(2));
2874  FW_ASSERT(
2875  _status == Fw::FW_SERIALIZE_OK,
2876  static_cast<FwAssertArgType>(_status)
2877  );
2878 #endif
2879 
2880  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2881  FW_ASSERT(
2882  _status == Fw::FW_SERIALIZE_OK,
2883  static_cast<FwAssertArgType>(_status)
2884  );
2885 
2886 #if FW_AMPCS_COMPATIBLE
2887  // Serialize the argument size
2888  _status = _logBuff.serialize(
2889  static_cast<U8>(sizeof(U64))
2890  );
2891  FW_ASSERT(
2892  _status == Fw::FW_SERIALIZE_OK,
2893  static_cast<FwAssertArgType>(_status)
2894  );
2895 #endif
2896  _status = _logBuff.serialize(size);
2897  FW_ASSERT(
2898  _status == Fw::FW_SERIALIZE_OK,
2899  static_cast<FwAssertArgType>(_status)
2900  );
2901 
2902  this->m_eventOut_OutputPort[0].invoke(
2903  _id,
2904  _logTime,
2906  _logBuff
2907  );
2908  }
2909 
2910  // Emit the event on the text log port
2911 #if FW_ENABLE_TEXT_LOGGING
2912  if (this->m_LogText_OutputPort[0].isConnected()) {
2913 #if FW_OBJECT_NAMES == 1
2914  const char* _formatString =
2915  "(%s) %s: The size of file %s is %" PRIu64 " B";
2916 #else
2917  const char* _formatString =
2918  "%s: The size of file %s is %" PRIu64 " B";
2919 #endif
2920 
2921  Fw::TextLogString _logString;
2922  _logString.format(
2923  _formatString,
2924 #if FW_OBJECT_NAMES == 1
2925  this->m_objName.toChar(),
2926 #endif
2927  "FileSizeSucceeded ",
2928  fileName.toChar(),
2929  size
2930  );
2931 
2932  this->m_LogText_OutputPort[0].invoke(
2933  _id,
2934  _logTime,
2936  _logString
2937  );
2938  }
2939 #endif
2940  }
2941 
2944  const Fw::StringBase& fileName,
2945  U32 status
2946  ) const
2947  {
2948  // Get the time
2949  Fw::Time _logTime;
2950  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2951  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2952  }
2953 
2954  FwEventIdType _id = static_cast<FwEventIdType>(0);
2955 
2956  _id = this->getIdBase() + EVENTID_FILESIZEERROR;
2957 
2958  // Emit the event on the log port
2959  if (this->m_eventOut_OutputPort[0].isConnected()) {
2960  Fw::LogBuffer _logBuff;
2962 
2963 #if FW_AMPCS_COMPATIBLE
2964  // Serialize the number of arguments
2965  _status = _logBuff.serialize(static_cast<U8>(2));
2966  FW_ASSERT(
2967  _status == Fw::FW_SERIALIZE_OK,
2968  static_cast<FwAssertArgType>(_status)
2969  );
2970 #endif
2971 
2972  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2973  FW_ASSERT(
2974  _status == Fw::FW_SERIALIZE_OK,
2975  static_cast<FwAssertArgType>(_status)
2976  );
2977 
2978 #if FW_AMPCS_COMPATIBLE
2979  // Serialize the argument size
2980  _status = _logBuff.serialize(
2981  static_cast<U8>(sizeof(U32))
2982  );
2983  FW_ASSERT(
2984  _status == Fw::FW_SERIALIZE_OK,
2985  static_cast<FwAssertArgType>(_status)
2986  );
2987 #endif
2988  _status = _logBuff.serialize(status);
2989  FW_ASSERT(
2990  _status == Fw::FW_SERIALIZE_OK,
2991  static_cast<FwAssertArgType>(_status)
2992  );
2993 
2994  this->m_eventOut_OutputPort[0].invoke(
2995  _id,
2996  _logTime,
2998  _logBuff
2999  );
3000  }
3001 
3002  // Emit the event on the text log port
3003 #if FW_ENABLE_TEXT_LOGGING
3004  if (this->m_LogText_OutputPort[0].isConnected()) {
3005 #if FW_OBJECT_NAMES == 1
3006  const char* _formatString =
3007  "(%s) %s: Failed to get the size of file %s, returned status %" PRIu32 "";
3008 #else
3009  const char* _formatString =
3010  "%s: Failed to get the size of file %s, returned status %" PRIu32 "";
3011 #endif
3012 
3013  Fw::TextLogString _logString;
3014  _logString.format(
3015  _formatString,
3016 #if FW_OBJECT_NAMES == 1
3017  this->m_objName.toChar(),
3018 #endif
3019  "FileSizeError ",
3020  fileName.toChar(),
3021  status
3022  );
3023 
3024  this->m_LogText_OutputPort[0].invoke(
3025  _id,
3026  _logTime,
3028  _logString
3029  );
3030  }
3031 #endif
3032  }
3033 
3036  {
3037  // Get the time
3038  Fw::Time _logTime;
3039  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3040  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3041  }
3042 
3043  FwEventIdType _id = static_cast<FwEventIdType>(0);
3044 
3045  _id = this->getIdBase() + EVENTID_FILESIZESTARTED;
3046 
3047  // Emit the event on the log port
3048  if (this->m_eventOut_OutputPort[0].isConnected()) {
3049  Fw::LogBuffer _logBuff;
3051 
3052 #if FW_AMPCS_COMPATIBLE
3053  // Serialize the number of arguments
3054  _status = _logBuff.serialize(static_cast<U8>(1));
3055  FW_ASSERT(
3056  _status == Fw::FW_SERIALIZE_OK,
3057  static_cast<FwAssertArgType>(_status)
3058  );
3059 #endif
3060 
3061  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
3062  FW_ASSERT(
3063  _status == Fw::FW_SERIALIZE_OK,
3064  static_cast<FwAssertArgType>(_status)
3065  );
3066 
3067  this->m_eventOut_OutputPort[0].invoke(
3068  _id,
3069  _logTime,
3071  _logBuff
3072  );
3073  }
3074 
3075  // Emit the event on the text log port
3076 #if FW_ENABLE_TEXT_LOGGING
3077  if (this->m_LogText_OutputPort[0].isConnected()) {
3078 #if FW_OBJECT_NAMES == 1
3079  const char* _formatString =
3080  "(%s) %s: Checking size of file %s...";
3081 #else
3082  const char* _formatString =
3083  "%s: Checking size of file %s...";
3084 #endif
3085 
3086  Fw::TextLogString _logString;
3087  _logString.format(
3088  _formatString,
3089 #if FW_OBJECT_NAMES == 1
3090  this->m_objName.toChar(),
3091 #endif
3092  "FileSizeStarted ",
3093  fileName.toChar()
3094  );
3095 
3096  this->m_LogText_OutputPort[0].invoke(
3097  _id,
3098  _logTime,
3100  _logString
3101  );
3102  }
3103 #endif
3104  }
3105 
3106  // ----------------------------------------------------------------------
3107  // Telemetry write functions
3108  // ----------------------------------------------------------------------
3109 
3112  U32 arg,
3113  Fw::Time _tlmTime
3114  ) const
3115  {
3116  if (this->m_tlmOut_OutputPort[0].isConnected()) {
3117  if (
3118  this->m_timeCaller_OutputPort[0].isConnected() &&
3119  (_tlmTime == Fw::ZERO_TIME)
3120  ) {
3121  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
3122  }
3123 
3124  Fw::TlmBuffer _tlmBuff;
3125  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
3126  FW_ASSERT(
3127  _stat == Fw::FW_SERIALIZE_OK,
3128  static_cast<FwAssertArgType>(_stat)
3129  );
3130 
3131  FwChanIdType _id;
3132 
3133  _id = this->getIdBase() + CHANNELID_COMMANDSEXECUTED;
3134 
3135  this->m_tlmOut_OutputPort[0].invoke(
3136  _id,
3137  _tlmTime,
3138  _tlmBuff
3139  );
3140  }
3141  }
3142 
3145  U32 arg,
3146  Fw::Time _tlmTime
3147  ) const
3148  {
3149  if (this->m_tlmOut_OutputPort[0].isConnected()) {
3150  if (
3151  this->m_timeCaller_OutputPort[0].isConnected() &&
3152  (_tlmTime == Fw::ZERO_TIME)
3153  ) {
3154  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
3155  }
3156 
3157  Fw::TlmBuffer _tlmBuff;
3158  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
3159  FW_ASSERT(
3160  _stat == Fw::FW_SERIALIZE_OK,
3161  static_cast<FwAssertArgType>(_stat)
3162  );
3163 
3164  FwChanIdType _id;
3165 
3166  _id = this->getIdBase() + CHANNELID_ERRORS;
3167 
3168  this->m_tlmOut_OutputPort[0].invoke(
3169  _id,
3170  _tlmTime,
3171  _tlmBuff
3172  );
3173  }
3174  }
3175 
3176  // ----------------------------------------------------------------------
3177  // Time
3178  // ----------------------------------------------------------------------
3179 
3182  {
3183  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3184  Fw::Time _time;
3185  this->m_timeCaller_OutputPort[0].invoke(_time);
3186  return _time;
3187  }
3188  else {
3189  return Fw::Time(TB_NONE, 0, 0);
3190  }
3191  }
3192 
3193  // ----------------------------------------------------------------------
3194  // Message dispatch functions
3195  // ----------------------------------------------------------------------
3196 
3197  Fw::QueuedComponentBase::MsgDispatchStatus FileManagerComponentBase ::
3198  doDispatch()
3199  {
3200  ComponentIpcSerializableBuffer _msg;
3201  FwQueuePriorityType _priority = 0;
3202 
3203  Os::Queue::Status _msgStatus = this->m_queue.receive(
3204  _msg,
3206  _priority
3207  );
3208  FW_ASSERT(
3209  _msgStatus == Os::Queue::OP_OK,
3210  static_cast<FwAssertArgType>(_msgStatus)
3211  );
3212 
3213  // Reset to beginning of buffer
3214  _msg.resetDeser();
3215 
3216  FwEnumStoreType _desMsg = 0;
3217  Fw::SerializeStatus _deserStatus = _msg.deserialize(_desMsg);
3218  FW_ASSERT(
3219  _deserStatus == Fw::FW_SERIALIZE_OK,
3220  static_cast<FwAssertArgType>(_deserStatus)
3221  );
3222 
3223  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
3224 
3225  if (_msgType == FILEMANAGER_COMPONENT_EXIT) {
3226  return MSG_DISPATCH_EXIT;
3227  }
3228 
3229  FwIndexType portNum = 0;
3230  _deserStatus = _msg.deserialize(portNum);
3231  FW_ASSERT(
3232  _deserStatus == Fw::FW_SERIALIZE_OK,
3233  static_cast<FwAssertArgType>(_deserStatus)
3234  );
3235 
3236  switch (_msgType) {
3237  // Handle async input port pingIn
3238  case PINGIN_PING: {
3239  // Deserialize argument key
3240  U32 key;
3241  _deserStatus = _msg.deserialize(key);
3242  FW_ASSERT(
3243  _deserStatus == Fw::FW_SERIALIZE_OK,
3244  static_cast<FwAssertArgType>(_deserStatus)
3245  );
3246  // Call handler function
3247  this->pingIn_handler(
3248  portNum,
3249  key
3250  );
3251 
3252  break;
3253  }
3254 
3255  // Handle command CreateDirectory
3256  case CMD_CREATEDIRECTORY: {
3257  // Deserialize opcode
3258  FwOpcodeType _opCode = 0;
3259  _deserStatus = _msg.deserialize(_opCode);
3260  FW_ASSERT (
3261  _deserStatus == Fw::FW_SERIALIZE_OK,
3262  static_cast<FwAssertArgType>(_deserStatus)
3263  );
3264 
3265  // Deserialize command sequence
3266  U32 _cmdSeq = 0;
3267  _deserStatus = _msg.deserialize(_cmdSeq);
3268  FW_ASSERT (
3269  _deserStatus == Fw::FW_SERIALIZE_OK,
3270  static_cast<FwAssertArgType>(_deserStatus)
3271  );
3272 
3273  // Deserialize command argument buffer
3274  Fw::CmdArgBuffer args;
3275  _deserStatus = _msg.deserialize(args);
3276  FW_ASSERT (
3277  _deserStatus == Fw::FW_SERIALIZE_OK,
3278  static_cast<FwAssertArgType>(_deserStatus)
3279  );
3280 
3281  // Reset buffer
3282  args.resetDeser();
3283 
3284  // Deserialize argument dirName
3285  Fw::CmdStringArg dirName;
3286  _deserStatus = args.deserialize(dirName);
3287  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3288  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3289  this->cmdResponse_out(
3290  _opCode,
3291  _cmdSeq,
3293  );
3294  }
3295  // Don't crash the task if bad arguments were passed from the ground
3296  break;
3297  }
3298 
3299  // Make sure there was no data left over.
3300  // That means the argument buffer size was incorrect.
3301 #if FW_CMD_CHECK_RESIDUAL
3302  if (args.getBuffLeft() != 0) {
3303  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3304  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3305  }
3306  // Don't crash the task if bad arguments were passed from the ground
3307  break;
3308  }
3309 #endif
3310 
3311  // Call handler function
3313  _opCode, _cmdSeq,
3314  dirName
3315  );
3316 
3317  break;
3318  }
3319 
3320  // Handle command MoveFile
3321  case CMD_MOVEFILE: {
3322  // Deserialize opcode
3323  FwOpcodeType _opCode = 0;
3324  _deserStatus = _msg.deserialize(_opCode);
3325  FW_ASSERT (
3326  _deserStatus == Fw::FW_SERIALIZE_OK,
3327  static_cast<FwAssertArgType>(_deserStatus)
3328  );
3329 
3330  // Deserialize command sequence
3331  U32 _cmdSeq = 0;
3332  _deserStatus = _msg.deserialize(_cmdSeq);
3333  FW_ASSERT (
3334  _deserStatus == Fw::FW_SERIALIZE_OK,
3335  static_cast<FwAssertArgType>(_deserStatus)
3336  );
3337 
3338  // Deserialize command argument buffer
3339  Fw::CmdArgBuffer args;
3340  _deserStatus = _msg.deserialize(args);
3341  FW_ASSERT (
3342  _deserStatus == Fw::FW_SERIALIZE_OK,
3343  static_cast<FwAssertArgType>(_deserStatus)
3344  );
3345 
3346  // Reset buffer
3347  args.resetDeser();
3348 
3349  // Deserialize argument sourceFileName
3350  Fw::CmdStringArg sourceFileName;
3351  _deserStatus = args.deserialize(sourceFileName);
3352  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3353  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3354  this->cmdResponse_out(
3355  _opCode,
3356  _cmdSeq,
3358  );
3359  }
3360  // Don't crash the task if bad arguments were passed from the ground
3361  break;
3362  }
3363 
3364  // Deserialize argument destFileName
3365  Fw::CmdStringArg destFileName;
3366  _deserStatus = args.deserialize(destFileName);
3367  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3368  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3369  this->cmdResponse_out(
3370  _opCode,
3371  _cmdSeq,
3373  );
3374  }
3375  // Don't crash the task if bad arguments were passed from the ground
3376  break;
3377  }
3378 
3379  // Make sure there was no data left over.
3380  // That means the argument buffer size was incorrect.
3381 #if FW_CMD_CHECK_RESIDUAL
3382  if (args.getBuffLeft() != 0) {
3383  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3384  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3385  }
3386  // Don't crash the task if bad arguments were passed from the ground
3387  break;
3388  }
3389 #endif
3390 
3391  // Call handler function
3392  this->MoveFile_cmdHandler(
3393  _opCode, _cmdSeq,
3394  sourceFileName,
3395  destFileName
3396  );
3397 
3398  break;
3399  }
3400 
3401  // Handle command RemoveDirectory
3402  case CMD_REMOVEDIRECTORY: {
3403  // Deserialize opcode
3404  FwOpcodeType _opCode = 0;
3405  _deserStatus = _msg.deserialize(_opCode);
3406  FW_ASSERT (
3407  _deserStatus == Fw::FW_SERIALIZE_OK,
3408  static_cast<FwAssertArgType>(_deserStatus)
3409  );
3410 
3411  // Deserialize command sequence
3412  U32 _cmdSeq = 0;
3413  _deserStatus = _msg.deserialize(_cmdSeq);
3414  FW_ASSERT (
3415  _deserStatus == Fw::FW_SERIALIZE_OK,
3416  static_cast<FwAssertArgType>(_deserStatus)
3417  );
3418 
3419  // Deserialize command argument buffer
3420  Fw::CmdArgBuffer args;
3421  _deserStatus = _msg.deserialize(args);
3422  FW_ASSERT (
3423  _deserStatus == Fw::FW_SERIALIZE_OK,
3424  static_cast<FwAssertArgType>(_deserStatus)
3425  );
3426 
3427  // Reset buffer
3428  args.resetDeser();
3429 
3430  // Deserialize argument dirName
3431  Fw::CmdStringArg dirName;
3432  _deserStatus = args.deserialize(dirName);
3433  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3434  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3435  this->cmdResponse_out(
3436  _opCode,
3437  _cmdSeq,
3439  );
3440  }
3441  // Don't crash the task if bad arguments were passed from the ground
3442  break;
3443  }
3444 
3445  // Make sure there was no data left over.
3446  // That means the argument buffer size was incorrect.
3447 #if FW_CMD_CHECK_RESIDUAL
3448  if (args.getBuffLeft() != 0) {
3449  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3450  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3451  }
3452  // Don't crash the task if bad arguments were passed from the ground
3453  break;
3454  }
3455 #endif
3456 
3457  // Call handler function
3459  _opCode, _cmdSeq,
3460  dirName
3461  );
3462 
3463  break;
3464  }
3465 
3466  // Handle command RemoveFile
3467  case CMD_REMOVEFILE: {
3468  // Deserialize opcode
3469  FwOpcodeType _opCode = 0;
3470  _deserStatus = _msg.deserialize(_opCode);
3471  FW_ASSERT (
3472  _deserStatus == Fw::FW_SERIALIZE_OK,
3473  static_cast<FwAssertArgType>(_deserStatus)
3474  );
3475 
3476  // Deserialize command sequence
3477  U32 _cmdSeq = 0;
3478  _deserStatus = _msg.deserialize(_cmdSeq);
3479  FW_ASSERT (
3480  _deserStatus == Fw::FW_SERIALIZE_OK,
3481  static_cast<FwAssertArgType>(_deserStatus)
3482  );
3483 
3484  // Deserialize command argument buffer
3485  Fw::CmdArgBuffer args;
3486  _deserStatus = _msg.deserialize(args);
3487  FW_ASSERT (
3488  _deserStatus == Fw::FW_SERIALIZE_OK,
3489  static_cast<FwAssertArgType>(_deserStatus)
3490  );
3491 
3492  // Reset buffer
3493  args.resetDeser();
3494 
3495  // Deserialize argument fileName
3496  Fw::CmdStringArg fileName;
3497  _deserStatus = args.deserialize(fileName);
3498  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3499  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3500  this->cmdResponse_out(
3501  _opCode,
3502  _cmdSeq,
3504  );
3505  }
3506  // Don't crash the task if bad arguments were passed from the ground
3507  break;
3508  }
3509 
3510  // Deserialize argument ignoreErrors
3511  bool ignoreErrors;
3512  _deserStatus = args.deserialize(ignoreErrors);
3513  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3514  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3515  this->cmdResponse_out(
3516  _opCode,
3517  _cmdSeq,
3519  );
3520  }
3521  // Don't crash the task if bad arguments were passed from the ground
3522  break;
3523  }
3524 
3525  // Make sure there was no data left over.
3526  // That means the argument buffer size was incorrect.
3527 #if FW_CMD_CHECK_RESIDUAL
3528  if (args.getBuffLeft() != 0) {
3529  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3530  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3531  }
3532  // Don't crash the task if bad arguments were passed from the ground
3533  break;
3534  }
3535 #endif
3536 
3537  // Call handler function
3538  this->RemoveFile_cmdHandler(
3539  _opCode, _cmdSeq,
3540  fileName,
3541  ignoreErrors
3542  );
3543 
3544  break;
3545  }
3546 
3547  // Handle command ShellCommand
3548  case CMD_SHELLCOMMAND: {
3549  // Deserialize opcode
3550  FwOpcodeType _opCode = 0;
3551  _deserStatus = _msg.deserialize(_opCode);
3552  FW_ASSERT (
3553  _deserStatus == Fw::FW_SERIALIZE_OK,
3554  static_cast<FwAssertArgType>(_deserStatus)
3555  );
3556 
3557  // Deserialize command sequence
3558  U32 _cmdSeq = 0;
3559  _deserStatus = _msg.deserialize(_cmdSeq);
3560  FW_ASSERT (
3561  _deserStatus == Fw::FW_SERIALIZE_OK,
3562  static_cast<FwAssertArgType>(_deserStatus)
3563  );
3564 
3565  // Deserialize command argument buffer
3566  Fw::CmdArgBuffer args;
3567  _deserStatus = _msg.deserialize(args);
3568  FW_ASSERT (
3569  _deserStatus == Fw::FW_SERIALIZE_OK,
3570  static_cast<FwAssertArgType>(_deserStatus)
3571  );
3572 
3573  // Reset buffer
3574  args.resetDeser();
3575 
3576  // Deserialize argument command
3577  Fw::CmdStringArg command;
3578  _deserStatus = args.deserialize(command);
3579  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3580  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3581  this->cmdResponse_out(
3582  _opCode,
3583  _cmdSeq,
3585  );
3586  }
3587  // Don't crash the task if bad arguments were passed from the ground
3588  break;
3589  }
3590 
3591  // Deserialize argument logFileName
3592  Fw::CmdStringArg logFileName;
3593  _deserStatus = args.deserialize(logFileName);
3594  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3595  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3596  this->cmdResponse_out(
3597  _opCode,
3598  _cmdSeq,
3600  );
3601  }
3602  // Don't crash the task if bad arguments were passed from the ground
3603  break;
3604  }
3605 
3606  // Make sure there was no data left over.
3607  // That means the argument buffer size was incorrect.
3608 #if FW_CMD_CHECK_RESIDUAL
3609  if (args.getBuffLeft() != 0) {
3610  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3611  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3612  }
3613  // Don't crash the task if bad arguments were passed from the ground
3614  break;
3615  }
3616 #endif
3617 
3618  // Call handler function
3620  _opCode, _cmdSeq,
3621  command,
3622  logFileName
3623  );
3624 
3625  break;
3626  }
3627 
3628  // Handle command AppendFile
3629  case CMD_APPENDFILE: {
3630  // Deserialize opcode
3631  FwOpcodeType _opCode = 0;
3632  _deserStatus = _msg.deserialize(_opCode);
3633  FW_ASSERT (
3634  _deserStatus == Fw::FW_SERIALIZE_OK,
3635  static_cast<FwAssertArgType>(_deserStatus)
3636  );
3637 
3638  // Deserialize command sequence
3639  U32 _cmdSeq = 0;
3640  _deserStatus = _msg.deserialize(_cmdSeq);
3641  FW_ASSERT (
3642  _deserStatus == Fw::FW_SERIALIZE_OK,
3643  static_cast<FwAssertArgType>(_deserStatus)
3644  );
3645 
3646  // Deserialize command argument buffer
3647  Fw::CmdArgBuffer args;
3648  _deserStatus = _msg.deserialize(args);
3649  FW_ASSERT (
3650  _deserStatus == Fw::FW_SERIALIZE_OK,
3651  static_cast<FwAssertArgType>(_deserStatus)
3652  );
3653 
3654  // Reset buffer
3655  args.resetDeser();
3656 
3657  // Deserialize argument source
3658  Fw::CmdStringArg source;
3659  _deserStatus = args.deserialize(source);
3660  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3661  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3662  this->cmdResponse_out(
3663  _opCode,
3664  _cmdSeq,
3666  );
3667  }
3668  // Don't crash the task if bad arguments were passed from the ground
3669  break;
3670  }
3671 
3672  // Deserialize argument target
3673  Fw::CmdStringArg target;
3674  _deserStatus = args.deserialize(target);
3675  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3676  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3677  this->cmdResponse_out(
3678  _opCode,
3679  _cmdSeq,
3681  );
3682  }
3683  // Don't crash the task if bad arguments were passed from the ground
3684  break;
3685  }
3686 
3687  // Make sure there was no data left over.
3688  // That means the argument buffer size was incorrect.
3689 #if FW_CMD_CHECK_RESIDUAL
3690  if (args.getBuffLeft() != 0) {
3691  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3692  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3693  }
3694  // Don't crash the task if bad arguments were passed from the ground
3695  break;
3696  }
3697 #endif
3698 
3699  // Call handler function
3700  this->AppendFile_cmdHandler(
3701  _opCode, _cmdSeq,
3702  source,
3703  target
3704  );
3705 
3706  break;
3707  }
3708 
3709  // Handle command FileSize
3710  case CMD_FILESIZE: {
3711  // Deserialize opcode
3712  FwOpcodeType _opCode = 0;
3713  _deserStatus = _msg.deserialize(_opCode);
3714  FW_ASSERT (
3715  _deserStatus == Fw::FW_SERIALIZE_OK,
3716  static_cast<FwAssertArgType>(_deserStatus)
3717  );
3718 
3719  // Deserialize command sequence
3720  U32 _cmdSeq = 0;
3721  _deserStatus = _msg.deserialize(_cmdSeq);
3722  FW_ASSERT (
3723  _deserStatus == Fw::FW_SERIALIZE_OK,
3724  static_cast<FwAssertArgType>(_deserStatus)
3725  );
3726 
3727  // Deserialize command argument buffer
3728  Fw::CmdArgBuffer args;
3729  _deserStatus = _msg.deserialize(args);
3730  FW_ASSERT (
3731  _deserStatus == Fw::FW_SERIALIZE_OK,
3732  static_cast<FwAssertArgType>(_deserStatus)
3733  );
3734 
3735  // Reset buffer
3736  args.resetDeser();
3737 
3738  // Deserialize argument fileName
3739  Fw::CmdStringArg fileName;
3740  _deserStatus = args.deserialize(fileName);
3741  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3742  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3743  this->cmdResponse_out(
3744  _opCode,
3745  _cmdSeq,
3747  );
3748  }
3749  // Don't crash the task if bad arguments were passed from the ground
3750  break;
3751  }
3752 
3753  // Make sure there was no data left over.
3754  // That means the argument buffer size was incorrect.
3755 #if FW_CMD_CHECK_RESIDUAL
3756  if (args.getBuffLeft() != 0) {
3757  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3758  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3759  }
3760  // Don't crash the task if bad arguments were passed from the ground
3761  break;
3762  }
3763 #endif
3764 
3765  // Call handler function
3766  this->FileSize_cmdHandler(
3767  _opCode, _cmdSeq,
3768  fileName
3769  );
3770 
3771  break;
3772  }
3773 
3774  default:
3775  return MSG_DISPATCH_ERROR;
3776  }
3777 
3778  return MSG_DISPATCH_OK;
3779  }
3780 
3781  // ----------------------------------------------------------------------
3782  // Calls for messages received on special input ports
3783  // ----------------------------------------------------------------------
3784 
3785  void FileManagerComponentBase ::
3786  m_p_cmdIn_in(
3787  Fw::PassiveComponentBase* callComp,
3788  FwIndexType portNum,
3789  FwOpcodeType opCode,
3790  U32 cmdSeq,
3791  Fw::CmdArgBuffer& args
3792  )
3793  {
3794  FW_ASSERT(callComp);
3795  FileManagerComponentBase* compPtr = static_cast<FileManagerComponentBase*>(callComp);
3796 
3797  const U32 idBase = callComp->getIdBase();
3798  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
3799 
3800  // Select base class function based on opcode
3801  switch (opCode - idBase) {
3802  case OPCODE_CREATEDIRECTORY: {
3803  compPtr->CreateDirectory_cmdHandlerBase(
3804  opCode,
3805  cmdSeq,
3806  args
3807  );
3808  break;
3809  }
3810 
3811  case OPCODE_MOVEFILE: {
3812  compPtr->MoveFile_cmdHandlerBase(
3813  opCode,
3814  cmdSeq,
3815  args
3816  );
3817  break;
3818  }
3819 
3820  case OPCODE_REMOVEDIRECTORY: {
3821  compPtr->RemoveDirectory_cmdHandlerBase(
3822  opCode,
3823  cmdSeq,
3824  args
3825  );
3826  break;
3827  }
3828 
3829  case OPCODE_REMOVEFILE: {
3830  compPtr->RemoveFile_cmdHandlerBase(
3831  opCode,
3832  cmdSeq,
3833  args
3834  );
3835  break;
3836  }
3837 
3838  case OPCODE_SHELLCOMMAND: {
3839  compPtr->ShellCommand_cmdHandlerBase(
3840  opCode,
3841  cmdSeq,
3842  args
3843  );
3844  break;
3845  }
3846 
3847  case OPCODE_APPENDFILE: {
3848  compPtr->AppendFile_cmdHandlerBase(
3849  opCode,
3850  cmdSeq,
3851  args
3852  );
3853  break;
3854  }
3855 
3856  case OPCODE_FILESIZE: {
3857  compPtr->FileSize_cmdHandlerBase(
3858  opCode,
3859  cmdSeq,
3860  args
3861  );
3862  break;
3863  }
3864  }
3865  }
3866 
3867  // ----------------------------------------------------------------------
3868  // Calls for messages received on typed input ports
3869  // ----------------------------------------------------------------------
3870 
3871  void FileManagerComponentBase ::
3872  m_p_pingIn_in(
3873  Fw::PassiveComponentBase* callComp,
3874  FwIndexType portNum,
3875  U32 key
3876  )
3877  {
3878  FW_ASSERT(callComp);
3879  FileManagerComponentBase* compPtr = static_cast<FileManagerComponentBase*>(callComp);
3880  compPtr->pingIn_handlerBase(
3881  portNum,
3882  key
3883  );
3884  }
3885 
3886 }
The File System component began deleting a directory.
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
Serialization/Deserialization operation was successful.
void log_ACTIVITY_HI_FileSizeSucceeded(const Fw::StringBase &fileName, U64 size) const
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
Definition: Time.hpp:9
void AppendFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void log_ACTIVITY_HI_CreateDirectoryStarted(const Fw::StringBase &dirName) const
Operation succeeded.
Definition: Os.hpp:26
The File System component created a new directory without error.
void log_ACTIVITY_HI_RemoveDirectorySucceeded(const Fw::StringBase &dirName) const
virtual void MoveFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &sourceFileName, const Fw::CmdStringArg &destFileName)=0
virtual void MoveFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command MoveFile.
virtual void ShellCommand_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command ShellCommand.
The File System component deleted an existing file without error.
Status
status returned from the queue send function
Definition: Queue.hpp:30
void log_WARNING_HI_FileSizeError(const Fw::StringBase &fileName, U32 status) const
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
FwIndexType getNum_cmdRegOut_OutputPorts() const
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:56
The File System component deleted and existing directory without error.
virtual void RemoveFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, bool ignoreErrors)=0
The File System component appended 2 files without error.
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
void ShellCommand_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void invoke(U32 key) const
Invoke a port interface.
Definition: PingPortAc.cpp:147
The File System component executed a shell command that returned status zero.
const Time ZERO_TIME
Definition: Time.cpp:5
An error occurred while attempting to remove a directory.
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
I32 FwEnumStoreType
Definition: FpConfig.h:64
An error occurred while attempting to remove a file.
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
Enum representing a command response.
virtual void RemoveFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RemoveFile.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
void log_ACTIVITY_HI_MoveFileStarted(const Fw::StringBase &sourceFileName, const Fw::StringBase &destFileName) const
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:37
Os::Queue m_queue
queue object for active component
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
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:150
void init()
Object initializer.
Definition: ObjBase.cpp:26
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:62
The File System component executed a shell command that returned status non-zero. ...
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
Message will block until space is available.
Definition: Queue.hpp:46
void log_ACTIVITY_HI_CreateDirectorySucceeded(const Fw::StringBase &dirName) const
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
FwIndexType getNum_eventOut_OutputPorts() const
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void invoke(FwOpcodeType opCode) const
Invoke a port interface.
FwIndexType getNum_cmdResponseOut_OutputPorts() const
The File System component began deleting an existing file.
virtual void CreateDirectory_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &dirName)=0
Serializable::SizeType getBuffLeft() const
returns how much deserialization buffer is left
void RemoveFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void init()
Initialization function.
Definition: TimePortAc.cpp:128
message to exit active component task
Append 1 file&#39;s contents to the end of another.
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 log_ACTIVITY_HI_ShellCommandSucceeded(const Fw::StringBase &command) const
void RemoveDirectory_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:87
FwIndexType getNum_timeCaller_OutputPorts() const
void init()
Initialization function.
Definition: PingPortAc.cpp:128
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
U32 FwOpcodeType
Definition: FpConfig.h:91
const char * toChar() const
Definition: ObjectName.hpp:50
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port interface.
virtual void FileSize_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command FileSize.
No time base has been established.
Definition: FpConfig.h:70
FwSizeType SizeType
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:134
virtual void ShellCommand_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &command, const Fw::CmdStringArg &logFileName)=0
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
virtual void CreateDirectory_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CreateDirectory.
void resetDeser()
reset deserialization to beginning
A serious but recoverable event.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
bool isConnected_eventOut_OutputPort(FwIndexType portNum)
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected() const
Definition: PortBase.cpp:42
void log_ACTIVITY_HI_FileSizeStarted(const Fw::StringBase &fileName) const
virtual ~FileManagerComponentBase()
Destroy FileManagerComponentBase object.
U32 FwEventIdType
Definition: FpConfig.h:103
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void MoveFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:32
The File System component appended 2 files without error.
BlockingType
message type
Definition: Queue.hpp:45
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
The File System component moved a file to a new location without error.
Command failed to deserialize.
void log_WARNING_HI_DirectoryRemoveError(const Fw::StringBase &dirName, U32 status) const
Important informational events.
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
PlatformQueuePriorityType FwQueuePriorityType
Definition: FpConfig.h:55
void log_ACTIVITY_HI_AppendFileStarted(const Fw::StringBase &source, const Fw::StringBase &target) 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].
void log_ACTIVITY_HI_ShellCommandStarted(const Fw::StringBase &command) const
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
The File System component began moving a file to a new location.
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:85
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void init()
Initialization function.
The File System component began creating a new directory.
void log_WARNING_HI_AppendFileFailed(const Fw::StringBase &source, const Fw::StringBase &target, U32 status) const
void regCommands()
Register commands with the Command Dispatcher.
void init()
Initialization function.
Definition: PingPortAc.cpp:56
Perform a Linux shell command and write the output to a log file.
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
The File System component returned status non-zero when trying to append 2 files together.
message sent/received okay
Definition: Queue.hpp:31
U8 BYTE
byte type
Definition: BasicTypes.h:35
virtual void AppendFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command AppendFile.
The File System component began executing a shell command.
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
Definition: StringBase.cpp:142
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:62
Message will return with status when space is unavailable.
Definition: Queue.hpp:47
virtual void RemoveDirectory_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RemoveDirectory.
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
FwIndexType getNum_pingOut_OutputPorts() const
void log_WARNING_HI_ShellCommandFailed(const Fw::StringBase &command, U32 status) const
void init()
Initialization function.
An error occurred while attempting to create a directory.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
void log_WARNING_HI_DirectoryCreateError(const Fw::StringBase &dirName, U32 status) const
void log_ACTIVITY_HI_RemoveFileSucceeded(const Fw::StringBase &fileName) const
An error occurred while attempting to move a file.
void log_WARNING_HI_FileMoveError(const Fw::StringBase &sourceFileName, const Fw::StringBase &destFileName, U32 status) const
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:148
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
virtual void RemoveDirectory_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &dirName)=0
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
void log_WARNING_HI_FileRemoveError(const Fw::StringBase &fileName, U32 status) const
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Definition: FpConfig.h:319
virtual const CHAR * toChar() const =0
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
U32 FwChanIdType
Definition: FpConfig.h:95
virtual void AppendFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &source, const Fw::CmdStringArg &target)=0
#define U64(C)
Definition: sha.h:180