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