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