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  this->m_pingOut_OutputPort[portNum].invoke(
846  key
847  );
848  }
849 
850  // ----------------------------------------------------------------------
851  // Command response
852  // ----------------------------------------------------------------------
853 
856  FwOpcodeType opCode,
857  U32 cmdSeq,
858  Fw::CmdResponse response
859  )
860  {
861  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
862  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
863  }
864 
865  // ----------------------------------------------------------------------
866  // Command handler base-class functions
867  //
868  // Call these functions directly to bypass the command input port
869  // ----------------------------------------------------------------------
870 
873  FwOpcodeType opCode,
874  U32 cmdSeq,
875  Fw::CmdArgBuffer& args
876  )
877  {
878  // Call pre-message hook
879  this->CreateDirectory_preMsgHook(opCode,cmdSeq);
880 
881  // Defer deserializing arguments to the message dispatcher
882  // to avoid deserializing and reserializing just for IPC
883  ComponentIpcSerializableBuffer msg;
885 
886  // Serialize for IPC
887  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_CREATEDIRECTORY));
888  FW_ASSERT (
889  _status == Fw::FW_SERIALIZE_OK,
890  static_cast<FwAssertArgType>(_status)
891  );
892 
893  // Fake port number to make message dequeue work
894  FwIndexType port = 0;
895 
896  _status = msg.serialize(port);
897  FW_ASSERT (
898  _status == Fw::FW_SERIALIZE_OK,
899  static_cast<FwAssertArgType>(_status)
900  );
901 
902  _status = msg.serialize(opCode);
903  FW_ASSERT (
904  _status == Fw::FW_SERIALIZE_OK,
905  static_cast<FwAssertArgType>(_status)
906  );
907 
908  _status = msg.serialize(cmdSeq);
909  FW_ASSERT (
910  _status == Fw::FW_SERIALIZE_OK,
911  static_cast<FwAssertArgType>(_status)
912  );
913 
914  _status = msg.serialize(args);
915  FW_ASSERT (
916  _status == Fw::FW_SERIALIZE_OK,
917  static_cast<FwAssertArgType>(_status)
918  );
919 
920  // Send message
922  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
923 
924  FW_ASSERT(
925  qStatus == Os::Queue::OP_OK,
926  static_cast<FwAssertArgType>(qStatus)
927  );
928  }
929 
932  FwOpcodeType opCode,
933  U32 cmdSeq,
934  Fw::CmdArgBuffer& args
935  )
936  {
937  // Call pre-message hook
938  this->MoveFile_preMsgHook(opCode,cmdSeq);
939 
940  // Defer deserializing arguments to the message dispatcher
941  // to avoid deserializing and reserializing just for IPC
942  ComponentIpcSerializableBuffer msg;
944 
945  // Serialize for IPC
946  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_MOVEFILE));
947  FW_ASSERT (
948  _status == Fw::FW_SERIALIZE_OK,
949  static_cast<FwAssertArgType>(_status)
950  );
951 
952  // Fake port number to make message dequeue work
953  FwIndexType port = 0;
954 
955  _status = msg.serialize(port);
956  FW_ASSERT (
957  _status == Fw::FW_SERIALIZE_OK,
958  static_cast<FwAssertArgType>(_status)
959  );
960 
961  _status = msg.serialize(opCode);
962  FW_ASSERT (
963  _status == Fw::FW_SERIALIZE_OK,
964  static_cast<FwAssertArgType>(_status)
965  );
966 
967  _status = msg.serialize(cmdSeq);
968  FW_ASSERT (
969  _status == Fw::FW_SERIALIZE_OK,
970  static_cast<FwAssertArgType>(_status)
971  );
972 
973  _status = msg.serialize(args);
974  FW_ASSERT (
975  _status == Fw::FW_SERIALIZE_OK,
976  static_cast<FwAssertArgType>(_status)
977  );
978 
979  // Send message
981  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
982 
983  FW_ASSERT(
984  qStatus == Os::Queue::OP_OK,
985  static_cast<FwAssertArgType>(qStatus)
986  );
987  }
988 
991  FwOpcodeType opCode,
992  U32 cmdSeq,
993  Fw::CmdArgBuffer& args
994  )
995  {
996  // Call pre-message hook
997  this->RemoveDirectory_preMsgHook(opCode,cmdSeq);
998 
999  // Defer deserializing arguments to the message dispatcher
1000  // to avoid deserializing and reserializing just for IPC
1001  ComponentIpcSerializableBuffer msg;
1003 
1004  // Serialize for IPC
1005  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_REMOVEDIRECTORY));
1006  FW_ASSERT (
1007  _status == Fw::FW_SERIALIZE_OK,
1008  static_cast<FwAssertArgType>(_status)
1009  );
1010 
1011  // Fake port number to make message dequeue work
1012  FwIndexType port = 0;
1013 
1014  _status = msg.serialize(port);
1015  FW_ASSERT (
1016  _status == Fw::FW_SERIALIZE_OK,
1017  static_cast<FwAssertArgType>(_status)
1018  );
1019 
1020  _status = msg.serialize(opCode);
1021  FW_ASSERT (
1022  _status == Fw::FW_SERIALIZE_OK,
1023  static_cast<FwAssertArgType>(_status)
1024  );
1025 
1026  _status = msg.serialize(cmdSeq);
1027  FW_ASSERT (
1028  _status == Fw::FW_SERIALIZE_OK,
1029  static_cast<FwAssertArgType>(_status)
1030  );
1031 
1032  _status = msg.serialize(args);
1033  FW_ASSERT (
1034  _status == Fw::FW_SERIALIZE_OK,
1035  static_cast<FwAssertArgType>(_status)
1036  );
1037 
1038  // Send message
1040  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1041 
1042  FW_ASSERT(
1043  qStatus == Os::Queue::OP_OK,
1044  static_cast<FwAssertArgType>(qStatus)
1045  );
1046  }
1047 
1050  FwOpcodeType opCode,
1051  U32 cmdSeq,
1052  Fw::CmdArgBuffer& args
1053  )
1054  {
1055  // Call pre-message hook
1056  this->RemoveFile_preMsgHook(opCode,cmdSeq);
1057 
1058  // Defer deserializing arguments to the message dispatcher
1059  // to avoid deserializing and reserializing just for IPC
1060  ComponentIpcSerializableBuffer msg;
1062 
1063  // Serialize for IPC
1064  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_REMOVEFILE));
1065  FW_ASSERT (
1066  _status == Fw::FW_SERIALIZE_OK,
1067  static_cast<FwAssertArgType>(_status)
1068  );
1069 
1070  // Fake port number to make message dequeue work
1071  FwIndexType port = 0;
1072 
1073  _status = msg.serialize(port);
1074  FW_ASSERT (
1075  _status == Fw::FW_SERIALIZE_OK,
1076  static_cast<FwAssertArgType>(_status)
1077  );
1078 
1079  _status = msg.serialize(opCode);
1080  FW_ASSERT (
1081  _status == Fw::FW_SERIALIZE_OK,
1082  static_cast<FwAssertArgType>(_status)
1083  );
1084 
1085  _status = msg.serialize(cmdSeq);
1086  FW_ASSERT (
1087  _status == Fw::FW_SERIALIZE_OK,
1088  static_cast<FwAssertArgType>(_status)
1089  );
1090 
1091  _status = msg.serialize(args);
1092  FW_ASSERT (
1093  _status == Fw::FW_SERIALIZE_OK,
1094  static_cast<FwAssertArgType>(_status)
1095  );
1096 
1097  // Send message
1099  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1100 
1101  FW_ASSERT(
1102  qStatus == Os::Queue::OP_OK,
1103  static_cast<FwAssertArgType>(qStatus)
1104  );
1105  }
1106 
1109  FwOpcodeType opCode,
1110  U32 cmdSeq,
1111  Fw::CmdArgBuffer& args
1112  )
1113  {
1114  // Call pre-message hook
1115  this->ShellCommand_preMsgHook(opCode,cmdSeq);
1116 
1117  // Defer deserializing arguments to the message dispatcher
1118  // to avoid deserializing and reserializing just for IPC
1119  ComponentIpcSerializableBuffer msg;
1121 
1122  // Serialize for IPC
1123  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_SHELLCOMMAND));
1124  FW_ASSERT (
1125  _status == Fw::FW_SERIALIZE_OK,
1126  static_cast<FwAssertArgType>(_status)
1127  );
1128 
1129  // Fake port number to make message dequeue work
1130  FwIndexType port = 0;
1131 
1132  _status = msg.serialize(port);
1133  FW_ASSERT (
1134  _status == Fw::FW_SERIALIZE_OK,
1135  static_cast<FwAssertArgType>(_status)
1136  );
1137 
1138  _status = msg.serialize(opCode);
1139  FW_ASSERT (
1140  _status == Fw::FW_SERIALIZE_OK,
1141  static_cast<FwAssertArgType>(_status)
1142  );
1143 
1144  _status = msg.serialize(cmdSeq);
1145  FW_ASSERT (
1146  _status == Fw::FW_SERIALIZE_OK,
1147  static_cast<FwAssertArgType>(_status)
1148  );
1149 
1150  _status = msg.serialize(args);
1151  FW_ASSERT (
1152  _status == Fw::FW_SERIALIZE_OK,
1153  static_cast<FwAssertArgType>(_status)
1154  );
1155 
1156  // Send message
1158  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1159 
1160  FW_ASSERT(
1161  qStatus == Os::Queue::OP_OK,
1162  static_cast<FwAssertArgType>(qStatus)
1163  );
1164  }
1165 
1168  FwOpcodeType opCode,
1169  U32 cmdSeq,
1170  Fw::CmdArgBuffer& args
1171  )
1172  {
1173  // Call pre-message hook
1174  this->AppendFile_preMsgHook(opCode,cmdSeq);
1175 
1176  // Defer deserializing arguments to the message dispatcher
1177  // to avoid deserializing and reserializing just for IPC
1178  ComponentIpcSerializableBuffer msg;
1180 
1181  // Serialize for IPC
1182  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_APPENDFILE));
1183  FW_ASSERT (
1184  _status == Fw::FW_SERIALIZE_OK,
1185  static_cast<FwAssertArgType>(_status)
1186  );
1187 
1188  // Fake port number to make message dequeue work
1189  FwIndexType port = 0;
1190 
1191  _status = msg.serialize(port);
1192  FW_ASSERT (
1193  _status == Fw::FW_SERIALIZE_OK,
1194  static_cast<FwAssertArgType>(_status)
1195  );
1196 
1197  _status = msg.serialize(opCode);
1198  FW_ASSERT (
1199  _status == Fw::FW_SERIALIZE_OK,
1200  static_cast<FwAssertArgType>(_status)
1201  );
1202 
1203  _status = msg.serialize(cmdSeq);
1204  FW_ASSERT (
1205  _status == Fw::FW_SERIALIZE_OK,
1206  static_cast<FwAssertArgType>(_status)
1207  );
1208 
1209  _status = msg.serialize(args);
1210  FW_ASSERT (
1211  _status == Fw::FW_SERIALIZE_OK,
1212  static_cast<FwAssertArgType>(_status)
1213  );
1214 
1215  // Send message
1217  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1218 
1219  FW_ASSERT(
1220  qStatus == Os::Queue::OP_OK,
1221  static_cast<FwAssertArgType>(qStatus)
1222  );
1223  }
1224 
1227  FwOpcodeType opCode,
1228  U32 cmdSeq,
1229  Fw::CmdArgBuffer& args
1230  )
1231  {
1232  // Call pre-message hook
1233  this->FileSize_preMsgHook(opCode,cmdSeq);
1234 
1235  // Defer deserializing arguments to the message dispatcher
1236  // to avoid deserializing and reserializing just for IPC
1237  ComponentIpcSerializableBuffer msg;
1239 
1240  // Serialize for IPC
1241  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_FILESIZE));
1242  FW_ASSERT (
1243  _status == Fw::FW_SERIALIZE_OK,
1244  static_cast<FwAssertArgType>(_status)
1245  );
1246 
1247  // Fake port number to make message dequeue work
1248  FwIndexType port = 0;
1249 
1250  _status = msg.serialize(port);
1251  FW_ASSERT (
1252  _status == Fw::FW_SERIALIZE_OK,
1253  static_cast<FwAssertArgType>(_status)
1254  );
1255 
1256  _status = msg.serialize(opCode);
1257  FW_ASSERT (
1258  _status == Fw::FW_SERIALIZE_OK,
1259  static_cast<FwAssertArgType>(_status)
1260  );
1261 
1262  _status = msg.serialize(cmdSeq);
1263  FW_ASSERT (
1264  _status == Fw::FW_SERIALIZE_OK,
1265  static_cast<FwAssertArgType>(_status)
1266  );
1267 
1268  _status = msg.serialize(args);
1269  FW_ASSERT (
1270  _status == Fw::FW_SERIALIZE_OK,
1271  static_cast<FwAssertArgType>(_status)
1272  );
1273 
1274  // Send message
1276  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1277 
1278  FW_ASSERT(
1279  qStatus == Os::Queue::OP_OK,
1280  static_cast<FwAssertArgType>(qStatus)
1281  );
1282  }
1283 
1284  // ----------------------------------------------------------------------
1285  // Pre-message hooks for async commands
1286  //
1287  // Each of these functions is invoked just before processing the
1288  // corresponding command. By default they do nothing. You can
1289  // override them to provide specific pre-command behavior.
1290  // ----------------------------------------------------------------------
1291 
1294  FwOpcodeType opCode,
1295  U32 cmdSeq
1296  )
1297  {
1298  // Defaults to no-op; can be overridden
1299  (void) opCode;
1300  (void) cmdSeq;
1301  }
1302 
1305  FwOpcodeType opCode,
1306  U32 cmdSeq
1307  )
1308  {
1309  // Defaults to no-op; can be overridden
1310  (void) opCode;
1311  (void) cmdSeq;
1312  }
1313 
1316  FwOpcodeType opCode,
1317  U32 cmdSeq
1318  )
1319  {
1320  // Defaults to no-op; can be overridden
1321  (void) opCode;
1322  (void) cmdSeq;
1323  }
1324 
1327  FwOpcodeType opCode,
1328  U32 cmdSeq
1329  )
1330  {
1331  // Defaults to no-op; can be overridden
1332  (void) opCode;
1333  (void) cmdSeq;
1334  }
1335 
1338  FwOpcodeType opCode,
1339  U32 cmdSeq
1340  )
1341  {
1342  // Defaults to no-op; can be overridden
1343  (void) opCode;
1344  (void) cmdSeq;
1345  }
1346 
1349  FwOpcodeType opCode,
1350  U32 cmdSeq
1351  )
1352  {
1353  // Defaults to no-op; can be overridden
1354  (void) opCode;
1355  (void) cmdSeq;
1356  }
1357 
1360  FwOpcodeType opCode,
1361  U32 cmdSeq
1362  )
1363  {
1364  // Defaults to no-op; can be overridden
1365  (void) opCode;
1366  (void) cmdSeq;
1367  }
1368 
1369  // ----------------------------------------------------------------------
1370  // Event logging functions
1371  // ----------------------------------------------------------------------
1372 
1375  const Fw::StringBase& dirName,
1376  U32 status
1377  ) const
1378  {
1379  // Get the time
1380  Fw::Time _logTime;
1381  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1382  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1383  }
1384 
1385  FwEventIdType _id = static_cast<FwEventIdType>(0);
1386 
1387  _id = this->getIdBase() + EVENTID_DIRECTORYCREATEERROR;
1388 
1389  // Emit the event on the log port
1390  if (this->m_eventOut_OutputPort[0].isConnected()) {
1391  Fw::LogBuffer _logBuff;
1393 
1394 #if FW_AMPCS_COMPATIBLE
1395  // Serialize the number of arguments
1396  _status = _logBuff.serialize(static_cast<U8>(2));
1397  FW_ASSERT(
1398  _status == Fw::FW_SERIALIZE_OK,
1399  static_cast<FwAssertArgType>(_status)
1400  );
1401 #endif
1402 
1403  _status = dirName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1404  FW_ASSERT(
1405  _status == Fw::FW_SERIALIZE_OK,
1406  static_cast<FwAssertArgType>(_status)
1407  );
1408 
1409 #if FW_AMPCS_COMPATIBLE
1410  // Serialize the argument size
1411  _status = _logBuff.serialize(
1412  static_cast<U8>(sizeof(U32))
1413  );
1414  FW_ASSERT(
1415  _status == Fw::FW_SERIALIZE_OK,
1416  static_cast<FwAssertArgType>(_status)
1417  );
1418 #endif
1419  _status = _logBuff.serialize(status);
1420  FW_ASSERT(
1421  _status == Fw::FW_SERIALIZE_OK,
1422  static_cast<FwAssertArgType>(_status)
1423  );
1424 
1425  this->m_eventOut_OutputPort[0].invoke(
1426  _id,
1427  _logTime,
1429  _logBuff
1430  );
1431  }
1432 
1433  // Emit the event on the text log port
1434 #if FW_ENABLE_TEXT_LOGGING
1435  if (this->m_LogText_OutputPort[0].isConnected()) {
1436 #if FW_OBJECT_NAMES == 1
1437  const char* _formatString =
1438  "(%s) %s: Could not create directory %s, returned status %" PRIu32 "";
1439 #else
1440  const char* _formatString =
1441  "%s: Could not create directory %s, returned status %" PRIu32 "";
1442 #endif
1443 
1444  Fw::TextLogString _logString;
1445  _logString.format(
1446  _formatString,
1447 #if FW_OBJECT_NAMES == 1
1448  this->m_objName.toChar(),
1449 #endif
1450  "DirectoryCreateError ",
1451  dirName.toChar(),
1452  status
1453  );
1454 
1455  this->m_LogText_OutputPort[0].invoke(
1456  _id,
1457  _logTime,
1459  _logString
1460  );
1461  }
1462 #endif
1463  }
1464 
1467  const Fw::StringBase& dirName,
1468  U32 status
1469  ) const
1470  {
1471  // Get the time
1472  Fw::Time _logTime;
1473  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1474  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1475  }
1476 
1477  FwEventIdType _id = static_cast<FwEventIdType>(0);
1478 
1479  _id = this->getIdBase() + EVENTID_DIRECTORYREMOVEERROR;
1480 
1481  // Emit the event on the log port
1482  if (this->m_eventOut_OutputPort[0].isConnected()) {
1483  Fw::LogBuffer _logBuff;
1485 
1486 #if FW_AMPCS_COMPATIBLE
1487  // Serialize the number of arguments
1488  _status = _logBuff.serialize(static_cast<U8>(2));
1489  FW_ASSERT(
1490  _status == Fw::FW_SERIALIZE_OK,
1491  static_cast<FwAssertArgType>(_status)
1492  );
1493 #endif
1494 
1495  _status = dirName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1496  FW_ASSERT(
1497  _status == Fw::FW_SERIALIZE_OK,
1498  static_cast<FwAssertArgType>(_status)
1499  );
1500 
1501 #if FW_AMPCS_COMPATIBLE
1502  // Serialize the argument size
1503  _status = _logBuff.serialize(
1504  static_cast<U8>(sizeof(U32))
1505  );
1506  FW_ASSERT(
1507  _status == Fw::FW_SERIALIZE_OK,
1508  static_cast<FwAssertArgType>(_status)
1509  );
1510 #endif
1511  _status = _logBuff.serialize(status);
1512  FW_ASSERT(
1513  _status == Fw::FW_SERIALIZE_OK,
1514  static_cast<FwAssertArgType>(_status)
1515  );
1516 
1517  this->m_eventOut_OutputPort[0].invoke(
1518  _id,
1519  _logTime,
1521  _logBuff
1522  );
1523  }
1524 
1525  // Emit the event on the text log port
1526 #if FW_ENABLE_TEXT_LOGGING
1527  if (this->m_LogText_OutputPort[0].isConnected()) {
1528 #if FW_OBJECT_NAMES == 1
1529  const char* _formatString =
1530  "(%s) %s: Could not remove directory %s, returned status %" PRIu32 "";
1531 #else
1532  const char* _formatString =
1533  "%s: Could not remove directory %s, returned status %" PRIu32 "";
1534 #endif
1535 
1536  Fw::TextLogString _logString;
1537  _logString.format(
1538  _formatString,
1539 #if FW_OBJECT_NAMES == 1
1540  this->m_objName.toChar(),
1541 #endif
1542  "DirectoryRemoveError ",
1543  dirName.toChar(),
1544  status
1545  );
1546 
1547  this->m_LogText_OutputPort[0].invoke(
1548  _id,
1549  _logTime,
1551  _logString
1552  );
1553  }
1554 #endif
1555  }
1556 
1559  const Fw::StringBase& sourceFileName,
1560  const Fw::StringBase& destFileName,
1561  U32 status
1562  ) const
1563  {
1564  // Get the time
1565  Fw::Time _logTime;
1566  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1567  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1568  }
1569 
1570  FwEventIdType _id = static_cast<FwEventIdType>(0);
1571 
1572  _id = this->getIdBase() + EVENTID_FILEMOVEERROR;
1573 
1574  // Emit the event on the log port
1575  if (this->m_eventOut_OutputPort[0].isConnected()) {
1576  Fw::LogBuffer _logBuff;
1578 
1579 #if FW_AMPCS_COMPATIBLE
1580  // Serialize the number of arguments
1581  _status = _logBuff.serialize(static_cast<U8>(3));
1582  FW_ASSERT(
1583  _status == Fw::FW_SERIALIZE_OK,
1584  static_cast<FwAssertArgType>(_status)
1585  );
1586 #endif
1587 
1588  _status = sourceFileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1589  FW_ASSERT(
1590  _status == Fw::FW_SERIALIZE_OK,
1591  static_cast<FwAssertArgType>(_status)
1592  );
1593 
1594  _status = destFileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1595  FW_ASSERT(
1596  _status == Fw::FW_SERIALIZE_OK,
1597  static_cast<FwAssertArgType>(_status)
1598  );
1599 
1600 #if FW_AMPCS_COMPATIBLE
1601  // Serialize the argument size
1602  _status = _logBuff.serialize(
1603  static_cast<U8>(sizeof(U32))
1604  );
1605  FW_ASSERT(
1606  _status == Fw::FW_SERIALIZE_OK,
1607  static_cast<FwAssertArgType>(_status)
1608  );
1609 #endif
1610  _status = _logBuff.serialize(status);
1611  FW_ASSERT(
1612  _status == Fw::FW_SERIALIZE_OK,
1613  static_cast<FwAssertArgType>(_status)
1614  );
1615 
1616  this->m_eventOut_OutputPort[0].invoke(
1617  _id,
1618  _logTime,
1620  _logBuff
1621  );
1622  }
1623 
1624  // Emit the event on the text log port
1625 #if FW_ENABLE_TEXT_LOGGING
1626  if (this->m_LogText_OutputPort[0].isConnected()) {
1627 #if FW_OBJECT_NAMES == 1
1628  const char* _formatString =
1629  "(%s) %s: Could not move file %s to file %s, returned status %" PRIu32 "";
1630 #else
1631  const char* _formatString =
1632  "%s: Could not move file %s to file %s, returned status %" PRIu32 "";
1633 #endif
1634 
1635  Fw::TextLogString _logString;
1636  _logString.format(
1637  _formatString,
1638 #if FW_OBJECT_NAMES == 1
1639  this->m_objName.toChar(),
1640 #endif
1641  "FileMoveError ",
1642  sourceFileName.toChar(),
1643  destFileName.toChar(),
1644  status
1645  );
1646 
1647  this->m_LogText_OutputPort[0].invoke(
1648  _id,
1649  _logTime,
1651  _logString
1652  );
1653  }
1654 #endif
1655  }
1656 
1659  const Fw::StringBase& fileName,
1660  U32 status
1661  ) const
1662  {
1663  // Get the time
1664  Fw::Time _logTime;
1665  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1666  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1667  }
1668 
1669  FwEventIdType _id = static_cast<FwEventIdType>(0);
1670 
1671  _id = this->getIdBase() + EVENTID_FILEREMOVEERROR;
1672 
1673  // Emit the event on the log port
1674  if (this->m_eventOut_OutputPort[0].isConnected()) {
1675  Fw::LogBuffer _logBuff;
1677 
1678 #if FW_AMPCS_COMPATIBLE
1679  // Serialize the number of arguments
1680  _status = _logBuff.serialize(static_cast<U8>(2));
1681  FW_ASSERT(
1682  _status == Fw::FW_SERIALIZE_OK,
1683  static_cast<FwAssertArgType>(_status)
1684  );
1685 #endif
1686 
1687  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1688  FW_ASSERT(
1689  _status == Fw::FW_SERIALIZE_OK,
1690  static_cast<FwAssertArgType>(_status)
1691  );
1692 
1693 #if FW_AMPCS_COMPATIBLE
1694  // Serialize the argument size
1695  _status = _logBuff.serialize(
1696  static_cast<U8>(sizeof(U32))
1697  );
1698  FW_ASSERT(
1699  _status == Fw::FW_SERIALIZE_OK,
1700  static_cast<FwAssertArgType>(_status)
1701  );
1702 #endif
1703  _status = _logBuff.serialize(status);
1704  FW_ASSERT(
1705  _status == Fw::FW_SERIALIZE_OK,
1706  static_cast<FwAssertArgType>(_status)
1707  );
1708 
1709  this->m_eventOut_OutputPort[0].invoke(
1710  _id,
1711  _logTime,
1713  _logBuff
1714  );
1715  }
1716 
1717  // Emit the event on the text log port
1718 #if FW_ENABLE_TEXT_LOGGING
1719  if (this->m_LogText_OutputPort[0].isConnected()) {
1720 #if FW_OBJECT_NAMES == 1
1721  const char* _formatString =
1722  "(%s) %s: Could not remove file %s, returned status %" PRIu32 "";
1723 #else
1724  const char* _formatString =
1725  "%s: Could not remove file %s, returned status %" PRIu32 "";
1726 #endif
1727 
1728  Fw::TextLogString _logString;
1729  _logString.format(
1730  _formatString,
1731 #if FW_OBJECT_NAMES == 1
1732  this->m_objName.toChar(),
1733 #endif
1734  "FileRemoveError ",
1735  fileName.toChar(),
1736  status
1737  );
1738 
1739  this->m_LogText_OutputPort[0].invoke(
1740  _id,
1741  _logTime,
1743  _logString
1744  );
1745  }
1746 #endif
1747  }
1748 
1751  const Fw::StringBase& command,
1752  U32 status
1753  ) const
1754  {
1755  // Get the time
1756  Fw::Time _logTime;
1757  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1758  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1759  }
1760 
1761  FwEventIdType _id = static_cast<FwEventIdType>(0);
1762 
1763  _id = this->getIdBase() + EVENTID_SHELLCOMMANDFAILED;
1764 
1765  // Emit the event on the log port
1766  if (this->m_eventOut_OutputPort[0].isConnected()) {
1767  Fw::LogBuffer _logBuff;
1769 
1770 #if FW_AMPCS_COMPATIBLE
1771  // Serialize the number of arguments
1772  _status = _logBuff.serialize(static_cast<U8>(2));
1773  FW_ASSERT(
1774  _status == Fw::FW_SERIALIZE_OK,
1775  static_cast<FwAssertArgType>(_status)
1776  );
1777 #endif
1778 
1779  _status = command.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1780  FW_ASSERT(
1781  _status == Fw::FW_SERIALIZE_OK,
1782  static_cast<FwAssertArgType>(_status)
1783  );
1784 
1785 #if FW_AMPCS_COMPATIBLE
1786  // Serialize the argument size
1787  _status = _logBuff.serialize(
1788  static_cast<U8>(sizeof(U32))
1789  );
1790  FW_ASSERT(
1791  _status == Fw::FW_SERIALIZE_OK,
1792  static_cast<FwAssertArgType>(_status)
1793  );
1794 #endif
1795  _status = _logBuff.serialize(status);
1796  FW_ASSERT(
1797  _status == Fw::FW_SERIALIZE_OK,
1798  static_cast<FwAssertArgType>(_status)
1799  );
1800 
1801  this->m_eventOut_OutputPort[0].invoke(
1802  _id,
1803  _logTime,
1805  _logBuff
1806  );
1807  }
1808 
1809  // Emit the event on the text log port
1810 #if FW_ENABLE_TEXT_LOGGING
1811  if (this->m_LogText_OutputPort[0].isConnected()) {
1812 #if FW_OBJECT_NAMES == 1
1813  const char* _formatString =
1814  "(%s) %s: Shell command %s failed with status %" PRIu32 "";
1815 #else
1816  const char* _formatString =
1817  "%s: Shell command %s failed with status %" PRIu32 "";
1818 #endif
1819 
1820  Fw::TextLogString _logString;
1821  _logString.format(
1822  _formatString,
1823 #if FW_OBJECT_NAMES == 1
1824  this->m_objName.toChar(),
1825 #endif
1826  "ShellCommandFailed ",
1827  command.toChar(),
1828  status
1829  );
1830 
1831  this->m_LogText_OutputPort[0].invoke(
1832  _id,
1833  _logTime,
1835  _logString
1836  );
1837  }
1838 #endif
1839  }
1840 
1843  const Fw::StringBase& source,
1844  const Fw::StringBase& target,
1845  U32 status
1846  ) const
1847  {
1848  // Get the time
1849  Fw::Time _logTime;
1850  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1851  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1852  }
1853 
1854  FwEventIdType _id = static_cast<FwEventIdType>(0);
1855 
1856  _id = this->getIdBase() + EVENTID_APPENDFILEFAILED;
1857 
1858  // Emit the event on the log port
1859  if (this->m_eventOut_OutputPort[0].isConnected()) {
1860  Fw::LogBuffer _logBuff;
1862 
1863 #if FW_AMPCS_COMPATIBLE
1864  // Serialize the number of arguments
1865  _status = _logBuff.serialize(static_cast<U8>(3));
1866  FW_ASSERT(
1867  _status == Fw::FW_SERIALIZE_OK,
1868  static_cast<FwAssertArgType>(_status)
1869  );
1870 #endif
1871 
1872  _status = source.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1873  FW_ASSERT(
1874  _status == Fw::FW_SERIALIZE_OK,
1875  static_cast<FwAssertArgType>(_status)
1876  );
1877 
1878  _status = target.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1879  FW_ASSERT(
1880  _status == Fw::FW_SERIALIZE_OK,
1881  static_cast<FwAssertArgType>(_status)
1882  );
1883 
1884 #if FW_AMPCS_COMPATIBLE
1885  // Serialize the argument size
1886  _status = _logBuff.serialize(
1887  static_cast<U8>(sizeof(U32))
1888  );
1889  FW_ASSERT(
1890  _status == Fw::FW_SERIALIZE_OK,
1891  static_cast<FwAssertArgType>(_status)
1892  );
1893 #endif
1894  _status = _logBuff.serialize(status);
1895  FW_ASSERT(
1896  _status == Fw::FW_SERIALIZE_OK,
1897  static_cast<FwAssertArgType>(_status)
1898  );
1899 
1900  this->m_eventOut_OutputPort[0].invoke(
1901  _id,
1902  _logTime,
1904  _logBuff
1905  );
1906  }
1907 
1908  // Emit the event on the text log port
1909 #if FW_ENABLE_TEXT_LOGGING
1910  if (this->m_LogText_OutputPort[0].isConnected()) {
1911 #if FW_OBJECT_NAMES == 1
1912  const char* _formatString =
1913  "(%s) %s: Appending %s onto %s failed with status %" PRIu32 "";
1914 #else
1915  const char* _formatString =
1916  "%s: Appending %s onto %s failed with status %" PRIu32 "";
1917 #endif
1918 
1919  Fw::TextLogString _logString;
1920  _logString.format(
1921  _formatString,
1922 #if FW_OBJECT_NAMES == 1
1923  this->m_objName.toChar(),
1924 #endif
1925  "AppendFileFailed ",
1926  source.toChar(),
1927  target.toChar(),
1928  status
1929  );
1930 
1931  this->m_LogText_OutputPort[0].invoke(
1932  _id,
1933  _logTime,
1935  _logString
1936  );
1937  }
1938 #endif
1939  }
1940 
1943  const Fw::StringBase& source,
1944  const Fw::StringBase& target
1945  ) const
1946  {
1947  // Get the time
1948  Fw::Time _logTime;
1949  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1950  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1951  }
1952 
1953  FwEventIdType _id = static_cast<FwEventIdType>(0);
1954 
1955  _id = this->getIdBase() + EVENTID_APPENDFILESUCCEEDED;
1956 
1957  // Emit the event on the log port
1958  if (this->m_eventOut_OutputPort[0].isConnected()) {
1959  Fw::LogBuffer _logBuff;
1961 
1962 #if FW_AMPCS_COMPATIBLE
1963  // Serialize the number of arguments
1964  _status = _logBuff.serialize(static_cast<U8>(2));
1965  FW_ASSERT(
1966  _status == Fw::FW_SERIALIZE_OK,
1967  static_cast<FwAssertArgType>(_status)
1968  );
1969 #endif
1970 
1971  _status = source.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1972  FW_ASSERT(
1973  _status == Fw::FW_SERIALIZE_OK,
1974  static_cast<FwAssertArgType>(_status)
1975  );
1976 
1977  _status = target.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
1978  FW_ASSERT(
1979  _status == Fw::FW_SERIALIZE_OK,
1980  static_cast<FwAssertArgType>(_status)
1981  );
1982 
1983  this->m_eventOut_OutputPort[0].invoke(
1984  _id,
1985  _logTime,
1987  _logBuff
1988  );
1989  }
1990 
1991  // Emit the event on the text log port
1992 #if FW_ENABLE_TEXT_LOGGING
1993  if (this->m_LogText_OutputPort[0].isConnected()) {
1994 #if FW_OBJECT_NAMES == 1
1995  const char* _formatString =
1996  "(%s) %s: Appended %s to the end of %s";
1997 #else
1998  const char* _formatString =
1999  "%s: Appended %s to the end of %s";
2000 #endif
2001 
2002  Fw::TextLogString _logString;
2003  _logString.format(
2004  _formatString,
2005 #if FW_OBJECT_NAMES == 1
2006  this->m_objName.toChar(),
2007 #endif
2008  "AppendFileSucceeded ",
2009  source.toChar(),
2010  target.toChar()
2011  );
2012 
2013  this->m_LogText_OutputPort[0].invoke(
2014  _id,
2015  _logTime,
2017  _logString
2018  );
2019  }
2020 #endif
2021  }
2022 
2025  {
2026  // Get the time
2027  Fw::Time _logTime;
2028  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2029  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2030  }
2031 
2032  FwEventIdType _id = static_cast<FwEventIdType>(0);
2033 
2034  _id = this->getIdBase() + EVENTID_SHELLCOMMANDSUCCEEDED;
2035 
2036  // Emit the event on the log port
2037  if (this->m_eventOut_OutputPort[0].isConnected()) {
2038  Fw::LogBuffer _logBuff;
2040 
2041 #if FW_AMPCS_COMPATIBLE
2042  // Serialize the number of arguments
2043  _status = _logBuff.serialize(static_cast<U8>(1));
2044  FW_ASSERT(
2045  _status == Fw::FW_SERIALIZE_OK,
2046  static_cast<FwAssertArgType>(_status)
2047  );
2048 #endif
2049 
2050  _status = command.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2051  FW_ASSERT(
2052  _status == Fw::FW_SERIALIZE_OK,
2053  static_cast<FwAssertArgType>(_status)
2054  );
2055 
2056  this->m_eventOut_OutputPort[0].invoke(
2057  _id,
2058  _logTime,
2060  _logBuff
2061  );
2062  }
2063 
2064  // Emit the event on the text log port
2065 #if FW_ENABLE_TEXT_LOGGING
2066  if (this->m_LogText_OutputPort[0].isConnected()) {
2067 #if FW_OBJECT_NAMES == 1
2068  const char* _formatString =
2069  "(%s) %s: Shell command %s succeeded";
2070 #else
2071  const char* _formatString =
2072  "%s: Shell command %s succeeded";
2073 #endif
2074 
2075  Fw::TextLogString _logString;
2076  _logString.format(
2077  _formatString,
2078 #if FW_OBJECT_NAMES == 1
2079  this->m_objName.toChar(),
2080 #endif
2081  "ShellCommandSucceeded ",
2082  command.toChar()
2083  );
2084 
2085  this->m_LogText_OutputPort[0].invoke(
2086  _id,
2087  _logTime,
2089  _logString
2090  );
2091  }
2092 #endif
2093  }
2094 
2097  {
2098  // Get the time
2099  Fw::Time _logTime;
2100  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2101  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2102  }
2103 
2104  FwEventIdType _id = static_cast<FwEventIdType>(0);
2105 
2107 
2108  // Emit the event on the log port
2109  if (this->m_eventOut_OutputPort[0].isConnected()) {
2110  Fw::LogBuffer _logBuff;
2112 
2113 #if FW_AMPCS_COMPATIBLE
2114  // Serialize the number of arguments
2115  _status = _logBuff.serialize(static_cast<U8>(1));
2116  FW_ASSERT(
2117  _status == Fw::FW_SERIALIZE_OK,
2118  static_cast<FwAssertArgType>(_status)
2119  );
2120 #endif
2121 
2122  _status = dirName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2123  FW_ASSERT(
2124  _status == Fw::FW_SERIALIZE_OK,
2125  static_cast<FwAssertArgType>(_status)
2126  );
2127 
2128  this->m_eventOut_OutputPort[0].invoke(
2129  _id,
2130  _logTime,
2132  _logBuff
2133  );
2134  }
2135 
2136  // Emit the event on the text log port
2137 #if FW_ENABLE_TEXT_LOGGING
2138  if (this->m_LogText_OutputPort[0].isConnected()) {
2139 #if FW_OBJECT_NAMES == 1
2140  const char* _formatString =
2141  "(%s) %s: Created directory %s successfully";
2142 #else
2143  const char* _formatString =
2144  "%s: Created directory %s successfully";
2145 #endif
2146 
2147  Fw::TextLogString _logString;
2148  _logString.format(
2149  _formatString,
2150 #if FW_OBJECT_NAMES == 1
2151  this->m_objName.toChar(),
2152 #endif
2153  "CreateDirectorySucceeded ",
2154  dirName.toChar()
2155  );
2156 
2157  this->m_LogText_OutputPort[0].invoke(
2158  _id,
2159  _logTime,
2161  _logString
2162  );
2163  }
2164 #endif
2165  }
2166 
2169  {
2170  // Get the time
2171  Fw::Time _logTime;
2172  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2173  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2174  }
2175 
2176  FwEventIdType _id = static_cast<FwEventIdType>(0);
2177 
2179 
2180  // Emit the event on the log port
2181  if (this->m_eventOut_OutputPort[0].isConnected()) {
2182  Fw::LogBuffer _logBuff;
2184 
2185 #if FW_AMPCS_COMPATIBLE
2186  // Serialize the number of arguments
2187  _status = _logBuff.serialize(static_cast<U8>(1));
2188  FW_ASSERT(
2189  _status == Fw::FW_SERIALIZE_OK,
2190  static_cast<FwAssertArgType>(_status)
2191  );
2192 #endif
2193 
2194  _status = dirName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2195  FW_ASSERT(
2196  _status == Fw::FW_SERIALIZE_OK,
2197  static_cast<FwAssertArgType>(_status)
2198  );
2199 
2200  this->m_eventOut_OutputPort[0].invoke(
2201  _id,
2202  _logTime,
2204  _logBuff
2205  );
2206  }
2207 
2208  // Emit the event on the text log port
2209 #if FW_ENABLE_TEXT_LOGGING
2210  if (this->m_LogText_OutputPort[0].isConnected()) {
2211 #if FW_OBJECT_NAMES == 1
2212  const char* _formatString =
2213  "(%s) %s: Removed directory %s successfully";
2214 #else
2215  const char* _formatString =
2216  "%s: Removed directory %s successfully";
2217 #endif
2218 
2219  Fw::TextLogString _logString;
2220  _logString.format(
2221  _formatString,
2222 #if FW_OBJECT_NAMES == 1
2223  this->m_objName.toChar(),
2224 #endif
2225  "RemoveDirectorySucceeded ",
2226  dirName.toChar()
2227  );
2228 
2229  this->m_LogText_OutputPort[0].invoke(
2230  _id,
2231  _logTime,
2233  _logString
2234  );
2235  }
2236 #endif
2237  }
2238 
2241  const Fw::StringBase& sourceFileName,
2242  const Fw::StringBase& destFileName
2243  ) const
2244  {
2245  // Get the time
2246  Fw::Time _logTime;
2247  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2248  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2249  }
2250 
2251  FwEventIdType _id = static_cast<FwEventIdType>(0);
2252 
2253  _id = this->getIdBase() + EVENTID_MOVEFILESUCCEEDED;
2254 
2255  // Emit the event on the log port
2256  if (this->m_eventOut_OutputPort[0].isConnected()) {
2257  Fw::LogBuffer _logBuff;
2259 
2260 #if FW_AMPCS_COMPATIBLE
2261  // Serialize the number of arguments
2262  _status = _logBuff.serialize(static_cast<U8>(2));
2263  FW_ASSERT(
2264  _status == Fw::FW_SERIALIZE_OK,
2265  static_cast<FwAssertArgType>(_status)
2266  );
2267 #endif
2268 
2269  _status = sourceFileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2270  FW_ASSERT(
2271  _status == Fw::FW_SERIALIZE_OK,
2272  static_cast<FwAssertArgType>(_status)
2273  );
2274 
2275  _status = destFileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2276  FW_ASSERT(
2277  _status == Fw::FW_SERIALIZE_OK,
2278  static_cast<FwAssertArgType>(_status)
2279  );
2280 
2281  this->m_eventOut_OutputPort[0].invoke(
2282  _id,
2283  _logTime,
2285  _logBuff
2286  );
2287  }
2288 
2289  // Emit the event on the text log port
2290 #if FW_ENABLE_TEXT_LOGGING
2291  if (this->m_LogText_OutputPort[0].isConnected()) {
2292 #if FW_OBJECT_NAMES == 1
2293  const char* _formatString =
2294  "(%s) %s: Moved file %s to file %s successfully";
2295 #else
2296  const char* _formatString =
2297  "%s: Moved file %s to file %s successfully";
2298 #endif
2299 
2300  Fw::TextLogString _logString;
2301  _logString.format(
2302  _formatString,
2303 #if FW_OBJECT_NAMES == 1
2304  this->m_objName.toChar(),
2305 #endif
2306  "MoveFileSucceeded ",
2307  sourceFileName.toChar(),
2308  destFileName.toChar()
2309  );
2310 
2311  this->m_LogText_OutputPort[0].invoke(
2312  _id,
2313  _logTime,
2315  _logString
2316  );
2317  }
2318 #endif
2319  }
2320 
2323  {
2324  // Get the time
2325  Fw::Time _logTime;
2326  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2327  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2328  }
2329 
2330  FwEventIdType _id = static_cast<FwEventIdType>(0);
2331 
2332  _id = this->getIdBase() + EVENTID_REMOVEFILESUCCEEDED;
2333 
2334  // Emit the event on the log port
2335  if (this->m_eventOut_OutputPort[0].isConnected()) {
2336  Fw::LogBuffer _logBuff;
2338 
2339 #if FW_AMPCS_COMPATIBLE
2340  // Serialize the number of arguments
2341  _status = _logBuff.serialize(static_cast<U8>(1));
2342  FW_ASSERT(
2343  _status == Fw::FW_SERIALIZE_OK,
2344  static_cast<FwAssertArgType>(_status)
2345  );
2346 #endif
2347 
2348  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2349  FW_ASSERT(
2350  _status == Fw::FW_SERIALIZE_OK,
2351  static_cast<FwAssertArgType>(_status)
2352  );
2353 
2354  this->m_eventOut_OutputPort[0].invoke(
2355  _id,
2356  _logTime,
2358  _logBuff
2359  );
2360  }
2361 
2362  // Emit the event on the text log port
2363 #if FW_ENABLE_TEXT_LOGGING
2364  if (this->m_LogText_OutputPort[0].isConnected()) {
2365 #if FW_OBJECT_NAMES == 1
2366  const char* _formatString =
2367  "(%s) %s: Removed file %s successfully";
2368 #else
2369  const char* _formatString =
2370  "%s: Removed file %s successfully";
2371 #endif
2372 
2373  Fw::TextLogString _logString;
2374  _logString.format(
2375  _formatString,
2376 #if FW_OBJECT_NAMES == 1
2377  this->m_objName.toChar(),
2378 #endif
2379  "RemoveFileSucceeded ",
2380  fileName.toChar()
2381  );
2382 
2383  this->m_LogText_OutputPort[0].invoke(
2384  _id,
2385  _logTime,
2387  _logString
2388  );
2389  }
2390 #endif
2391  }
2392 
2395  const Fw::StringBase& source,
2396  const Fw::StringBase& target
2397  ) const
2398  {
2399  // Get the time
2400  Fw::Time _logTime;
2401  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2402  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2403  }
2404 
2405  FwEventIdType _id = static_cast<FwEventIdType>(0);
2406 
2407  _id = this->getIdBase() + EVENTID_APPENDFILESTARTED;
2408 
2409  // Emit the event on the log port
2410  if (this->m_eventOut_OutputPort[0].isConnected()) {
2411  Fw::LogBuffer _logBuff;
2413 
2414 #if FW_AMPCS_COMPATIBLE
2415  // Serialize the number of arguments
2416  _status = _logBuff.serialize(static_cast<U8>(2));
2417  FW_ASSERT(
2418  _status == Fw::FW_SERIALIZE_OK,
2419  static_cast<FwAssertArgType>(_status)
2420  );
2421 #endif
2422 
2423  _status = source.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2424  FW_ASSERT(
2425  _status == Fw::FW_SERIALIZE_OK,
2426  static_cast<FwAssertArgType>(_status)
2427  );
2428 
2429  _status = target.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2430  FW_ASSERT(
2431  _status == Fw::FW_SERIALIZE_OK,
2432  static_cast<FwAssertArgType>(_status)
2433  );
2434 
2435  this->m_eventOut_OutputPort[0].invoke(
2436  _id,
2437  _logTime,
2439  _logBuff
2440  );
2441  }
2442 
2443  // Emit the event on the text log port
2444 #if FW_ENABLE_TEXT_LOGGING
2445  if (this->m_LogText_OutputPort[0].isConnected()) {
2446 #if FW_OBJECT_NAMES == 1
2447  const char* _formatString =
2448  "(%s) %s: Appending file %s to the end of %s...";
2449 #else
2450  const char* _formatString =
2451  "%s: Appending file %s to the end of %s...";
2452 #endif
2453 
2454  Fw::TextLogString _logString;
2455  _logString.format(
2456  _formatString,
2457 #if FW_OBJECT_NAMES == 1
2458  this->m_objName.toChar(),
2459 #endif
2460  "AppendFileStarted ",
2461  source.toChar(),
2462  target.toChar()
2463  );
2464 
2465  this->m_LogText_OutputPort[0].invoke(
2466  _id,
2467  _logTime,
2469  _logString
2470  );
2471  }
2472 #endif
2473  }
2474 
2477  {
2478  // Get the time
2479  Fw::Time _logTime;
2480  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2481  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2482  }
2483 
2484  FwEventIdType _id = static_cast<FwEventIdType>(0);
2485 
2486  _id = this->getIdBase() + EVENTID_SHELLCOMMANDSTARTED;
2487 
2488  // Emit the event on the log port
2489  if (this->m_eventOut_OutputPort[0].isConnected()) {
2490  Fw::LogBuffer _logBuff;
2492 
2493 #if FW_AMPCS_COMPATIBLE
2494  // Serialize the number of arguments
2495  _status = _logBuff.serialize(static_cast<U8>(1));
2496  FW_ASSERT(
2497  _status == Fw::FW_SERIALIZE_OK,
2498  static_cast<FwAssertArgType>(_status)
2499  );
2500 #endif
2501 
2502  _status = command.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2503  FW_ASSERT(
2504  _status == Fw::FW_SERIALIZE_OK,
2505  static_cast<FwAssertArgType>(_status)
2506  );
2507 
2508  this->m_eventOut_OutputPort[0].invoke(
2509  _id,
2510  _logTime,
2512  _logBuff
2513  );
2514  }
2515 
2516  // Emit the event on the text log port
2517 #if FW_ENABLE_TEXT_LOGGING
2518  if (this->m_LogText_OutputPort[0].isConnected()) {
2519 #if FW_OBJECT_NAMES == 1
2520  const char* _formatString =
2521  "(%s) %s: Running shell command %s...";
2522 #else
2523  const char* _formatString =
2524  "%s: Running shell command %s...";
2525 #endif
2526 
2527  Fw::TextLogString _logString;
2528  _logString.format(
2529  _formatString,
2530 #if FW_OBJECT_NAMES == 1
2531  this->m_objName.toChar(),
2532 #endif
2533  "ShellCommandStarted ",
2534  command.toChar()
2535  );
2536 
2537  this->m_LogText_OutputPort[0].invoke(
2538  _id,
2539  _logTime,
2541  _logString
2542  );
2543  }
2544 #endif
2545  }
2546 
2549  {
2550  // Get the time
2551  Fw::Time _logTime;
2552  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2553  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2554  }
2555 
2556  FwEventIdType _id = static_cast<FwEventIdType>(0);
2557 
2558  _id = this->getIdBase() + EVENTID_CREATEDIRECTORYSTARTED;
2559 
2560  // Emit the event on the log port
2561  if (this->m_eventOut_OutputPort[0].isConnected()) {
2562  Fw::LogBuffer _logBuff;
2564 
2565 #if FW_AMPCS_COMPATIBLE
2566  // Serialize the number of arguments
2567  _status = _logBuff.serialize(static_cast<U8>(1));
2568  FW_ASSERT(
2569  _status == Fw::FW_SERIALIZE_OK,
2570  static_cast<FwAssertArgType>(_status)
2571  );
2572 #endif
2573 
2574  _status = dirName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2575  FW_ASSERT(
2576  _status == Fw::FW_SERIALIZE_OK,
2577  static_cast<FwAssertArgType>(_status)
2578  );
2579 
2580  this->m_eventOut_OutputPort[0].invoke(
2581  _id,
2582  _logTime,
2584  _logBuff
2585  );
2586  }
2587 
2588  // Emit the event on the text log port
2589 #if FW_ENABLE_TEXT_LOGGING
2590  if (this->m_LogText_OutputPort[0].isConnected()) {
2591 #if FW_OBJECT_NAMES == 1
2592  const char* _formatString =
2593  "(%s) %s: Creating directory %s...";
2594 #else
2595  const char* _formatString =
2596  "%s: Creating directory %s...";
2597 #endif
2598 
2599  Fw::TextLogString _logString;
2600  _logString.format(
2601  _formatString,
2602 #if FW_OBJECT_NAMES == 1
2603  this->m_objName.toChar(),
2604 #endif
2605  "CreateDirectoryStarted ",
2606  dirName.toChar()
2607  );
2608 
2609  this->m_LogText_OutputPort[0].invoke(
2610  _id,
2611  _logTime,
2613  _logString
2614  );
2615  }
2616 #endif
2617  }
2618 
2621  {
2622  // Get the time
2623  Fw::Time _logTime;
2624  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2625  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2626  }
2627 
2628  FwEventIdType _id = static_cast<FwEventIdType>(0);
2629 
2630  _id = this->getIdBase() + EVENTID_REMOVEDIRECTORYSTARTED;
2631 
2632  // Emit the event on the log port
2633  if (this->m_eventOut_OutputPort[0].isConnected()) {
2634  Fw::LogBuffer _logBuff;
2636 
2637 #if FW_AMPCS_COMPATIBLE
2638  // Serialize the number of arguments
2639  _status = _logBuff.serialize(static_cast<U8>(1));
2640  FW_ASSERT(
2641  _status == Fw::FW_SERIALIZE_OK,
2642  static_cast<FwAssertArgType>(_status)
2643  );
2644 #endif
2645 
2646  _status = dirName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2647  FW_ASSERT(
2648  _status == Fw::FW_SERIALIZE_OK,
2649  static_cast<FwAssertArgType>(_status)
2650  );
2651 
2652  this->m_eventOut_OutputPort[0].invoke(
2653  _id,
2654  _logTime,
2656  _logBuff
2657  );
2658  }
2659 
2660  // Emit the event on the text log port
2661 #if FW_ENABLE_TEXT_LOGGING
2662  if (this->m_LogText_OutputPort[0].isConnected()) {
2663 #if FW_OBJECT_NAMES == 1
2664  const char* _formatString =
2665  "(%s) %s: Removing directory %s...";
2666 #else
2667  const char* _formatString =
2668  "%s: Removing directory %s...";
2669 #endif
2670 
2671  Fw::TextLogString _logString;
2672  _logString.format(
2673  _formatString,
2674 #if FW_OBJECT_NAMES == 1
2675  this->m_objName.toChar(),
2676 #endif
2677  "RemoveDirectoryStarted ",
2678  dirName.toChar()
2679  );
2680 
2681  this->m_LogText_OutputPort[0].invoke(
2682  _id,
2683  _logTime,
2685  _logString
2686  );
2687  }
2688 #endif
2689  }
2690 
2693  const Fw::StringBase& sourceFileName,
2694  const Fw::StringBase& destFileName
2695  ) const
2696  {
2697  // Get the time
2698  Fw::Time _logTime;
2699  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2700  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2701  }
2702 
2703  FwEventIdType _id = static_cast<FwEventIdType>(0);
2704 
2705  _id = this->getIdBase() + EVENTID_MOVEFILESTARTED;
2706 
2707  // Emit the event on the log port
2708  if (this->m_eventOut_OutputPort[0].isConnected()) {
2709  Fw::LogBuffer _logBuff;
2711 
2712 #if FW_AMPCS_COMPATIBLE
2713  // Serialize the number of arguments
2714  _status = _logBuff.serialize(static_cast<U8>(2));
2715  FW_ASSERT(
2716  _status == Fw::FW_SERIALIZE_OK,
2717  static_cast<FwAssertArgType>(_status)
2718  );
2719 #endif
2720 
2721  _status = sourceFileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2722  FW_ASSERT(
2723  _status == Fw::FW_SERIALIZE_OK,
2724  static_cast<FwAssertArgType>(_status)
2725  );
2726 
2727  _status = destFileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2728  FW_ASSERT(
2729  _status == Fw::FW_SERIALIZE_OK,
2730  static_cast<FwAssertArgType>(_status)
2731  );
2732 
2733  this->m_eventOut_OutputPort[0].invoke(
2734  _id,
2735  _logTime,
2737  _logBuff
2738  );
2739  }
2740 
2741  // Emit the event on the text log port
2742 #if FW_ENABLE_TEXT_LOGGING
2743  if (this->m_LogText_OutputPort[0].isConnected()) {
2744 #if FW_OBJECT_NAMES == 1
2745  const char* _formatString =
2746  "(%s) %s: Moving file %s to file %s...";
2747 #else
2748  const char* _formatString =
2749  "%s: Moving file %s to file %s...";
2750 #endif
2751 
2752  Fw::TextLogString _logString;
2753  _logString.format(
2754  _formatString,
2755 #if FW_OBJECT_NAMES == 1
2756  this->m_objName.toChar(),
2757 #endif
2758  "MoveFileStarted ",
2759  sourceFileName.toChar(),
2760  destFileName.toChar()
2761  );
2762 
2763  this->m_LogText_OutputPort[0].invoke(
2764  _id,
2765  _logTime,
2767  _logString
2768  );
2769  }
2770 #endif
2771  }
2772 
2775  {
2776  // Get the time
2777  Fw::Time _logTime;
2778  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2779  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2780  }
2781 
2782  FwEventIdType _id = static_cast<FwEventIdType>(0);
2783 
2784  _id = this->getIdBase() + EVENTID_REMOVEFILESTARTED;
2785 
2786  // Emit the event on the log port
2787  if (this->m_eventOut_OutputPort[0].isConnected()) {
2788  Fw::LogBuffer _logBuff;
2790 
2791 #if FW_AMPCS_COMPATIBLE
2792  // Serialize the number of arguments
2793  _status = _logBuff.serialize(static_cast<U8>(1));
2794  FW_ASSERT(
2795  _status == Fw::FW_SERIALIZE_OK,
2796  static_cast<FwAssertArgType>(_status)
2797  );
2798 #endif
2799 
2800  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2801  FW_ASSERT(
2802  _status == Fw::FW_SERIALIZE_OK,
2803  static_cast<FwAssertArgType>(_status)
2804  );
2805 
2806  this->m_eventOut_OutputPort[0].invoke(
2807  _id,
2808  _logTime,
2810  _logBuff
2811  );
2812  }
2813 
2814  // Emit the event on the text log port
2815 #if FW_ENABLE_TEXT_LOGGING
2816  if (this->m_LogText_OutputPort[0].isConnected()) {
2817 #if FW_OBJECT_NAMES == 1
2818  const char* _formatString =
2819  "(%s) %s: Removing file %s...";
2820 #else
2821  const char* _formatString =
2822  "%s: Removing file %s...";
2823 #endif
2824 
2825  Fw::TextLogString _logString;
2826  _logString.format(
2827  _formatString,
2828 #if FW_OBJECT_NAMES == 1
2829  this->m_objName.toChar(),
2830 #endif
2831  "RemoveFileStarted ",
2832  fileName.toChar()
2833  );
2834 
2835  this->m_LogText_OutputPort[0].invoke(
2836  _id,
2837  _logTime,
2839  _logString
2840  );
2841  }
2842 #endif
2843  }
2844 
2847  const Fw::StringBase& fileName,
2848  U64 size
2849  ) const
2850  {
2851  // Get the time
2852  Fw::Time _logTime;
2853  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2854  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2855  }
2856 
2857  FwEventIdType _id = static_cast<FwEventIdType>(0);
2858 
2859  _id = this->getIdBase() + EVENTID_FILESIZESUCCEEDED;
2860 
2861  // Emit the event on the log port
2862  if (this->m_eventOut_OutputPort[0].isConnected()) {
2863  Fw::LogBuffer _logBuff;
2865 
2866 #if FW_AMPCS_COMPATIBLE
2867  // Serialize the number of arguments
2868  _status = _logBuff.serialize(static_cast<U8>(2));
2869  FW_ASSERT(
2870  _status == Fw::FW_SERIALIZE_OK,
2871  static_cast<FwAssertArgType>(_status)
2872  );
2873 #endif
2874 
2875  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2876  FW_ASSERT(
2877  _status == Fw::FW_SERIALIZE_OK,
2878  static_cast<FwAssertArgType>(_status)
2879  );
2880 
2881 #if FW_AMPCS_COMPATIBLE
2882  // Serialize the argument size
2883  _status = _logBuff.serialize(
2884  static_cast<U8>(sizeof(U64))
2885  );
2886  FW_ASSERT(
2887  _status == Fw::FW_SERIALIZE_OK,
2888  static_cast<FwAssertArgType>(_status)
2889  );
2890 #endif
2891  _status = _logBuff.serialize(size);
2892  FW_ASSERT(
2893  _status == Fw::FW_SERIALIZE_OK,
2894  static_cast<FwAssertArgType>(_status)
2895  );
2896 
2897  this->m_eventOut_OutputPort[0].invoke(
2898  _id,
2899  _logTime,
2901  _logBuff
2902  );
2903  }
2904 
2905  // Emit the event on the text log port
2906 #if FW_ENABLE_TEXT_LOGGING
2907  if (this->m_LogText_OutputPort[0].isConnected()) {
2908 #if FW_OBJECT_NAMES == 1
2909  const char* _formatString =
2910  "(%s) %s: The size of file %s is %" PRIu64 " B";
2911 #else
2912  const char* _formatString =
2913  "%s: The size of file %s is %" PRIu64 " B";
2914 #endif
2915 
2916  Fw::TextLogString _logString;
2917  _logString.format(
2918  _formatString,
2919 #if FW_OBJECT_NAMES == 1
2920  this->m_objName.toChar(),
2921 #endif
2922  "FileSizeSucceeded ",
2923  fileName.toChar(),
2924  size
2925  );
2926 
2927  this->m_LogText_OutputPort[0].invoke(
2928  _id,
2929  _logTime,
2931  _logString
2932  );
2933  }
2934 #endif
2935  }
2936 
2939  const Fw::StringBase& fileName,
2940  U32 status
2941  ) const
2942  {
2943  // Get the time
2944  Fw::Time _logTime;
2945  if (this->m_timeCaller_OutputPort[0].isConnected()) {
2946  this->m_timeCaller_OutputPort[0].invoke(_logTime);
2947  }
2948 
2949  FwEventIdType _id = static_cast<FwEventIdType>(0);
2950 
2951  _id = this->getIdBase() + EVENTID_FILESIZEERROR;
2952 
2953  // Emit the event on the log port
2954  if (this->m_eventOut_OutputPort[0].isConnected()) {
2955  Fw::LogBuffer _logBuff;
2957 
2958 #if FW_AMPCS_COMPATIBLE
2959  // Serialize the number of arguments
2960  _status = _logBuff.serialize(static_cast<U8>(2));
2961  FW_ASSERT(
2962  _status == Fw::FW_SERIALIZE_OK,
2963  static_cast<FwAssertArgType>(_status)
2964  );
2965 #endif
2966 
2967  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
2968  FW_ASSERT(
2969  _status == Fw::FW_SERIALIZE_OK,
2970  static_cast<FwAssertArgType>(_status)
2971  );
2972 
2973 #if FW_AMPCS_COMPATIBLE
2974  // Serialize the argument size
2975  _status = _logBuff.serialize(
2976  static_cast<U8>(sizeof(U32))
2977  );
2978  FW_ASSERT(
2979  _status == Fw::FW_SERIALIZE_OK,
2980  static_cast<FwAssertArgType>(_status)
2981  );
2982 #endif
2983  _status = _logBuff.serialize(status);
2984  FW_ASSERT(
2985  _status == Fw::FW_SERIALIZE_OK,
2986  static_cast<FwAssertArgType>(_status)
2987  );
2988 
2989  this->m_eventOut_OutputPort[0].invoke(
2990  _id,
2991  _logTime,
2993  _logBuff
2994  );
2995  }
2996 
2997  // Emit the event on the text log port
2998 #if FW_ENABLE_TEXT_LOGGING
2999  if (this->m_LogText_OutputPort[0].isConnected()) {
3000 #if FW_OBJECT_NAMES == 1
3001  const char* _formatString =
3002  "(%s) %s: Failed to get the size of file %s, returned status %" PRIu32 "";
3003 #else
3004  const char* _formatString =
3005  "%s: Failed to get the size of file %s, returned status %" PRIu32 "";
3006 #endif
3007 
3008  Fw::TextLogString _logString;
3009  _logString.format(
3010  _formatString,
3011 #if FW_OBJECT_NAMES == 1
3012  this->m_objName.toChar(),
3013 #endif
3014  "FileSizeError ",
3015  fileName.toChar(),
3016  status
3017  );
3018 
3019  this->m_LogText_OutputPort[0].invoke(
3020  _id,
3021  _logTime,
3023  _logString
3024  );
3025  }
3026 #endif
3027  }
3028 
3031  {
3032  // Get the time
3033  Fw::Time _logTime;
3034  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3035  this->m_timeCaller_OutputPort[0].invoke(_logTime);
3036  }
3037 
3038  FwEventIdType _id = static_cast<FwEventIdType>(0);
3039 
3040  _id = this->getIdBase() + EVENTID_FILESIZESTARTED;
3041 
3042  // Emit the event on the log port
3043  if (this->m_eventOut_OutputPort[0].isConnected()) {
3044  Fw::LogBuffer _logBuff;
3046 
3047 #if FW_AMPCS_COMPATIBLE
3048  // Serialize the number of arguments
3049  _status = _logBuff.serialize(static_cast<U8>(1));
3050  FW_ASSERT(
3051  _status == Fw::FW_SERIALIZE_OK,
3052  static_cast<FwAssertArgType>(_status)
3053  );
3054 #endif
3055 
3056  _status = fileName.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 256));
3057  FW_ASSERT(
3058  _status == Fw::FW_SERIALIZE_OK,
3059  static_cast<FwAssertArgType>(_status)
3060  );
3061 
3062  this->m_eventOut_OutputPort[0].invoke(
3063  _id,
3064  _logTime,
3066  _logBuff
3067  );
3068  }
3069 
3070  // Emit the event on the text log port
3071 #if FW_ENABLE_TEXT_LOGGING
3072  if (this->m_LogText_OutputPort[0].isConnected()) {
3073 #if FW_OBJECT_NAMES == 1
3074  const char* _formatString =
3075  "(%s) %s: Checking size of file %s...";
3076 #else
3077  const char* _formatString =
3078  "%s: Checking size of file %s...";
3079 #endif
3080 
3081  Fw::TextLogString _logString;
3082  _logString.format(
3083  _formatString,
3084 #if FW_OBJECT_NAMES == 1
3085  this->m_objName.toChar(),
3086 #endif
3087  "FileSizeStarted ",
3088  fileName.toChar()
3089  );
3090 
3091  this->m_LogText_OutputPort[0].invoke(
3092  _id,
3093  _logTime,
3095  _logString
3096  );
3097  }
3098 #endif
3099  }
3100 
3101  // ----------------------------------------------------------------------
3102  // Telemetry write functions
3103  // ----------------------------------------------------------------------
3104 
3107  U32 arg,
3108  Fw::Time _tlmTime
3109  ) const
3110  {
3111  if (this->m_tlmOut_OutputPort[0].isConnected()) {
3112  if (
3113  this->m_timeCaller_OutputPort[0].isConnected() &&
3114  (_tlmTime == Fw::ZERO_TIME)
3115  ) {
3116  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
3117  }
3118 
3119  Fw::TlmBuffer _tlmBuff;
3120  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
3121  FW_ASSERT(
3122  _stat == Fw::FW_SERIALIZE_OK,
3123  static_cast<FwAssertArgType>(_stat)
3124  );
3125 
3126  FwChanIdType _id;
3127 
3128  _id = this->getIdBase() + CHANNELID_COMMANDSEXECUTED;
3129 
3130  this->m_tlmOut_OutputPort[0].invoke(
3131  _id,
3132  _tlmTime,
3133  _tlmBuff
3134  );
3135  }
3136  }
3137 
3140  U32 arg,
3141  Fw::Time _tlmTime
3142  ) const
3143  {
3144  if (this->m_tlmOut_OutputPort[0].isConnected()) {
3145  if (
3146  this->m_timeCaller_OutputPort[0].isConnected() &&
3147  (_tlmTime == Fw::ZERO_TIME)
3148  ) {
3149  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
3150  }
3151 
3152  Fw::TlmBuffer _tlmBuff;
3153  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
3154  FW_ASSERT(
3155  _stat == Fw::FW_SERIALIZE_OK,
3156  static_cast<FwAssertArgType>(_stat)
3157  );
3158 
3159  FwChanIdType _id;
3160 
3161  _id = this->getIdBase() + CHANNELID_ERRORS;
3162 
3163  this->m_tlmOut_OutputPort[0].invoke(
3164  _id,
3165  _tlmTime,
3166  _tlmBuff
3167  );
3168  }
3169  }
3170 
3171  // ----------------------------------------------------------------------
3172  // Time
3173  // ----------------------------------------------------------------------
3174 
3177  {
3178  if (this->m_timeCaller_OutputPort[0].isConnected()) {
3179  Fw::Time _time;
3180  this->m_timeCaller_OutputPort[0].invoke(_time);
3181  return _time;
3182  }
3183  else {
3184  return Fw::Time(TB_NONE, 0, 0);
3185  }
3186  }
3187 
3188  // ----------------------------------------------------------------------
3189  // Message dispatch functions
3190  // ----------------------------------------------------------------------
3191 
3192  Fw::QueuedComponentBase::MsgDispatchStatus FileManagerComponentBase ::
3193  doDispatch()
3194  {
3195  ComponentIpcSerializableBuffer msg;
3196  FwQueuePriorityType priority = 0;
3197 
3198  Os::Queue::Status msgStatus = this->m_queue.receive(
3199  msg,
3201  priority
3202  );
3203  FW_ASSERT(
3204  msgStatus == Os::Queue::OP_OK,
3205  static_cast<FwAssertArgType>(msgStatus)
3206  );
3207 
3208  // Reset to beginning of buffer
3209  msg.resetDeser();
3210 
3211  FwEnumStoreType desMsg = 0;
3212  Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
3213  FW_ASSERT(
3214  deserStatus == Fw::FW_SERIALIZE_OK,
3215  static_cast<FwAssertArgType>(deserStatus)
3216  );
3217 
3218  MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
3219 
3220  if (msgType == FILEMANAGER_COMPONENT_EXIT) {
3221  return MSG_DISPATCH_EXIT;
3222  }
3223 
3224  FwIndexType portNum = 0;
3225  deserStatus = msg.deserialize(portNum);
3226  FW_ASSERT(
3227  deserStatus == Fw::FW_SERIALIZE_OK,
3228  static_cast<FwAssertArgType>(deserStatus)
3229  );
3230 
3231  switch (msgType) {
3232  // Handle async input port pingIn
3233  case PINGIN_PING: {
3234  // Deserialize argument key
3235  U32 key;
3236  deserStatus = msg.deserialize(key);
3237  FW_ASSERT(
3238  deserStatus == Fw::FW_SERIALIZE_OK,
3239  static_cast<FwAssertArgType>(deserStatus)
3240  );
3241  // Call handler function
3242  this->pingIn_handler(
3243  portNum,
3244  key
3245  );
3246 
3247  break;
3248  }
3249 
3250  // Handle command CreateDirectory
3251  case CMD_CREATEDIRECTORY: {
3252  // Deserialize opcode
3253  FwOpcodeType opCode = 0;
3254  deserStatus = msg.deserialize(opCode);
3255  FW_ASSERT (
3256  deserStatus == Fw::FW_SERIALIZE_OK,
3257  static_cast<FwAssertArgType>(deserStatus)
3258  );
3259 
3260  // Deserialize command sequence
3261  U32 cmdSeq = 0;
3262  deserStatus = msg.deserialize(cmdSeq);
3263  FW_ASSERT (
3264  deserStatus == Fw::FW_SERIALIZE_OK,
3265  static_cast<FwAssertArgType>(deserStatus)
3266  );
3267 
3268  // Deserialize command argument buffer
3269  Fw::CmdArgBuffer args;
3270  deserStatus = msg.deserialize(args);
3271  FW_ASSERT (
3272  deserStatus == Fw::FW_SERIALIZE_OK,
3273  static_cast<FwAssertArgType>(deserStatus)
3274  );
3275 
3276  // Reset buffer
3277  args.resetDeser();
3278 
3279  // Deserialize argument dirName
3280  Fw::CmdStringArg dirName;
3281  deserStatus = args.deserialize(dirName);
3282  if (deserStatus != Fw::FW_SERIALIZE_OK) {
3283  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3284  this->cmdResponse_out(
3285  opCode,
3286  cmdSeq,
3288  );
3289  }
3290  // Don't crash the task if bad arguments were passed from the ground
3291  break;
3292  }
3293 
3294  // Make sure there was no data left over.
3295  // That means the argument buffer size was incorrect.
3296 #if FW_CMD_CHECK_RESIDUAL
3297  if (args.getBuffLeft() != 0) {
3298  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3299  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3300  }
3301  // Don't crash the task if bad arguments were passed from the ground
3302  break;
3303  }
3304 #endif
3305 
3306  // Call handler function
3308  opCode, cmdSeq,
3309  dirName
3310  );
3311 
3312  break;
3313  }
3314 
3315  // Handle command MoveFile
3316  case CMD_MOVEFILE: {
3317  // Deserialize opcode
3318  FwOpcodeType opCode = 0;
3319  deserStatus = msg.deserialize(opCode);
3320  FW_ASSERT (
3321  deserStatus == Fw::FW_SERIALIZE_OK,
3322  static_cast<FwAssertArgType>(deserStatus)
3323  );
3324 
3325  // Deserialize command sequence
3326  U32 cmdSeq = 0;
3327  deserStatus = msg.deserialize(cmdSeq);
3328  FW_ASSERT (
3329  deserStatus == Fw::FW_SERIALIZE_OK,
3330  static_cast<FwAssertArgType>(deserStatus)
3331  );
3332 
3333  // Deserialize command argument buffer
3334  Fw::CmdArgBuffer args;
3335  deserStatus = msg.deserialize(args);
3336  FW_ASSERT (
3337  deserStatus == Fw::FW_SERIALIZE_OK,
3338  static_cast<FwAssertArgType>(deserStatus)
3339  );
3340 
3341  // Reset buffer
3342  args.resetDeser();
3343 
3344  // Deserialize argument sourceFileName
3345  Fw::CmdStringArg sourceFileName;
3346  deserStatus = args.deserialize(sourceFileName);
3347  if (deserStatus != Fw::FW_SERIALIZE_OK) {
3348  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3349  this->cmdResponse_out(
3350  opCode,
3351  cmdSeq,
3353  );
3354  }
3355  // Don't crash the task if bad arguments were passed from the ground
3356  break;
3357  }
3358 
3359  // Deserialize argument destFileName
3360  Fw::CmdStringArg destFileName;
3361  deserStatus = args.deserialize(destFileName);
3362  if (deserStatus != Fw::FW_SERIALIZE_OK) {
3363  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3364  this->cmdResponse_out(
3365  opCode,
3366  cmdSeq,
3368  );
3369  }
3370  // Don't crash the task if bad arguments were passed from the ground
3371  break;
3372  }
3373 
3374  // Make sure there was no data left over.
3375  // That means the argument buffer size was incorrect.
3376 #if FW_CMD_CHECK_RESIDUAL
3377  if (args.getBuffLeft() != 0) {
3378  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3379  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3380  }
3381  // Don't crash the task if bad arguments were passed from the ground
3382  break;
3383  }
3384 #endif
3385 
3386  // Call handler function
3387  this->MoveFile_cmdHandler(
3388  opCode, cmdSeq,
3389  sourceFileName,
3390  destFileName
3391  );
3392 
3393  break;
3394  }
3395 
3396  // Handle command RemoveDirectory
3397  case CMD_REMOVEDIRECTORY: {
3398  // Deserialize opcode
3399  FwOpcodeType opCode = 0;
3400  deserStatus = msg.deserialize(opCode);
3401  FW_ASSERT (
3402  deserStatus == Fw::FW_SERIALIZE_OK,
3403  static_cast<FwAssertArgType>(deserStatus)
3404  );
3405 
3406  // Deserialize command sequence
3407  U32 cmdSeq = 0;
3408  deserStatus = msg.deserialize(cmdSeq);
3409  FW_ASSERT (
3410  deserStatus == Fw::FW_SERIALIZE_OK,
3411  static_cast<FwAssertArgType>(deserStatus)
3412  );
3413 
3414  // Deserialize command argument buffer
3415  Fw::CmdArgBuffer args;
3416  deserStatus = msg.deserialize(args);
3417  FW_ASSERT (
3418  deserStatus == Fw::FW_SERIALIZE_OK,
3419  static_cast<FwAssertArgType>(deserStatus)
3420  );
3421 
3422  // Reset buffer
3423  args.resetDeser();
3424 
3425  // Deserialize argument dirName
3426  Fw::CmdStringArg dirName;
3427  deserStatus = args.deserialize(dirName);
3428  if (deserStatus != Fw::FW_SERIALIZE_OK) {
3429  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3430  this->cmdResponse_out(
3431  opCode,
3432  cmdSeq,
3434  );
3435  }
3436  // Don't crash the task if bad arguments were passed from the ground
3437  break;
3438  }
3439 
3440  // Make sure there was no data left over.
3441  // That means the argument buffer size was incorrect.
3442 #if FW_CMD_CHECK_RESIDUAL
3443  if (args.getBuffLeft() != 0) {
3444  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3445  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3446  }
3447  // Don't crash the task if bad arguments were passed from the ground
3448  break;
3449  }
3450 #endif
3451 
3452  // Call handler function
3454  opCode, cmdSeq,
3455  dirName
3456  );
3457 
3458  break;
3459  }
3460 
3461  // Handle command RemoveFile
3462  case CMD_REMOVEFILE: {
3463  // Deserialize opcode
3464  FwOpcodeType opCode = 0;
3465  deserStatus = msg.deserialize(opCode);
3466  FW_ASSERT (
3467  deserStatus == Fw::FW_SERIALIZE_OK,
3468  static_cast<FwAssertArgType>(deserStatus)
3469  );
3470 
3471  // Deserialize command sequence
3472  U32 cmdSeq = 0;
3473  deserStatus = msg.deserialize(cmdSeq);
3474  FW_ASSERT (
3475  deserStatus == Fw::FW_SERIALIZE_OK,
3476  static_cast<FwAssertArgType>(deserStatus)
3477  );
3478 
3479  // Deserialize command argument buffer
3480  Fw::CmdArgBuffer args;
3481  deserStatus = msg.deserialize(args);
3482  FW_ASSERT (
3483  deserStatus == Fw::FW_SERIALIZE_OK,
3484  static_cast<FwAssertArgType>(deserStatus)
3485  );
3486 
3487  // Reset buffer
3488  args.resetDeser();
3489 
3490  // Deserialize argument fileName
3491  Fw::CmdStringArg fileName;
3492  deserStatus = args.deserialize(fileName);
3493  if (deserStatus != Fw::FW_SERIALIZE_OK) {
3494  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3495  this->cmdResponse_out(
3496  opCode,
3497  cmdSeq,
3499  );
3500  }
3501  // Don't crash the task if bad arguments were passed from the ground
3502  break;
3503  }
3504 
3505  // Deserialize argument ignoreErrors
3506  bool ignoreErrors;
3507  deserStatus = args.deserialize(ignoreErrors);
3508  if (deserStatus != Fw::FW_SERIALIZE_OK) {
3509  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3510  this->cmdResponse_out(
3511  opCode,
3512  cmdSeq,
3514  );
3515  }
3516  // Don't crash the task if bad arguments were passed from the ground
3517  break;
3518  }
3519 
3520  // Make sure there was no data left over.
3521  // That means the argument buffer size was incorrect.
3522 #if FW_CMD_CHECK_RESIDUAL
3523  if (args.getBuffLeft() != 0) {
3524  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3525  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3526  }
3527  // Don't crash the task if bad arguments were passed from the ground
3528  break;
3529  }
3530 #endif
3531 
3532  // Call handler function
3533  this->RemoveFile_cmdHandler(
3534  opCode, cmdSeq,
3535  fileName,
3536  ignoreErrors
3537  );
3538 
3539  break;
3540  }
3541 
3542  // Handle command ShellCommand
3543  case CMD_SHELLCOMMAND: {
3544  // Deserialize opcode
3545  FwOpcodeType opCode = 0;
3546  deserStatus = msg.deserialize(opCode);
3547  FW_ASSERT (
3548  deserStatus == Fw::FW_SERIALIZE_OK,
3549  static_cast<FwAssertArgType>(deserStatus)
3550  );
3551 
3552  // Deserialize command sequence
3553  U32 cmdSeq = 0;
3554  deserStatus = msg.deserialize(cmdSeq);
3555  FW_ASSERT (
3556  deserStatus == Fw::FW_SERIALIZE_OK,
3557  static_cast<FwAssertArgType>(deserStatus)
3558  );
3559 
3560  // Deserialize command argument buffer
3561  Fw::CmdArgBuffer args;
3562  deserStatus = msg.deserialize(args);
3563  FW_ASSERT (
3564  deserStatus == Fw::FW_SERIALIZE_OK,
3565  static_cast<FwAssertArgType>(deserStatus)
3566  );
3567 
3568  // Reset buffer
3569  args.resetDeser();
3570 
3571  // Deserialize argument command
3572  Fw::CmdStringArg command;
3573  deserStatus = args.deserialize(command);
3574  if (deserStatus != Fw::FW_SERIALIZE_OK) {
3575  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3576  this->cmdResponse_out(
3577  opCode,
3578  cmdSeq,
3580  );
3581  }
3582  // Don't crash the task if bad arguments were passed from the ground
3583  break;
3584  }
3585 
3586  // Deserialize argument logFileName
3587  Fw::CmdStringArg logFileName;
3588  deserStatus = args.deserialize(logFileName);
3589  if (deserStatus != Fw::FW_SERIALIZE_OK) {
3590  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3591  this->cmdResponse_out(
3592  opCode,
3593  cmdSeq,
3595  );
3596  }
3597  // Don't crash the task if bad arguments were passed from the ground
3598  break;
3599  }
3600 
3601  // Make sure there was no data left over.
3602  // That means the argument buffer size was incorrect.
3603 #if FW_CMD_CHECK_RESIDUAL
3604  if (args.getBuffLeft() != 0) {
3605  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3606  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3607  }
3608  // Don't crash the task if bad arguments were passed from the ground
3609  break;
3610  }
3611 #endif
3612 
3613  // Call handler function
3615  opCode, cmdSeq,
3616  command,
3617  logFileName
3618  );
3619 
3620  break;
3621  }
3622 
3623  // Handle command AppendFile
3624  case CMD_APPENDFILE: {
3625  // Deserialize opcode
3626  FwOpcodeType opCode = 0;
3627  deserStatus = msg.deserialize(opCode);
3628  FW_ASSERT (
3629  deserStatus == Fw::FW_SERIALIZE_OK,
3630  static_cast<FwAssertArgType>(deserStatus)
3631  );
3632 
3633  // Deserialize command sequence
3634  U32 cmdSeq = 0;
3635  deserStatus = msg.deserialize(cmdSeq);
3636  FW_ASSERT (
3637  deserStatus == Fw::FW_SERIALIZE_OK,
3638  static_cast<FwAssertArgType>(deserStatus)
3639  );
3640 
3641  // Deserialize command argument buffer
3642  Fw::CmdArgBuffer args;
3643  deserStatus = msg.deserialize(args);
3644  FW_ASSERT (
3645  deserStatus == Fw::FW_SERIALIZE_OK,
3646  static_cast<FwAssertArgType>(deserStatus)
3647  );
3648 
3649  // Reset buffer
3650  args.resetDeser();
3651 
3652  // Deserialize argument source
3653  Fw::CmdStringArg source;
3654  deserStatus = args.deserialize(source);
3655  if (deserStatus != Fw::FW_SERIALIZE_OK) {
3656  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3657  this->cmdResponse_out(
3658  opCode,
3659  cmdSeq,
3661  );
3662  }
3663  // Don't crash the task if bad arguments were passed from the ground
3664  break;
3665  }
3666 
3667  // Deserialize argument target
3668  Fw::CmdStringArg target;
3669  deserStatus = args.deserialize(target);
3670  if (deserStatus != Fw::FW_SERIALIZE_OK) {
3671  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3672  this->cmdResponse_out(
3673  opCode,
3674  cmdSeq,
3676  );
3677  }
3678  // Don't crash the task if bad arguments were passed from the ground
3679  break;
3680  }
3681 
3682  // Make sure there was no data left over.
3683  // That means the argument buffer size was incorrect.
3684 #if FW_CMD_CHECK_RESIDUAL
3685  if (args.getBuffLeft() != 0) {
3686  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3687  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3688  }
3689  // Don't crash the task if bad arguments were passed from the ground
3690  break;
3691  }
3692 #endif
3693 
3694  // Call handler function
3695  this->AppendFile_cmdHandler(
3696  opCode, cmdSeq,
3697  source,
3698  target
3699  );
3700 
3701  break;
3702  }
3703 
3704  // Handle command FileSize
3705  case CMD_FILESIZE: {
3706  // Deserialize opcode
3707  FwOpcodeType opCode = 0;
3708  deserStatus = msg.deserialize(opCode);
3709  FW_ASSERT (
3710  deserStatus == Fw::FW_SERIALIZE_OK,
3711  static_cast<FwAssertArgType>(deserStatus)
3712  );
3713 
3714  // Deserialize command sequence
3715  U32 cmdSeq = 0;
3716  deserStatus = msg.deserialize(cmdSeq);
3717  FW_ASSERT (
3718  deserStatus == Fw::FW_SERIALIZE_OK,
3719  static_cast<FwAssertArgType>(deserStatus)
3720  );
3721 
3722  // Deserialize command argument buffer
3723  Fw::CmdArgBuffer args;
3724  deserStatus = msg.deserialize(args);
3725  FW_ASSERT (
3726  deserStatus == Fw::FW_SERIALIZE_OK,
3727  static_cast<FwAssertArgType>(deserStatus)
3728  );
3729 
3730  // Reset buffer
3731  args.resetDeser();
3732 
3733  // Deserialize argument fileName
3734  Fw::CmdStringArg fileName;
3735  deserStatus = args.deserialize(fileName);
3736  if (deserStatus != Fw::FW_SERIALIZE_OK) {
3737  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3738  this->cmdResponse_out(
3739  opCode,
3740  cmdSeq,
3742  );
3743  }
3744  // Don't crash the task if bad arguments were passed from the ground
3745  break;
3746  }
3747 
3748  // Make sure there was no data left over.
3749  // That means the argument buffer size was incorrect.
3750 #if FW_CMD_CHECK_RESIDUAL
3751  if (args.getBuffLeft() != 0) {
3752  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3753  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3754  }
3755  // Don't crash the task if bad arguments were passed from the ground
3756  break;
3757  }
3758 #endif
3759 
3760  // Call handler function
3761  this->FileSize_cmdHandler(
3762  opCode, cmdSeq,
3763  fileName
3764  );
3765 
3766  break;
3767  }
3768 
3769  default:
3770  return MSG_DISPATCH_ERROR;
3771  }
3772 
3773  return MSG_DISPATCH_OK;
3774  }
3775 
3776  // ----------------------------------------------------------------------
3777  // Calls for messages received on special input ports
3778  // ----------------------------------------------------------------------
3779 
3780  void FileManagerComponentBase ::
3781  m_p_cmdIn_in(
3782  Fw::PassiveComponentBase* callComp,
3783  FwIndexType portNum,
3784  FwOpcodeType opCode,
3785  U32 cmdSeq,
3786  Fw::CmdArgBuffer& args
3787  )
3788  {
3789  FW_ASSERT(callComp);
3790  FileManagerComponentBase* compPtr = static_cast<FileManagerComponentBase*>(callComp);
3791 
3792  const U32 idBase = callComp->getIdBase();
3793  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
3794 
3795  // Select base class function based on opcode
3796  switch (opCode - idBase) {
3797  case OPCODE_CREATEDIRECTORY: {
3798  compPtr->CreateDirectory_cmdHandlerBase(
3799  opCode,
3800  cmdSeq,
3801  args
3802  );
3803  break;
3804  }
3805 
3806  case OPCODE_MOVEFILE: {
3807  compPtr->MoveFile_cmdHandlerBase(
3808  opCode,
3809  cmdSeq,
3810  args
3811  );
3812  break;
3813  }
3814 
3815  case OPCODE_REMOVEDIRECTORY: {
3816  compPtr->RemoveDirectory_cmdHandlerBase(
3817  opCode,
3818  cmdSeq,
3819  args
3820  );
3821  break;
3822  }
3823 
3824  case OPCODE_REMOVEFILE: {
3825  compPtr->RemoveFile_cmdHandlerBase(
3826  opCode,
3827  cmdSeq,
3828  args
3829  );
3830  break;
3831  }
3832 
3833  case OPCODE_SHELLCOMMAND: {
3834  compPtr->ShellCommand_cmdHandlerBase(
3835  opCode,
3836  cmdSeq,
3837  args
3838  );
3839  break;
3840  }
3841 
3842  case OPCODE_APPENDFILE: {
3843  compPtr->AppendFile_cmdHandlerBase(
3844  opCode,
3845  cmdSeq,
3846  args
3847  );
3848  break;
3849  }
3850 
3851  case OPCODE_FILESIZE: {
3852  compPtr->FileSize_cmdHandlerBase(
3853  opCode,
3854  cmdSeq,
3855  args
3856  );
3857  break;
3858  }
3859  }
3860  }
3861 
3862  // ----------------------------------------------------------------------
3863  // Calls for messages received on typed input ports
3864  // ----------------------------------------------------------------------
3865 
3866  void FileManagerComponentBase ::
3867  m_p_pingIn_in(
3868  Fw::PassiveComponentBase* callComp,
3869  FwIndexType portNum,
3870  U32 key
3871  )
3872  {
3873  FW_ASSERT(callComp);
3874  FileManagerComponentBase* compPtr = static_cast<FileManagerComponentBase*>(callComp);
3875  compPtr->pingIn_handlerBase(
3876  portNum,
3877  key
3878  );
3879  }
3880 
3881 }
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
The File System component began moving a file to a new location.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
Definition: Time.hpp:9
The File System component began creating a new directory.
Perform a Linux shell command and write the output to a log file.
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 deleted and existing 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
The File System component created a new directory without error.
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.
NATIVE_UINT_TYPE SizeType
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
virtual void RemoveFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, bool ignoreErrors)=0
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
const Time ZERO_TIME
Definition: Time.cpp:5
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
I32 FwEnumStoreType
Definition: FpConfig.h:64
The File System component executed a shell command that returned status zero.
An error occurred while attempting to move 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
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
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:37
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:62
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
Message will block until space is available.
Definition: Queue.hpp:45
void log_ACTIVITY_HI_CreateDirectorySucceeded(const Fw::StringBase &dirName) const
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
The File System component began executing a shell command.
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
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
void setPortNum(NATIVE_INT_TYPE portNum)
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:72
FwIndexType getNum_timeCaller_OutputPorts() const
void init()
Initialization function.
Definition: PingPortAc.cpp:128
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
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
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
An error occurred while attempting to remove a directory.
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
The File System component began deleting a directory.
A serious but recoverable event.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
The File System component moved a file to a new location without error.
Append 1 file&#39;s contents to the end of another.
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)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:30
BlockingType
message type
Definition: Queue.hpp:44
#define PRI_PlatformIntType
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
An error occurred while attempting to create a directory.
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
The File System component returned status non-zero when trying to append 2 files together.
void tlmWrite_Errors(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
message to exit active component task
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
The File System component appended 2 files without error.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:70
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void init()
Initialization function.
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
The File System component deleted an existing file without error.
An error occurred while attempting to remove a file.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
message sent/received okay
Definition: Queue.hpp:31
U8 BYTE
byte type
Definition: BasicTypes.h:31
virtual void AppendFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command AppendFile.
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:46
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
The File System component executed a shell command that returned status non-zero. ...
void init()
Initialization function.
The File System component appended 2 files without error.
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
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
The File System component began deleting an existing file.
#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