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