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
ComLoggerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ComLoggerComponentAc.cpp
3 // \author Auto-generated
4 // \brief cpp file for ComLogger 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  COMLOGGER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
32  COMIN_COM,
33  PINGIN_PING,
34  CMD_CLOSEFILE
35  } MsgTypeEnum;
36 
37  // Get the max size by doing a union of the input port serialization sizes.
38 
39  typedef union {
43  } BuffUnion;
44 
45  // Define a message buffer class large enough to handle all the
46  // asynchronous inputs to the component
47 
48  class ComponentIpcSerializableBuffer :
50  {
51 
52  public:
53 
54  enum {
55  // Max. message size = size of data + message id + port
56  SERIALIZATION_SIZE =
57  sizeof(BuffUnion) +
58  sizeof(NATIVE_INT_TYPE) +
59  sizeof(NATIVE_INT_TYPE)
60  };
61 
62  NATIVE_UINT_TYPE getBuffCapacity(void) const {
63  return sizeof(m_buff);
64  }
65 
66  U8* getBuffAddr(void) {
67  return m_buff;
68  }
69 
70  const U8* getBuffAddr(void) const {
71  return m_buff;
72  }
73 
74  private:
75  // Should be the max of all the input ports serialized sizes...
76  U8 m_buff[SERIALIZATION_SIZE];
77 
78  };
79 
80  }
81 
82  // ----------------------------------------------------------------------
83  // Getters for numbers of input ports
84  // ----------------------------------------------------------------------
85 
88  {
89  FW_ASSERT(portNum < this->getNum_comIn_InputPorts(),static_cast<AssertArg>(portNum));
90  return &this->m_comIn_InputPort[portNum];
91  }
92 
95  {
96  FW_ASSERT(portNum < this->getNum_cmdIn_InputPorts(),static_cast<AssertArg>(portNum));
97  return &this->m_cmdIn_InputPort[portNum];
98  }
99 
102  {
103  FW_ASSERT(portNum < this->getNum_pingIn_InputPorts(),static_cast<AssertArg>(portNum));
104  return &this->m_pingIn_InputPort[portNum];
105  }
106 
107  // ----------------------------------------------------------------------
108  // Typed connectors for output ports
109  // ----------------------------------------------------------------------
110 
113  NATIVE_INT_TYPE portNum,
114  Fw::InputTimePort* port
115  )
116  {
117  FW_ASSERT(portNum < this->getNum_timeCaller_OutputPorts(),static_cast<AssertArg>(portNum));
118  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
119  }
120 
123  NATIVE_INT_TYPE portNum,
124  Fw::InputCmdRegPort* port
125  )
126  {
127  FW_ASSERT(portNum < this->getNum_cmdRegOut_OutputPorts(),static_cast<AssertArg>(portNum));
129  }
130 
133  NATIVE_INT_TYPE portNum,
134  Fw::InputLogPort* port
135  )
136  {
137  FW_ASSERT(portNum < this->getNum_logOut_OutputPorts(),static_cast<AssertArg>(portNum));
139  }
140 
143  NATIVE_INT_TYPE portNum,
145  )
146  {
147  FW_ASSERT(portNum < this->getNum_cmdResponseOut_OutputPorts(),static_cast<AssertArg>(portNum));
149  }
150 
153  NATIVE_INT_TYPE portNum,
154  Svc::InputPingPort* port
155  )
156  {
157  FW_ASSERT(portNum < this->getNum_pingOut_OutputPorts(),static_cast<AssertArg>(portNum));
159  }
160 
161 #if FW_ENABLE_TEXT_LOGGING == 1
162  void ComLoggerComponentBase ::
163  set_LogText_OutputPort(
164  NATIVE_INT_TYPE portNum,
166  )
167  {
168  FW_ASSERT(portNum < this->getNum_LogText_OutputPorts(),static_cast<AssertArg>(portNum));
169  this->m_LogText_OutputPort[portNum].addCallPort(port);
170  }
171 #endif
172 
173  // ----------------------------------------------------------------------
174  // Serialization connectors for output ports
175  // ----------------------------------------------------------------------
176 
177 #if FW_PORT_SERIALIZATION
178 
181  NATIVE_INT_TYPE portNum,
182  Fw::InputSerializePort *port
183  )
184  {
185  FW_ASSERT(portNum < this->getNum_timeCaller_OutputPorts(),static_cast<AssertArg>(portNum));
186  return this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
187  }
188 
191  NATIVE_INT_TYPE portNum,
192  Fw::InputSerializePort *port
193  )
194  {
195  FW_ASSERT(portNum < this->getNum_cmdRegOut_OutputPorts(),static_cast<AssertArg>(portNum));
196  return this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
197  }
198 
201  NATIVE_INT_TYPE portNum,
202  Fw::InputSerializePort *port
203  )
204  {
205  FW_ASSERT(portNum < this->getNum_logOut_OutputPorts(),static_cast<AssertArg>(portNum));
206  return this->m_logOut_OutputPort[portNum].registerSerialPort(port);
207  }
208 
211  NATIVE_INT_TYPE portNum,
212  Fw::InputSerializePort *port
213  )
214  {
215  FW_ASSERT(portNum < this->getNum_cmdResponseOut_OutputPorts(),static_cast<AssertArg>(portNum));
216  return this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
217  }
218 
221  NATIVE_INT_TYPE portNum,
222  Fw::InputSerializePort *port
223  )
224  {
225  FW_ASSERT(portNum < this->getNum_pingOut_OutputPorts(),static_cast<AssertArg>(portNum));
226  return this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
227  }
228 
229 #if FW_ENABLE_TEXT_LOGGING == 1
230  void ComLoggerComponentBase ::
231  set_LogText_OutputPort(
232  NATIVE_INT_TYPE portNum,
233  Fw::InputSerializePort *port
234  )
235  {
236  FW_ASSERT(portNum < this->getNum_LogText_OutputPorts(),static_cast<AssertArg>(portNum));
237  return this->m_LogText_OutputPort[portNum].registerSerialPort(port);
238  }
239 #endif
240 
241 #endif
242 
243  // ----------------------------------------------------------------------
244  // Command registration
245  // ----------------------------------------------------------------------
246 
248  regCommands(void)
249  {
250  FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
252  this->getIdBase() + OPCODE_CLOSEFILE
253  );
254  }
255 
256  // ----------------------------------------------------------------------
257  // Component construction, initialization, and destruction
258  // ----------------------------------------------------------------------
259 
261 #if FW_OBJECT_NAMES == 1
262  ComLoggerComponentBase(const char* compName) :
263  Fw::ActiveComponentBase(compName)
264 #else
266  Fw::ActiveComponentBase()
267 #endif
268  {
269 
270 
271 
272  }
273 
275  init(
276  NATIVE_INT_TYPE queueDepth,
277  NATIVE_INT_TYPE instance
278  )
279  {
280 
281  // Initialize base class
283 
284  // Connect input port comIn
285  for (
286  NATIVE_INT_TYPE port = 0;
287  port < this->getNum_comIn_InputPorts();
288  port++
289  ) {
290 
291  this->m_comIn_InputPort[port].init();
292  this->m_comIn_InputPort[port].addCallComp(
293  this,
294  m_p_comIn_in
295  );
296  this->m_comIn_InputPort[port].setPortNum(port);
297 
298 #if FW_OBJECT_NAMES == 1
299  char portName[120];
300  (void) snprintf(
301  portName,
302  sizeof(portName),
303  "%s_comIn_InputPort[%d]",
304  this->m_objName,
305  port
306  );
307  this->m_comIn_InputPort[port].setObjName(portName);
308 #endif
309 
310  }
311 
312  // Connect input port cmdIn
313  for (
314  NATIVE_INT_TYPE port = 0;
315  port < this->getNum_cmdIn_InputPorts();
316  port++
317  ) {
318 
319  this->m_cmdIn_InputPort[port].init();
320  this->m_cmdIn_InputPort[port].addCallComp(
321  this,
323  );
324  this->m_cmdIn_InputPort[port].setPortNum(port);
325 
326 #if FW_OBJECT_NAMES == 1
327  char portName[120];
328  (void) snprintf(
329  portName,
330  sizeof(portName),
331  "%s_cmdIn_InputPort[%d]",
332  this->m_objName,
333  port
334  );
335  this->m_cmdIn_InputPort[port].setObjName(portName);
336 #endif
337 
338  }
339 
340  // Connect input port pingIn
341  for (
342  NATIVE_INT_TYPE port = 0;
343  port < this->getNum_pingIn_InputPorts();
344  port++
345  ) {
346 
347  this->m_pingIn_InputPort[port].init();
348  this->m_pingIn_InputPort[port].addCallComp(
349  this,
351  );
352  this->m_pingIn_InputPort[port].setPortNum(port);
353 
354 #if FW_OBJECT_NAMES == 1
355  char portName[120];
356  (void) snprintf(
357  portName,
358  sizeof(portName),
359  "%s_pingIn_InputPort[%d]",
360  this->m_objName,
361  port
362  );
363  this->m_pingIn_InputPort[port].setObjName(portName);
364 #endif
365 
366  }
367 
368  // Initialize output port timeCaller
369  for (
370  NATIVE_INT_TYPE port = 0;
371  port < this->getNum_timeCaller_OutputPorts();
372  port++
373  ) {
374  this->m_timeCaller_OutputPort[port].init();
375 
376 #if FW_OBJECT_NAMES == 1
377  char portName[120];
378  (void) snprintf(
379  portName,
380  sizeof(portName),
381  "%s_timeCaller_OutputPort[%d]",
382  this->m_objName,
383  port
384  );
385  this->m_timeCaller_OutputPort[port].setObjName(portName);
386 #endif
387 
388  }
389 
390  // Initialize output port cmdRegOut
391  for (
392  NATIVE_INT_TYPE port = 0;
393  port < this->getNum_cmdRegOut_OutputPorts();
394  port++
395  ) {
396  this->m_cmdRegOut_OutputPort[port].init();
397 
398 #if FW_OBJECT_NAMES == 1
399  char portName[120];
400  (void) snprintf(
401  portName,
402  sizeof(portName),
403  "%s_cmdRegOut_OutputPort[%d]",
404  this->m_objName,
405  port
406  );
407  this->m_cmdRegOut_OutputPort[port].setObjName(portName);
408 #endif
409 
410  }
411 
412  // Initialize output port logOut
413  for (
414  NATIVE_INT_TYPE port = 0;
415  port < this->getNum_logOut_OutputPorts();
416  port++
417  ) {
418  this->m_logOut_OutputPort[port].init();
419 
420 #if FW_OBJECT_NAMES == 1
421  char portName[120];
422  (void) snprintf(
423  portName,
424  sizeof(portName),
425  "%s_logOut_OutputPort[%d]",
426  this->m_objName,
427  port
428  );
429  this->m_logOut_OutputPort[port].setObjName(portName);
430 #endif
431 
432  }
433 
434  // Initialize output port cmdResponseOut
435  for (
436  NATIVE_INT_TYPE port = 0;
437  port < this->getNum_cmdResponseOut_OutputPorts();
438  port++
439  ) {
440  this->m_cmdResponseOut_OutputPort[port].init();
441 
442 #if FW_OBJECT_NAMES == 1
443  char portName[120];
444  (void) snprintf(
445  portName,
446  sizeof(portName),
447  "%s_cmdResponseOut_OutputPort[%d]",
448  this->m_objName,
449  port
450  );
451  this->m_cmdResponseOut_OutputPort[port].setObjName(portName);
452 #endif
453 
454  }
455 
456  // Initialize output port pingOut
457  for (
458  NATIVE_INT_TYPE port = 0;
459  port < this->getNum_pingOut_OutputPorts();
460  port++
461  ) {
462  this->m_pingOut_OutputPort[port].init();
463 
464 #if FW_OBJECT_NAMES == 1
465  char portName[120];
466  (void) snprintf(
467  portName,
468  sizeof(portName),
469  "%s_pingOut_OutputPort[%d]",
470  this->m_objName,
471  port
472  );
473  this->m_pingOut_OutputPort[port].setObjName(portName);
474 #endif
475 
476  }
477 
478  // Initialize output port LogText
479 #if FW_ENABLE_TEXT_LOGGING == 1
480  for (
481  NATIVE_INT_TYPE port = 0;
482  port < this->getNum_LogText_OutputPorts();
483  port++
484  ) {
485  this->m_LogText_OutputPort[port].init();
486 
487 #if FW_OBJECT_NAMES == 1
488  char portName[120];
489  (void) snprintf(
490  portName,
491  sizeof(portName),
492  "%s_LogText_OutputPort[%d]",
493  this->m_objName,
494  port
495  );
496  this->m_LogText_OutputPort[port].setObjName(portName);
497 #endif
498 
499  }
500 #endif
501 
502  Os::Queue::QueueStatus qStat =
503  this->createQueue(
504  queueDepth,
505  ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
506  );
507  FW_ASSERT(
508  Os::Queue::QUEUE_OK == qStat,
509  static_cast<AssertArg>(qStat)
510  );
511 
512  }
513 
516 
517  }
518 
519  // ----------------------------------------------------------------------
520  // Invocation functions for output ports
521  // ----------------------------------------------------------------------
522 
523  void ComLoggerComponentBase ::
524  pingOut_out(
525  NATIVE_INT_TYPE portNum,
526  U32 key
527  )
528  {
529  FW_ASSERT(portNum < this->getNum_pingOut_OutputPorts(),static_cast<AssertArg>(portNum));
530  this->m_pingOut_OutputPort[portNum].invoke(key);
531  }
532 
533  // ----------------------------------------------------------------------
534  // Getters for numbers of ports
535  // ----------------------------------------------------------------------
536 
537  NATIVE_INT_TYPE ComLoggerComponentBase ::
538  getNum_comIn_InputPorts(void)
539  {
541  this->m_comIn_InputPort
542  );
543  }
544 
545  NATIVE_INT_TYPE ComLoggerComponentBase ::
546  getNum_timeCaller_OutputPorts(void)
547  {
549  this->m_timeCaller_OutputPort
550  );
551  }
552 
555  {
558  );
559  }
560 
563  {
565  this->m_cmdIn_InputPort
566  );
567  }
568 
571  {
573  this->m_logOut_OutputPort
574  );
575  }
576 
579  {
582  );
583  }
584 
587  {
589  this->m_pingIn_InputPort
590  );
591  }
592 
595  {
598  );
599  }
600 
601 #if FW_ENABLE_TEXT_LOGGING == 1
602  NATIVE_INT_TYPE ComLoggerComponentBase ::
603  getNum_LogText_OutputPorts(void)
604  {
606  this->m_LogText_OutputPort
607  );
608  }
609 #endif
610 
611  // ----------------------------------------------------------------------
612  // Port connection status queries
613  // ----------------------------------------------------------------------
614 
615  bool ComLoggerComponentBase ::
616  isConnected_timeCaller_OutputPort(NATIVE_INT_TYPE portNum)
617  {
618  FW_ASSERT(
619  portNum < this->getNum_timeCaller_OutputPorts(),
620  static_cast<AssertArg>(portNum)
621  );
622  return this->m_timeCaller_OutputPort[portNum].isConnected();
623  }
624 
627  {
628  FW_ASSERT(
629  portNum < this->getNum_cmdRegOut_OutputPorts(),
630  static_cast<AssertArg>(portNum)
631  );
633  }
634 
637  {
638  FW_ASSERT(
639  portNum < this->getNum_logOut_OutputPorts(),
640  static_cast<AssertArg>(portNum)
641  );
642  return this->m_logOut_OutputPort[portNum].isConnected();
643  }
644 
647  {
648  FW_ASSERT(
649  portNum < this->getNum_cmdResponseOut_OutputPorts(),
650  static_cast<AssertArg>(portNum)
651  );
653  }
654 
657  {
658  FW_ASSERT(
659  portNum < this->getNum_pingOut_OutputPorts(),
660  static_cast<AssertArg>(portNum)
661  );
662  return this->m_pingOut_OutputPort[portNum].isConnected();
663  }
664 
665 #if FW_ENABLE_TEXT_LOGGING == 1
666  bool ComLoggerComponentBase ::
667  isConnected_LogText_OutputPort(NATIVE_INT_TYPE portNum)
668  {
669  FW_ASSERT(
670  portNum < this->getNum_LogText_OutputPorts(),
671  static_cast<AssertArg>(portNum)
672  );
673  return this->m_LogText_OutputPort[portNum].isConnected();
674  }
675 #endif
676 
677  // ----------------------------------------------------------------------
678  // Calls for messages received on command input ports
679  // ----------------------------------------------------------------------
680 
683  Fw::PassiveComponentBase* callComp,
684  NATIVE_INT_TYPE portNum,
685  FwOpcodeType opCode,
686  U32 cmdSeq,
687  Fw::CmdArgBuffer &args
688  )
689  {
690 
691  // Select base class function based on opcode
692  FW_ASSERT(callComp);
693  ComLoggerComponentBase* compPtr =
694  (ComLoggerComponentBase*) callComp;
695 
696  const U32 idBase = callComp->getIdBase();
697  FW_ASSERT(opCode >= idBase, opCode, idBase);
698  switch (opCode - idBase) {
699 
700  case OPCODE_CLOSEFILE:
701  compPtr->CloseFile_cmdHandlerBase(
702  opCode,
703  cmdSeq,
704  args
705  );
706  break;
707 
708  default: {
709  compPtr->cmdResponse_out(
710  opCode,cmdSeq,
712  );
713  break;
714  }
715 
716  }
717 
718  }
719 
720  void ComLoggerComponentBase ::
721  cmdResponse_out(
722  FwOpcodeType opCode,
723  U32 cmdSeq,
724  Fw::CommandResponse response
725  )
726  {
727  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
729  }
730 
731  // ----------------------------------------------------------------------
732  // Base class command functions
733  // ----------------------------------------------------------------------
734 
735  void ComLoggerComponentBase ::
736  CloseFile_cmdHandlerBase(
737  FwOpcodeType opCode,
738  U32 cmdSeq,
739  Fw::CmdArgBuffer &args
740  )
741  {
742 
743  // Call pre-message hook
744  this->CloseFile_preMsgHook(opCode,cmdSeq);
745 
746  // Defer deserializing arguments to the message dispatcher
747  // to avoid deserializing and reserializing just for IPC
748  ComponentIpcSerializableBuffer msg;
750 
751  // Serialize for IPC
752  _status = msg.serialize((NATIVE_INT_TYPE)CMD_CLOSEFILE);
753  FW_ASSERT (
754  _status == Fw::FW_SERIALIZE_OK,
755  static_cast<AssertArg>(_status)
756  );
757 
758  // Fake port number to make message dequeue work
759  NATIVE_INT_TYPE port = 0;
760  _status = msg.serialize(port);
761  FW_ASSERT (
762  _status == Fw::FW_SERIALIZE_OK,
763  static_cast<AssertArg>(_status)
764  );
765 
766  _status = msg.serialize(opCode);
767  FW_ASSERT (
768  _status == Fw::FW_SERIALIZE_OK,
769  static_cast<AssertArg>(_status)
770  );
771 
772  _status = msg.serialize(cmdSeq);
773  FW_ASSERT (
774  _status == Fw::FW_SERIALIZE_OK,
775  static_cast<AssertArg>(_status)
776  );
777 
778  _status = msg.serialize(args);
779  FW_ASSERT (
780  _status == Fw::FW_SERIALIZE_OK,
781  static_cast<AssertArg>(_status)
782  );
783 
784  // send message
785  Os::Queue::QueueBlocking _block =
787  Os::Queue::QueueStatus qStatus =
788  this->m_queue.send(msg, 0,_block);
789  FW_ASSERT(
790  qStatus == Os::Queue::QUEUE_OK,
791  static_cast<AssertArg>(qStatus)
792  );
793 
794  }
795 
796  void ComLoggerComponentBase::
797  CloseFile_preMsgHook(
798  FwOpcodeType opCode,
799  U32 cmdSeq
800  )
801  {
802  // Defaults to no-op; can be overridden
803  }
804 
805  // ----------------------------------------------------------------------
806  // Time
807  // ----------------------------------------------------------------------
808 
809  Fw::Time ComLoggerComponentBase ::
810  getTime(void)
811  {
812  if (this->m_timeCaller_OutputPort[0].isConnected()) {
813  Fw::Time _time;
814  this->m_timeCaller_OutputPort[0].invoke(_time);
815  return _time;
816  } else {
817  return Fw::Time(TB_NONE,0,0);
818  }
819  }
820 
821  // ----------------------------------------------------------------------
822  // Event handling functions
823  // ----------------------------------------------------------------------
824 
825  void ComLoggerComponentBase ::
826  log_WARNING_HI_FileOpenError(
827  U32 errornum, Fw::LogStringArg& file
828  )
829  {
830 
831 
832  // Get the time
833  Fw::Time _logTime;
834  if (this->m_timeCaller_OutputPort[0].isConnected()) {
835  this->m_timeCaller_OutputPort[0].invoke( _logTime);
836  }
837 
838  FwEventIdType _id = static_cast<FwEventIdType>(0);
839 
840  _id = this->getIdBase() + EVENTID_FILEOPENERROR;
841 
842  // Emit the event on the log port
843  if (this->m_logOut_OutputPort[0].isConnected()) {
844 
845  Fw::LogBuffer _logBuff;
847 
848 #if FW_AMPCS_COMPATIBLE
849  // Serialize the number of arguments
850  _status = _logBuff.serialize(static_cast<U8>(2));
851  FW_ASSERT(
852  _status == Fw::FW_SERIALIZE_OK,
853  static_cast<AssertArg>(_status)
854  );
855 #endif
856 
857 #if FW_AMPCS_COMPATIBLE
858  // Serialize the argument size
859  _status = _logBuff.serialize(
860  static_cast<U8>(sizeof(errornum))
861  );
862  FW_ASSERT(
863  _status == Fw::FW_SERIALIZE_OK,
864  static_cast<AssertArg>(_status)
865  );
866 #endif
867 
868  _status = _logBuff.serialize(errornum);
869  FW_ASSERT(
870  _status == Fw::FW_SERIALIZE_OK,
871  static_cast<AssertArg>(_status)
872  );
873 
874  file.setMaxSerialize(240);
875  _status = _logBuff.serialize(file);
876  FW_ASSERT(
877  _status == Fw::FW_SERIALIZE_OK,
878  static_cast<AssertArg>(_status)
879  );
880 
881 
882  this->m_logOut_OutputPort[0].invoke(
883  _id,
884  _logTime,Fw::LOG_WARNING_HI,
885  _logBuff
886  );
887 
888  }
889 
890  // Emit the event on the text log port
891 #if FW_ENABLE_TEXT_LOGGING
892  if (this->m_LogText_OutputPort[0].isConnected()) {
893 
894 #if FW_OBJECT_NAMES == 1
895  const char* _formatString =
896  "(%s) %s: Error %d opening file %s";
897 #else
898  const char* _formatString =
899  "%s: Error %d opening file %s";
900 #endif
901 
902  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
903 
904  (void) snprintf(
905  _textBuffer,
907  _formatString,
908 #if FW_OBJECT_NAMES == 1
909  this->m_objName,
910 #endif
911  "FileOpenError "
912  , errornum
913  , file.toChar()
914  );
915 
916  // Null terminate
917  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
918  Fw::TextLogString _logString = _textBuffer;
919  this->m_LogText_OutputPort[0].invoke(
920  _id,
921  _logTime,Fw::TEXT_LOG_WARNING_HI,
922  _logString
923  );
924 
925  }
926 #endif
927 
928  }
929 
930 
933  U32 errornum, U32 bytesWritten, U32 bytesToWrite, Fw::LogStringArg& file
934  )
935  {
936 
937 
938  // Get the time
939  Fw::Time _logTime;
940  if (this->m_timeCaller_OutputPort[0].isConnected()) {
941  this->m_timeCaller_OutputPort[0].invoke( _logTime);
942  }
943 
944  FwEventIdType _id = static_cast<FwEventIdType>(0);
945 
946  _id = this->getIdBase() + EVENTID_FILEWRITEERROR;
947 
948  // Emit the event on the log port
949  if (this->m_logOut_OutputPort[0].isConnected()) {
950 
951  Fw::LogBuffer _logBuff;
953 
954 #if FW_AMPCS_COMPATIBLE
955  // Serialize the number of arguments
956  _status = _logBuff.serialize(static_cast<U8>(4));
957  FW_ASSERT(
958  _status == Fw::FW_SERIALIZE_OK,
959  static_cast<AssertArg>(_status)
960  );
961 #endif
962 
963 #if FW_AMPCS_COMPATIBLE
964  // Serialize the argument size
965  _status = _logBuff.serialize(
966  static_cast<U8>(sizeof(errornum))
967  );
968  FW_ASSERT(
969  _status == Fw::FW_SERIALIZE_OK,
970  static_cast<AssertArg>(_status)
971  );
972 #endif
973 
974  _status = _logBuff.serialize(errornum);
975  FW_ASSERT(
976  _status == Fw::FW_SERIALIZE_OK,
977  static_cast<AssertArg>(_status)
978  );
979 
980 #if FW_AMPCS_COMPATIBLE
981  // Serialize the argument size
982  _status = _logBuff.serialize(
983  static_cast<U8>(sizeof(bytesWritten))
984  );
985  FW_ASSERT(
986  _status == Fw::FW_SERIALIZE_OK,
987  static_cast<AssertArg>(_status)
988  );
989 #endif
990 
991  _status = _logBuff.serialize(bytesWritten);
992  FW_ASSERT(
993  _status == Fw::FW_SERIALIZE_OK,
994  static_cast<AssertArg>(_status)
995  );
996 
997 #if FW_AMPCS_COMPATIBLE
998  // Serialize the argument size
999  _status = _logBuff.serialize(
1000  static_cast<U8>(sizeof(bytesToWrite))
1001  );
1002  FW_ASSERT(
1003  _status == Fw::FW_SERIALIZE_OK,
1004  static_cast<AssertArg>(_status)
1005  );
1006 #endif
1007 
1008  _status = _logBuff.serialize(bytesToWrite);
1009  FW_ASSERT(
1010  _status == Fw::FW_SERIALIZE_OK,
1011  static_cast<AssertArg>(_status)
1012  );
1013 
1014  file.setMaxSerialize(240);
1015  _status = _logBuff.serialize(file);
1016  FW_ASSERT(
1017  _status == Fw::FW_SERIALIZE_OK,
1018  static_cast<AssertArg>(_status)
1019  );
1020 
1021 
1022  this->m_logOut_OutputPort[0].invoke(
1023  _id,
1024  _logTime,Fw::LOG_WARNING_HI,
1025  _logBuff
1026  );
1027 
1028  }
1029 
1030  // Emit the event on the text log port
1031 #if FW_ENABLE_TEXT_LOGGING
1032  if (this->m_LogText_OutputPort[0].isConnected()) {
1033 
1034 #if FW_OBJECT_NAMES == 1
1035  const char* _formatString =
1036  "(%s) %s: Error %d while writing %d of %d bytes to %s";
1037 #else
1038  const char* _formatString =
1039  "%s: Error %d while writing %d of %d bytes to %s";
1040 #endif
1041 
1042  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1043 
1044  (void) snprintf(
1045  _textBuffer,
1047  _formatString,
1048 #if FW_OBJECT_NAMES == 1
1049  this->m_objName,
1050 #endif
1051  "FileWriteError "
1052  , errornum
1053  , bytesWritten
1054  , bytesToWrite
1055  , file.toChar()
1056  );
1057 
1058  // Null terminate
1059  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1060  Fw::TextLogString _logString = _textBuffer;
1061  this->m_LogText_OutputPort[0].invoke(
1062  _id,
1063  _logTime,Fw::TEXT_LOG_WARNING_HI,
1064  _logString
1065  );
1066 
1067  }
1068 #endif
1069 
1070  }
1071 
1072 
1075  Fw::LogStringArg& validationFile, Fw::LogStringArg& file, U32 status
1076  )
1077  {
1078 
1079 
1080  // Get the time
1081  Fw::Time _logTime;
1082  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1083  this->m_timeCaller_OutputPort[0].invoke( _logTime);
1084  }
1085 
1086  FwEventIdType _id = static_cast<FwEventIdType>(0);
1087 
1088  _id = this->getIdBase() + EVENTID_FILEVALIDATIONERROR;
1089 
1090  // Emit the event on the log port
1091  if (this->m_logOut_OutputPort[0].isConnected()) {
1092 
1093  Fw::LogBuffer _logBuff;
1095 
1096 #if FW_AMPCS_COMPATIBLE
1097  // Serialize the number of arguments
1098  _status = _logBuff.serialize(static_cast<U8>(3));
1099  FW_ASSERT(
1100  _status == Fw::FW_SERIALIZE_OK,
1101  static_cast<AssertArg>(_status)
1102  );
1103 #endif
1104 
1105  validationFile.setMaxSerialize(240);
1106  _status = _logBuff.serialize(validationFile);
1107  FW_ASSERT(
1108  _status == Fw::FW_SERIALIZE_OK,
1109  static_cast<AssertArg>(_status)
1110  );
1111 
1112  file.setMaxSerialize(240);
1113  _status = _logBuff.serialize(file);
1114  FW_ASSERT(
1115  _status == Fw::FW_SERIALIZE_OK,
1116  static_cast<AssertArg>(_status)
1117  );
1118 
1119 #if FW_AMPCS_COMPATIBLE
1120  // Serialize the argument size
1121  _status = _logBuff.serialize(
1122  static_cast<U8>(sizeof(status))
1123  );
1124  FW_ASSERT(
1125  _status == Fw::FW_SERIALIZE_OK,
1126  static_cast<AssertArg>(_status)
1127  );
1128 #endif
1129 
1130  _status = _logBuff.serialize(status);
1131  FW_ASSERT(
1132  _status == Fw::FW_SERIALIZE_OK,
1133  static_cast<AssertArg>(_status)
1134  );
1135 
1136 
1137  this->m_logOut_OutputPort[0].invoke(
1138  _id,
1139  _logTime,Fw::LOG_WARNING_LO,
1140  _logBuff
1141  );
1142 
1143  }
1144 
1145  // Emit the event on the text log port
1146 #if FW_ENABLE_TEXT_LOGGING
1147  if (this->m_LogText_OutputPort[0].isConnected()) {
1148 
1149 #if FW_OBJECT_NAMES == 1
1150  const char* _formatString =
1151  "(%s) %s: The ComLogger failed to create a validation file %s for %s with error %d.";
1152 #else
1153  const char* _formatString =
1154  "%s: The ComLogger failed to create a validation file %s for %s with error %d.";
1155 #endif
1156 
1157  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1158 
1159  (void) snprintf(
1160  _textBuffer,
1162  _formatString,
1163 #if FW_OBJECT_NAMES == 1
1164  this->m_objName,
1165 #endif
1166  "FileValidationError "
1167  , validationFile.toChar()
1168  , file.toChar()
1169  , status
1170  );
1171 
1172  // Null terminate
1173  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1174  Fw::TextLogString _logString = _textBuffer;
1175  this->m_LogText_OutputPort[0].invoke(
1176  _id,
1177  _logTime,Fw::TEXT_LOG_WARNING_LO,
1178  _logString
1179  );
1180 
1181  }
1182 #endif
1183 
1184  }
1185 
1186 
1189  Fw::LogStringArg& file
1190  )
1191  {
1192 
1193 
1194  // Get the time
1195  Fw::Time _logTime;
1196  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1197  this->m_timeCaller_OutputPort[0].invoke( _logTime);
1198  }
1199 
1200  FwEventIdType _id = static_cast<FwEventIdType>(0);
1201 
1202  _id = this->getIdBase() + EVENTID_FILECLOSED;
1203 
1204  // Emit the event on the log port
1205  if (this->m_logOut_OutputPort[0].isConnected()) {
1206 
1207  Fw::LogBuffer _logBuff;
1209 
1210 #if FW_AMPCS_COMPATIBLE
1211  // Serialize the number of arguments
1212  _status = _logBuff.serialize(static_cast<U8>(1));
1213  FW_ASSERT(
1214  _status == Fw::FW_SERIALIZE_OK,
1215  static_cast<AssertArg>(_status)
1216  );
1217 #endif
1218 
1219  file.setMaxSerialize(240);
1220  _status = _logBuff.serialize(file);
1221  FW_ASSERT(
1222  _status == Fw::FW_SERIALIZE_OK,
1223  static_cast<AssertArg>(_status)
1224  );
1225 
1226 
1227  this->m_logOut_OutputPort[0].invoke(
1228  _id,
1229  _logTime,Fw::LOG_DIAGNOSTIC,
1230  _logBuff
1231  );
1232 
1233  }
1234 
1235  // Emit the event on the text log port
1236 #if FW_ENABLE_TEXT_LOGGING
1237  if (this->m_LogText_OutputPort[0].isConnected()) {
1238 
1239 #if FW_OBJECT_NAMES == 1
1240  const char* _formatString =
1241  "(%s) %s: File %s closed successfully.";
1242 #else
1243  const char* _formatString =
1244  "%s: File %s closed successfully.";
1245 #endif
1246 
1247  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1248 
1249  (void) snprintf(
1250  _textBuffer,
1252  _formatString,
1253 #if FW_OBJECT_NAMES == 1
1254  this->m_objName,
1255 #endif
1256  "FileClosed "
1257  , file.toChar()
1258  );
1259 
1260  // Null terminate
1261  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1262  Fw::TextLogString _logString = _textBuffer;
1263  this->m_LogText_OutputPort[0].invoke(
1264  _id,
1265  _logTime,Fw::TEXT_LOG_DIAGNOSTIC,
1266  _logString
1267  );
1268 
1269  }
1270 #endif
1271 
1272  }
1273 
1274 
1275  // ----------------------------------------------------------------------
1276  // Calls for invocations received on typed input ports
1277  // ----------------------------------------------------------------------
1278 
1279  void ComLoggerComponentBase ::
1280  m_p_comIn_in(
1281  Fw::PassiveComponentBase* callComp,
1282  NATIVE_INT_TYPE portNum,
1283  Fw::ComBuffer &data, U32 context
1284  )
1285  {
1286  FW_ASSERT(callComp);
1287  ComLoggerComponentBase* compPtr =
1288  (ComLoggerComponentBase*) callComp;
1289  compPtr->comIn_handlerBase(portNum, data, context);
1290  }
1291 
1294  Fw::PassiveComponentBase* callComp,
1295  NATIVE_INT_TYPE portNum,
1296  U32 key
1297  )
1298  {
1299  FW_ASSERT(callComp);
1300  ComLoggerComponentBase* compPtr =
1301  (ComLoggerComponentBase*) callComp;
1302  compPtr->pingIn_handlerBase(portNum, key);
1303  }
1304 
1305  // ----------------------------------------------------------------------
1306  // Port handler base-class functions for typed input ports
1307  // ----------------------------------------------------------------------
1308 
1309  void ComLoggerComponentBase ::
1310  comIn_handlerBase(
1311  NATIVE_INT_TYPE portNum,
1312  Fw::ComBuffer &data, U32 context
1313  )
1314  {
1315 
1316  // Make sure port number is valid
1317  FW_ASSERT(portNum < this->getNum_comIn_InputPorts(),static_cast<AssertArg>(portNum));
1318 
1319  // Call pre-message hook
1320  comIn_preMsgHook(
1321  portNum,
1322  data, context
1323  );
1324 
1325  ComponentIpcSerializableBuffer msg;
1327 
1328  _status = msg.serialize(
1329  static_cast<NATIVE_INT_TYPE>(COMIN_COM)
1330  );
1331  FW_ASSERT (
1332  _status == Fw::FW_SERIALIZE_OK,
1333  static_cast<AssertArg>(_status)
1334  );
1335 
1336  _status = msg.serialize(portNum);
1337  FW_ASSERT (
1338  _status == Fw::FW_SERIALIZE_OK,
1339  static_cast<AssertArg>(_status)
1340  );
1341 
1342  // Serialize argument data
1343  _status = msg.serialize(data);
1344  FW_ASSERT(
1345  _status == Fw::FW_SERIALIZE_OK,
1346  static_cast<AssertArg>(_status)
1347  );
1348 
1349  // Serialize argument context
1350  _status = msg.serialize(context);
1351  FW_ASSERT(
1352  _status == Fw::FW_SERIALIZE_OK,
1353  static_cast<AssertArg>(_status)
1354  );
1355 
1356 
1357  // send message
1358  Os::Queue::QueueBlocking _block =
1360  Os::Queue::QueueStatus qStatus =
1361  this->m_queue.send(msg, 0,_block);
1362  FW_ASSERT(
1363  qStatus == Os::Queue::QUEUE_OK,
1364  static_cast<AssertArg>(qStatus)
1365  );
1366 
1367  }
1368 
1371  NATIVE_INT_TYPE portNum,
1372  U32 key
1373  )
1374  {
1375 
1376  // Make sure port number is valid
1377  FW_ASSERT(portNum < this->getNum_pingIn_InputPorts(),static_cast<AssertArg>(portNum));
1378 
1379  // Call pre-message hook
1381  portNum,
1382  key
1383  );
1384 
1385  ComponentIpcSerializableBuffer msg;
1387 
1388  _status = msg.serialize(
1389  static_cast<NATIVE_INT_TYPE>(PINGIN_PING)
1390  );
1391  FW_ASSERT (
1392  _status == Fw::FW_SERIALIZE_OK,
1393  static_cast<AssertArg>(_status)
1394  );
1395 
1396  _status = msg.serialize(portNum);
1397  FW_ASSERT (
1398  _status == Fw::FW_SERIALIZE_OK,
1399  static_cast<AssertArg>(_status)
1400  );
1401 
1402  // Serialize argument key
1403  _status = msg.serialize(key);
1404  FW_ASSERT(
1405  _status == Fw::FW_SERIALIZE_OK,
1406  static_cast<AssertArg>(_status)
1407  );
1408 
1409 
1410  // send message
1411  Os::Queue::QueueBlocking _block =
1413  Os::Queue::QueueStatus qStatus =
1414  this->m_queue.send(msg, 0,_block);
1415  FW_ASSERT(
1416  qStatus == Os::Queue::QUEUE_OK,
1417  static_cast<AssertArg>(qStatus)
1418  );
1419 
1420  }
1421 
1422  // ----------------------------------------------------------------------
1423  // Pre-message hooks for async input ports
1424  // ----------------------------------------------------------------------
1425 
1426  void ComLoggerComponentBase ::
1427  comIn_preMsgHook(
1428  NATIVE_INT_TYPE portNum,
1429  Fw::ComBuffer &data, U32 context
1430  )
1431  {
1432  // Default: no-op
1433  }
1434 
1437  NATIVE_INT_TYPE portNum,
1438  U32 key
1439  )
1440  {
1441  // Default: no-op
1442  }
1443 
1444  // ----------------------------------------------------------------------
1445  // Message dispatch method for active and queued components. Called
1446  // by active component thread or implementation code for queued components
1447  // ----------------------------------------------------------------------
1448 
1450  doDispatch(void)
1451  {
1452  ComponentIpcSerializableBuffer msg;
1453  NATIVE_INT_TYPE priority;
1454 
1455  Os::Queue::QueueStatus msgStatus = this->m_queue.receive(msg,priority,Os::Queue::QUEUE_BLOCKING);
1456  FW_ASSERT(
1457  msgStatus == Os::Queue::QUEUE_OK,
1458  static_cast<AssertArg>(msgStatus)
1459  );
1460 
1461  // Reset to beginning of buffer
1462  msg.resetDeser();
1463 
1464  NATIVE_INT_TYPE desMsg;
1465  Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
1466  FW_ASSERT(
1467  deserStatus == Fw::FW_SERIALIZE_OK,
1468  static_cast<AssertArg>(deserStatus)
1469  );
1470 
1471  MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
1472 
1473  if (msgType == COMLOGGER_COMPONENT_EXIT) {
1474  return MSG_DISPATCH_EXIT;
1475  }
1476 
1478  deserStatus = msg.deserialize(portNum);
1479  FW_ASSERT(
1480  deserStatus == Fw::FW_SERIALIZE_OK,
1481  static_cast<AssertArg>(deserStatus)
1482  );
1483 
1484  switch (msgType) {
1485 
1486  // Handle async input port comIn
1487  case COMIN_COM: {
1488 
1489  // Deserialize argument data
1491  deserStatus = msg.deserialize(data);
1492  FW_ASSERT(
1493  deserStatus == Fw::FW_SERIALIZE_OK,
1494  static_cast<AssertArg>(deserStatus)
1495  );
1496 
1497  // Deserialize argument context
1498  U32 context;
1499  deserStatus = msg.deserialize(context);
1500  FW_ASSERT(
1501  deserStatus == Fw::FW_SERIALIZE_OK,
1502  static_cast<AssertArg>(deserStatus)
1503  );
1504 
1505  // Call handler function
1506  this->comIn_handler(
1507  portNum,
1508  data, context
1509  );
1510 
1511  break;
1512 
1513  }
1514 
1515  // Handle async input port pingIn
1516  case PINGIN_PING: {
1517 
1518  // Deserialize argument key
1519  U32 key;
1520  deserStatus = msg.deserialize(key);
1521  FW_ASSERT(
1522  deserStatus == Fw::FW_SERIALIZE_OK,
1523  static_cast<AssertArg>(deserStatus)
1524  );
1525 
1526  // Call handler function
1527  this->pingIn_handler(
1528  portNum,
1529  key
1530  );
1531 
1532  break;
1533 
1534  }
1535 
1536  // Handle command CloseFile
1537  case CMD_CLOSEFILE: {
1538  // Deserialize opcode
1539  FwOpcodeType opCode;
1540  deserStatus = msg.deserialize(opCode);
1541  FW_ASSERT (
1542  deserStatus == Fw::FW_SERIALIZE_OK,
1543  static_cast<AssertArg>(deserStatus)
1544  );
1545 
1546  // Deserialize command sequence
1547  U32 cmdSeq;
1548  deserStatus = msg.deserialize(cmdSeq);
1549  FW_ASSERT (
1550  deserStatus == Fw::FW_SERIALIZE_OK,
1551  static_cast<AssertArg>(deserStatus)
1552  );
1553 
1554  // Deserialize command argument buffer
1556  deserStatus = msg.deserialize(args);
1557  FW_ASSERT (
1558  deserStatus == Fw::FW_SERIALIZE_OK,
1559  static_cast<AssertArg>(deserStatus)
1560  );
1561 
1562  // Reset buffer
1563  args.resetDeser();
1564 
1565  // Make sure there was no data left over.
1566  // That means the argument buffer size was incorrect.
1567 #if FW_CMD_CHECK_RESIDUAL
1568  if (args.getBuffLeft() != 0) {
1569  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1570  this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR);
1571  }
1572  // Don't crash the task if bad arguments were passed from the ground
1573  break;
1574  }
1575 #endif
1576  // Call handler function
1577  this->CloseFile_cmdHandler(opCode, cmdSeq);
1578 
1579  break;
1580 
1581  }
1582 
1583  default:
1584  return MSG_DISPATCH_ERROR;
1585 
1586  }
1587 
1588  return MSG_DISPATCH_OK;
1589 
1590  }
1591 
1592 } // end namespace Svc
Svc::ComLoggerComponentBase::m_cmdResponseOut_OutputPort
Fw::OutputCmdResponsePort m_cmdResponseOut_OutputPort[NUM_CMDRESPONSEOUT_OUTPUT_PORTS]
Definition: ComLoggerComponentAc.hpp:635
Fw::OutputCmdRegPort::init
void init(void)
Definition: CmdRegPortAc.cpp:89
Fw::TextLogString
Definition: TextLogString.hpp:11
Fw::InputTimePort
Definition: TimePortAc.hpp:28
Svc::ComLoggerComponentBase::portNum
PRIVATE NATIVE_INT_TYPE portNum
Definition: ComLoggerComponentAc.hpp:657
Svc::ComLoggerComponentBase::set_cmdResponseOut_OutputPort
void set_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdResponsePort *port)
Definition: ComLoggerComponentAc.cpp:142
Svc::InputPingPort::SERIALIZED_SIZE
@ SERIALIZED_SIZE
serialized size of port arguments
Definition: PingPortAc.hpp:30
Svc::ComLoggerComponentBase::m_cmdIn_InputPort
Fw::InputCmdPort m_cmdIn_InputPort[NUM_CMDIN_INPUT_PORTS]
Definition: ComLoggerComponentAc.hpp:609
Fw::PassiveComponentBase::getIdBase
U32 getIdBase(void) const
Definition: PassiveComponentBase.cpp:40
Svc::ComLoggerComponentBase::pingIn_handlerBase
void pingIn_handlerBase(NATIVE_INT_TYPE portNum, U32 key)
Definition: ComLoggerComponentAc.cpp:1370
Svc::ComLoggerComponentBase::getNum_cmdIn_InputPorts
NATIVE_INT_TYPE getNum_cmdIn_InputPorts(void)
Definition: ComLoggerComponentAc.cpp:562
Svc::ComLoggerComponentBase::m_pingIn_InputPort
Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS]
Definition: ComLoggerComponentAc.hpp:613
Fw::Time
Definition: Time.hpp:10
Svc::ComLoggerComponentBase::args
PROTECTED U32 Fw::CmdArgBuffer & args
Definition: ComLoggerComponentAc.hpp:511
Fw::QueuedComponentBase::doDispatch
virtual MsgDispatchStatus doDispatch(void)=0
method to dispatch a single message in the queue.
Svc::ComLoggerComponentBase::getNum_logOut_OutputPorts
NATIVE_INT_TYPE getNum_logOut_OutputPorts(void)
Definition: ComLoggerComponentAc.cpp:570
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
Fw::InputComPort::SERIALIZED_SIZE
@ SERIALIZED_SIZE
serialized size of port arguments
Definition: ComPortAc.hpp:31
Fw::CommandResponse
CommandResponse
Definition: CmdResponsePortAc.hpp:24
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::OutputLogPort::invoke
void invoke(FwEventIdType id, Fw::Time &timeTag, LogSeverity severity, LogBuffer &args)
Definition: LogPortAc.cpp:121
Fw::OutputCmdRegPort::addCallPort
void addCallPort(InputCmdRegPort *callPort)
Definition: CmdRegPortAc.cpp:93
Fw::LOG_WARNING_HI
@ LOG_WARNING_HI
Definition: LogPortAc.hpp:28
Svc::ComLoggerComponentBase::set_logOut_OutputPort
void set_logOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
Definition: ComLoggerComponentAc.cpp:132
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
Svc::ComLoggerComponentBase::get_cmdIn_InputPort
Fw::InputCmdPort * get_cmdIn_InputPort(NATIVE_INT_TYPE portNum)
Definition: ComLoggerComponentAc.cpp:94
Fw::SerializeBufferBase::serialize
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
Definition: Serializable.cpp:67
Fw::TEXT_LOG_DIAGNOSTIC
@ TEXT_LOG_DIAGNOSTIC
Definition: LogTextPortAc.hpp:33
Fw::LOG_WARNING_LO
@ LOG_WARNING_LO
Definition: LogPortAc.hpp:29
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::ComLoggerComponentBase::set_timeCaller_OutputPort
void set_timeCaller_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
Definition: ComLoggerComponentAc.cpp:112
U8
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.hpp:76
Svc::ComLoggerComponentBase::EVENTID_FILEVALIDATIONERROR
PROTECTED EVENTID_FILEVALIDATIONERROR
Definition: ComLoggerComponentAc.hpp:536
Svc::ComLoggerComponentBase::isConnected_pingOut_OutputPort
bool isConnected_pingOut_OutputPort(NATIVE_INT_TYPE portNum)
Definition: ComLoggerComponentAc.cpp:656
port2
BYTE port2[Svc::InputPingPort::SERIALIZED_SIZE]
Definition: ComLoggerComponentAc.cpp:41
Svc::InputPingPort::init
void init(void)
initialization function
Definition: PingPortAc.cpp:38
Svc::ComLoggerComponentBase::get_pingIn_InputPort
Svc::InputPingPort * get_pingIn_InputPort(NATIVE_INT_TYPE portNum)
Definition: ComLoggerComponentAc.cpp:101
Svc::ComLoggerComponentBase::m_p_cmdIn_in
static void m_p_cmdIn_in(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Definition: ComLoggerComponentAc.cpp:682
Svc::ComLoggerComponentBase::pingIn_handler
virtual void pingIn_handler(NATIVE_INT_TYPE portNum, U32 key)=0
Handler for input port pingIn.
Fw::InputCmdRegPort
Definition: CmdRegPortAc.hpp:27
Svc::OutputPingPort::init
void init(void)
Definition: PingPortAc.cpp:89
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
Fw::InputCmdPort::addCallComp
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
call to register a component
Definition: CmdPortAc.cpp:42
cmdPort
BYTE cmdPort[Fw::InputCmdPort::SERIALIZED_SIZE]
Definition: ComLoggerComponentAc.cpp:42
Svc::ComLoggerComponentBase::context
PROTECTED Fw::ComBuffer U32 context
Definition: ComLoggerComponentAc.hpp:243
Svc::ComLoggerComponentBase::getNum_pingIn_InputPorts
NATIVE_INT_TYPE getNum_pingIn_InputPorts(void)
Definition: ComLoggerComponentAc.cpp:586
port1
BYTE port1[Fw::InputComPort::SERIALIZED_SIZE]
Definition: ComLoggerComponentAc.cpp:40
Svc::OutputPingPort::invoke
void invoke(U32 key)
Definition: PingPortAc.cpp:103
Fw::TEXT_LOG_WARNING_HI
@ TEXT_LOG_WARNING_HI
Definition: LogTextPortAc.hpp:28
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
Fw::SerializeBufferBase::getBuffLeft
NATIVE_UINT_TYPE getBuffLeft() const
returns how much deserialization buffer is left
Definition: Serializable.cpp:619
Fw::InputCmdPort::init
void init(void)
initialization function
Definition: CmdPortAc.cpp:38
Fw::LogStringArg::toChar
const char * toChar(void) const
Definition: LogString.cpp:38
Fw::InputComPort
Definition: ComPortAc.hpp:28
Svc::OutputPingPort::addCallPort
void addCallPort(InputPingPort *callPort)
Definition: PingPortAc.cpp:93
EightyCharString.hpp
Svc::ComLoggerComponentBase::EVENTID_FILEWRITEERROR
PROTECTED EVENTID_FILEWRITEERROR
Definition: ComLoggerComponentAc.hpp:535
Fw::PassiveComponentBase
Definition: PassiveComponentBase.hpp:10
Fw::OutputLogPort::init
void init(void)
Definition: LogPortAc.cpp:107
Svc::ComLoggerComponentBase::data
PROTECTED Fw::ComBuffer & data
Definition: ComLoggerComponentAc.hpp:241
Fw::ObjBase::init
void init(void)
Object initializer.
Definition: ObjBase.cpp:26
Os::Queue::QueueBlocking
QueueBlocking
Definition: Queue.hpp:40
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
Fw::TEXT_LOG_WARNING_LO
@ TEXT_LOG_WARNING_LO
Definition: LogTextPortAc.hpp:29
Svc::InputPingPort
Definition: PingPortAc.hpp:27
Fw::OutputCmdRegPort::invoke
void invoke(FwOpcodeType opCode)
Definition: CmdRegPortAc.cpp:103
Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
Definition: ActiveComponentBase.hpp:27
ComLoggerComponentAc.hpp
Svc::ComLoggerComponentBase::regCommands
void regCommands(void)
Register commands with the Command Dispatcher.
Definition: ComLoggerComponentAc.cpp:248
Fw::LOG_DIAGNOSTIC
@ LOG_DIAGNOSTIC
Definition: LogPortAc.hpp:33
Svc::ComLoggerComponentBase::getNum_pingOut_OutputPorts
NATIVE_INT_TYPE getNum_pingOut_OutputPorts(void)
Definition: ComLoggerComponentAc.cpp:594
FwOpcodeType
#define FwOpcodeType
Type representation for a command opcode.
Definition: FpConfig.hpp:62
Fw::QueuedComponentBase::MsgDispatchStatus
MsgDispatchStatus
Definition: QueuedComponentBase.hpp:25
Svc::ComLoggerComponentBase
Auto-generated base for ComLogger component.
Definition: ComLoggerComponentAc.hpp:46
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
Svc::ComLoggerComponentBase::key
PROTECTED U32 key
Definition: ComLoggerComponentAc.hpp:311
Svc::ComLoggerComponentBase::log_WARNING_HI_FileWriteError
void log_WARNING_HI_FileWriteError(U32 errornum, U32 bytesWritten, U32 bytesToWrite, Fw::LogStringArg &file)
Definition: ComLoggerComponentAc.cpp:932
Fw::CmdArgBuffer
Definition: CmdArgBuffer.hpp:22
Fw::OutputCmdResponsePort::init
void init(void)
Definition: CmdResponsePortAc.cpp:101
Fw::COMMAND_INVALID_OPCODE
@ COMMAND_INVALID_OPCODE
Definition: CmdResponsePortAc.hpp:26
Svc::ComLoggerComponentBase::response
PROTECTED U32 Fw::CommandResponse response
Definition: ComLoggerComponentAc.hpp:525
FW_ASSERT
#define FW_ASSERT(...)
Definition: Assert.hpp:9
Svc::ComLoggerComponentBase::getNum_cmdResponseOut_OutputPorts
NATIVE_INT_TYPE getNum_cmdResponseOut_OutputPorts(void)
Definition: ComLoggerComponentAc.cpp:578
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
Os::Queue::QUEUE_OK
@ QUEUE_OK
message sent/received okay
Definition: Queue.hpp:28
Svc::ComLoggerComponentBase::log_DIAGNOSTIC_FileClosed
void log_DIAGNOSTIC_FileClosed(Fw::LogStringArg &file)
Definition: ComLoggerComponentAc.cpp:1188
Svc::ComLoggerComponentBase::isConnected_cmdResponseOut_OutputPort
bool isConnected_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum)
Definition: ComLoggerComponentAc.cpp:646
Fw::LogStringArg::setMaxSerialize
void setMaxSerialize(NATIVE_UINT_TYPE size)
Definition: LogString.cpp:106
Svc::ComLoggerComponentBase::~ComLoggerComponentBase
virtual ~ComLoggerComponentBase(void)
Definition: ComLoggerComponentAc.cpp:515
Fw::InputCmdPort
Definition: CmdPortAc.hpp:28
Svc::ComLoggerComponentBase::isConnected_logOut_OutputPort
bool isConnected_logOut_OutputPort(NATIVE_INT_TYPE portNum)
Definition: ComLoggerComponentAc.cpp:636
Svc::ComLoggerComponentBase::m_p_pingIn_in
static void m_p_pingIn_in(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, U32 key)
Definition: ComLoggerComponentAc.cpp:1293
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
Fw::QueuedComponentBase::MSG_DISPATCH_EXIT
@ MSG_DISPATCH_EXIT
A message was sent requesting an exit of the loop.
Definition: QueuedComponentBase.hpp:29
Svc::ComLoggerComponentBase::isConnected_cmdRegOut_OutputPort
bool isConnected_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum)
Definition: ComLoggerComponentAc.cpp:626
Svc
Definition: ActiveLoggerComponentAc.cpp:22
Os::Queue::QUEUE_NONBLOCKING
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
Definition: Queue.hpp:42
Svc::ComLoggerComponentBase::get_comIn_InputPort
Fw::InputComPort * get_comIn_InputPort(NATIVE_INT_TYPE portNum)
Definition: ComLoggerComponentAc.cpp:87
Fw::InputCmdResponsePort
Definition: CmdResponsePortAc.hpp:37
Svc::ComLoggerComponentBase::set_pingOut_OutputPort
void set_pingOut_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputPingPort *port)
Definition: ComLoggerComponentAc.cpp:152
Svc::ComLoggerComponentBase::cmdSeq
PROTECTED U32 cmdSeq
Definition: ComLoggerComponentAc.hpp:479
Fw::InputLogPort
Definition: LogPortAc.hpp:40
Svc::ComLoggerComponentBase::m_pingOut_OutputPort
Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS]
Definition: ComLoggerComponentAc.hpp:639
Svc::ComLoggerComponentBase::pingIn_preMsgHook
virtual void pingIn_preMsgHook(NATIVE_INT_TYPE portNum, U32 key)
Definition: ComLoggerComponentAc.cpp:1436
Svc::ComLoggerComponentBase::log_WARNING_LO_FileValidationError
void log_WARNING_LO_FileValidationError(Fw::LogStringArg &validationFile, Fw::LogStringArg &file, U32 status)
Definition: ComLoggerComponentAc.cpp:1074
Svc::ComLoggerComponentBase::file
PROTECTED Fw::LogStringArg & file
Definition: ComLoggerComponentAc.hpp:552
FwEventIdType
#define FwEventIdType
Type representation for a event id.
Definition: FpConfig.hpp:70
Svc::ComLoggerComponentBase::m_cmdRegOut_OutputPort
Fw::OutputCmdRegPort m_cmdRegOut_OutputPort[NUM_CMDREGOUT_OUTPUT_PORTS]
Definition: ComLoggerComponentAc.hpp:627
Svc::ComLoggerComponentBase::EVENTID_FILECLOSED
PROTECTED EVENTID_FILECLOSED
Definition: ComLoggerComponentAc.hpp:537
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
AssertArg
#define AssertArg
Definition: FpConfig.hpp:51
Fw::ComBuffer
Definition: ComBuffer.hpp:21
Svc::ComLoggerComponentBase::m_logOut_OutputPort
Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS]
Definition: ComLoggerComponentAc.hpp:631
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
Fw
Definition: BufferGetPortAc.cpp:6
Svc::ComLoggerComponentBase::set_cmdRegOut_OutputPort
void set_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdRegPort *port)
Definition: ComLoggerComponentAc.cpp:122
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::ComLoggerComponentBase::getNum_cmdRegOut_OutputPorts
NATIVE_INT_TYPE getNum_cmdRegOut_OutputPorts(void)
Definition: ComLoggerComponentAc.cpp:554
Svc::InputPingPort::addCallComp
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
call to register a component
Definition: PingPortAc.cpp:42