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