F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
AssertFatalAdapterComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title AssertFatalAdapterComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for AssertFatalAdapter component base class
5 // ======================================================================
6 
7 #include <cstdio>
8 
10 #include "Fw/Types/Assert.hpp"
11 #if FW_ENABLE_TEXT_LOGGING
12 #include "Fw/Types/String.hpp"
13 #endif
14 
15 namespace Svc {
16 
17  // ----------------------------------------------------------------------
18  // Component initialization
19  // ----------------------------------------------------------------------
20 
22  init(NATIVE_INT_TYPE instance)
23  {
24  // Initialize base class
26 
27  // Connect output port Log
28  for (
29  PlatformIntType port = 0;
30  port < static_cast<PlatformIntType>(this->getNum_Log_OutputPorts());
31  port++
32  ) {
33  this->m_Log_OutputPort[port].init();
34 
35 #if FW_OBJECT_NAMES == 1
36  // The port name consists of this->m_objName and some extra info.
37  // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
38  // However, the compiler may assume that this->m_objName fills
39  // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
40  // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
41  // bytes to cover the extra info.
42  char portName[2*FW_OBJ_NAME_MAX_SIZE];
43  (void) snprintf(
44  portName,
45  sizeof(portName),
46  "%s_Log_OutputPort[%" PRI_PlatformIntType "]",
47  this->m_objName,
48  port
49  );
50  this->m_Log_OutputPort[port].setObjName(portName);
51 #endif
52  }
53 
54 #if FW_ENABLE_TEXT_LOGGING == 1
55  // Connect output port LogText
56  for (
57  PlatformIntType port = 0;
58  port < static_cast<PlatformIntType>(this->getNum_LogText_OutputPorts());
59  port++
60  ) {
61  this->m_LogText_OutputPort[port].init();
62 
63 #if FW_OBJECT_NAMES == 1
64  // The port name consists of this->m_objName and some extra info.
65  // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
66  // However, the compiler may assume that this->m_objName fills
67  // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
68  // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
69  // bytes to cover the extra info.
70  char portName[2*FW_OBJ_NAME_MAX_SIZE];
71  (void) snprintf(
72  portName,
73  sizeof(portName),
74  "%s_LogText_OutputPort[%" PRI_PlatformIntType "]",
75  this->m_objName,
76  port
77  );
78  this->m_LogText_OutputPort[port].setObjName(portName);
79 #endif
80  }
81 #endif
82 
83  // Connect output port Time
84  for (
85  PlatformIntType port = 0;
86  port < static_cast<PlatformIntType>(this->getNum_Time_OutputPorts());
87  port++
88  ) {
89  this->m_Time_OutputPort[port].init();
90 
91 #if FW_OBJECT_NAMES == 1
92  // The port name consists of this->m_objName and some extra info.
93  // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
94  // However, the compiler may assume that this->m_objName fills
95  // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
96  // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
97  // bytes to cover the extra info.
98  char portName[2*FW_OBJ_NAME_MAX_SIZE];
99  (void) snprintf(
100  portName,
101  sizeof(portName),
102  "%s_Time_OutputPort[%" PRI_PlatformIntType "]",
103  this->m_objName,
104  port
105  );
106  this->m_Time_OutputPort[port].setObjName(portName);
107 #endif
108  }
109  }
110 
111  // ----------------------------------------------------------------------
112  // Connect input ports to special output ports
113  // ----------------------------------------------------------------------
114 
117  NATIVE_INT_TYPE portNum,
118  Fw::InputLogPort* port
119  )
120  {
121  FW_ASSERT(
122  portNum < this->getNum_Log_OutputPorts(),
123  static_cast<FwAssertArgType>(portNum)
124  );
125 
126  this->m_Log_OutputPort[portNum].addCallPort(port);
127  }
128 
129 #if FW_ENABLE_TEXT_LOGGING == 1
130 
131  void AssertFatalAdapterComponentBase ::
132  set_LogText_OutputPort(
133  NATIVE_INT_TYPE portNum,
135  )
136  {
137  FW_ASSERT(
138  portNum < this->getNum_LogText_OutputPorts(),
139  static_cast<FwAssertArgType>(portNum)
140  );
141 
142  this->m_LogText_OutputPort[portNum].addCallPort(port);
143  }
144 
145 #endif
146 
149  NATIVE_INT_TYPE portNum,
150  Fw::InputTimePort* port
151  )
152  {
153  FW_ASSERT(
154  portNum < this->getNum_Time_OutputPorts(),
155  static_cast<FwAssertArgType>(portNum)
156  );
157 
158  this->m_Time_OutputPort[portNum].addCallPort(port);
159  }
160 
161 #if FW_PORT_SERIALIZATION
162 
163  // ----------------------------------------------------------------------
164  // Connect serial input ports to special output ports
165  // ----------------------------------------------------------------------
166 
169  NATIVE_INT_TYPE portNum,
170  Fw::InputSerializePort* port
171  )
172  {
173  FW_ASSERT(
174  portNum < this->getNum_Log_OutputPorts(),
175  static_cast<FwAssertArgType>(portNum)
176  );
177 
178  this->m_Log_OutputPort[portNum].registerSerialPort(port);
179  }
180 
181 #if FW_ENABLE_TEXT_LOGGING == 1
182 
183  void AssertFatalAdapterComponentBase ::
184  set_LogText_OutputPort(
185  NATIVE_INT_TYPE portNum,
186  Fw::InputSerializePort* port
187  )
188  {
189  FW_ASSERT(
190  portNum < this->getNum_LogText_OutputPorts(),
191  static_cast<FwAssertArgType>(portNum)
192  );
193 
194  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
195  }
196 
197 #endif
198 
201  NATIVE_INT_TYPE portNum,
202  Fw::InputSerializePort* port
203  )
204  {
205  FW_ASSERT(
206  portNum < this->getNum_Time_OutputPorts(),
207  static_cast<FwAssertArgType>(portNum)
208  );
209 
210  this->m_Time_OutputPort[portNum].registerSerialPort(port);
211  }
212 
213 #endif
214 
215  // ----------------------------------------------------------------------
216  // Component construction and destruction
217  // ----------------------------------------------------------------------
218 
220  AssertFatalAdapterComponentBase(const char* compName) :
221  Fw::PassiveComponentBase(compName)
222  {
223 
224  }
225 
228  {
229 
230  }
231 
232  // ----------------------------------------------------------------------
233  // Getters for numbers of special output ports
234  // ----------------------------------------------------------------------
235 
238  {
239  return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_Log_OutputPort));
240  }
241 
242 #if FW_ENABLE_TEXT_LOGGING == 1
243 
244  NATIVE_INT_TYPE AssertFatalAdapterComponentBase ::
245  getNum_LogText_OutputPorts() const
246  {
247  return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
248  }
249 
250 #endif
251 
254  {
255  return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_Time_OutputPort));
256  }
257 
258  // ----------------------------------------------------------------------
259  // Connection status queries for special output ports
260  // ----------------------------------------------------------------------
261 
264  {
265  FW_ASSERT(
266  portNum < this->getNum_Log_OutputPorts(),
267  static_cast<FwAssertArgType>(portNum)
268  );
269 
270  return this->m_Log_OutputPort[portNum].isConnected();
271  }
272 
273 #if FW_ENABLE_TEXT_LOGGING == 1
274 
275  bool AssertFatalAdapterComponentBase ::
276  isConnected_LogText_OutputPort(NATIVE_INT_TYPE portNum)
277  {
278  FW_ASSERT(
279  portNum < this->getNum_LogText_OutputPorts(),
280  static_cast<FwAssertArgType>(portNum)
281  );
282 
283  return this->m_LogText_OutputPort[portNum].isConnected();
284  }
285 
286 #endif
287 
290  {
291  FW_ASSERT(
292  portNum < this->getNum_Time_OutputPorts(),
293  static_cast<FwAssertArgType>(portNum)
294  );
295 
296  return this->m_Time_OutputPort[portNum].isConnected();
297  }
298 
299  // ----------------------------------------------------------------------
300  // Event logging functions
301  // ----------------------------------------------------------------------
302 
305  const Fw::LogStringArg& file,
306  U32 line
307  )
308  {
309  // Get the time
310  Fw::Time _logTime;
311  if (this->m_Time_OutputPort[0].isConnected()) {
312  this->m_Time_OutputPort[0].invoke(_logTime);
313  }
314 
315  FwEventIdType _id = static_cast<FwEventIdType>(0);
316 
317  _id = this->getIdBase() + EVENTID_AF_ASSERT_0;
318 
319  // Emit the event on the log port
320  if (this->m_Log_OutputPort[0].isConnected()) {
321  Fw::LogBuffer _logBuff;
323 
324 #if FW_AMPCS_COMPATIBLE
325  // Serialize the number of arguments
326  _status = _logBuff.serialize(static_cast<U8>(2 + 1));
327  FW_ASSERT(
328  _status == Fw::FW_SERIALIZE_OK,
329  static_cast<FwAssertArgType>(_status)
330  );
331 
332  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
333  _status = _logBuff.serialize(static_cast<U8>(4));
334  FW_ASSERT(
335  _status == Fw::FW_SERIALIZE_OK,
336  static_cast<FwAssertArgType>(_status)
337  );
338 
339  _status = _logBuff.serialize(static_cast<U32>(0));
340  FW_ASSERT(
341  _status == Fw::FW_SERIALIZE_OK,
342  static_cast<FwAssertArgType>(_status)
343  );
344 #endif
345 
346  _status = file.serialize(_logBuff, 80);
347  FW_ASSERT(
348  _status == Fw::FW_SERIALIZE_OK,
349  static_cast<FwAssertArgType>(_status)
350  );
351 
352 #if FW_AMPCS_COMPATIBLE
353  // Serialize the argument size
354  _status = _logBuff.serialize(
355  static_cast<U8>(sizeof(U32))
356  );
357  FW_ASSERT(
358  _status == Fw::FW_SERIALIZE_OK,
359  static_cast<FwAssertArgType>(_status)
360  );
361 #endif
362  _status = _logBuff.serialize(line);
363  FW_ASSERT(
364  _status == Fw::FW_SERIALIZE_OK,
365  static_cast<FwAssertArgType>(_status)
366  );
367 
368  this->m_Log_OutputPort[0].invoke(
369  _id,
370  _logTime,
372  _logBuff
373  );
374  }
375 
376  // Emit the event on the text log port
377 #if FW_ENABLE_TEXT_LOGGING
378  if (this->m_LogText_OutputPort[0].isConnected()) {
379 #if FW_OBJECT_NAMES == 1
380  const char* _formatString =
381  "(%s) %s: Assert in file %s, line %" PRIu32 "";
382 #else
383  const char* _formatString =
384  "%s: Assert in file %s, line %" PRIu32 "";
385 #endif
386 
387  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
388 
389  (void) snprintf(
390  _textBuffer,
392  _formatString,
393 #if FW_OBJECT_NAMES == 1
394  this->m_objName,
395 #endif
396  "AF_ASSERT_0 ",
397  file.toChar(),
398  line
399  );
400 
401  // Null terminate
402  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
403  Fw::TextLogString _logString = _textBuffer;
404  this->m_LogText_OutputPort[0].invoke(
405  _id,
406  _logTime,
408  _logString
409  );
410  }
411 #endif
412  }
413 
416  const Fw::LogStringArg& file,
417  U32 line,
418  U32 arg1
419  )
420  {
421  // Get the time
422  Fw::Time _logTime;
423  if (this->m_Time_OutputPort[0].isConnected()) {
424  this->m_Time_OutputPort[0].invoke(_logTime);
425  }
426 
427  FwEventIdType _id = static_cast<FwEventIdType>(0);
428 
429  _id = this->getIdBase() + EVENTID_AF_ASSERT_1;
430 
431  // Emit the event on the log port
432  if (this->m_Log_OutputPort[0].isConnected()) {
433  Fw::LogBuffer _logBuff;
435 
436 #if FW_AMPCS_COMPATIBLE
437  // Serialize the number of arguments
438  _status = _logBuff.serialize(static_cast<U8>(3 + 1));
439  FW_ASSERT(
440  _status == Fw::FW_SERIALIZE_OK,
441  static_cast<FwAssertArgType>(_status)
442  );
443 
444  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
445  _status = _logBuff.serialize(static_cast<U8>(4));
446  FW_ASSERT(
447  _status == Fw::FW_SERIALIZE_OK,
448  static_cast<FwAssertArgType>(_status)
449  );
450 
451  _status = _logBuff.serialize(static_cast<U32>(0));
452  FW_ASSERT(
453  _status == Fw::FW_SERIALIZE_OK,
454  static_cast<FwAssertArgType>(_status)
455  );
456 #endif
457 
458  _status = file.serialize(_logBuff, 80);
459  FW_ASSERT(
460  _status == Fw::FW_SERIALIZE_OK,
461  static_cast<FwAssertArgType>(_status)
462  );
463 
464 #if FW_AMPCS_COMPATIBLE
465  // Serialize the argument size
466  _status = _logBuff.serialize(
467  static_cast<U8>(sizeof(U32))
468  );
469  FW_ASSERT(
470  _status == Fw::FW_SERIALIZE_OK,
471  static_cast<FwAssertArgType>(_status)
472  );
473 #endif
474  _status = _logBuff.serialize(line);
475  FW_ASSERT(
476  _status == Fw::FW_SERIALIZE_OK,
477  static_cast<FwAssertArgType>(_status)
478  );
479 
480 #if FW_AMPCS_COMPATIBLE
481  // Serialize the argument size
482  _status = _logBuff.serialize(
483  static_cast<U8>(sizeof(U32))
484  );
485  FW_ASSERT(
486  _status == Fw::FW_SERIALIZE_OK,
487  static_cast<FwAssertArgType>(_status)
488  );
489 #endif
490  _status = _logBuff.serialize(arg1);
491  FW_ASSERT(
492  _status == Fw::FW_SERIALIZE_OK,
493  static_cast<FwAssertArgType>(_status)
494  );
495 
496  this->m_Log_OutputPort[0].invoke(
497  _id,
498  _logTime,
500  _logBuff
501  );
502  }
503 
504  // Emit the event on the text log port
505 #if FW_ENABLE_TEXT_LOGGING
506  if (this->m_LogText_OutputPort[0].isConnected()) {
507 #if FW_OBJECT_NAMES == 1
508  const char* _formatString =
509  "(%s) %s: Assert in file %s, line %" PRIu32 ": %" PRIu32 "";
510 #else
511  const char* _formatString =
512  "%s: Assert in file %s, line %" PRIu32 ": %" PRIu32 "";
513 #endif
514 
515  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
516 
517  (void) snprintf(
518  _textBuffer,
520  _formatString,
521 #if FW_OBJECT_NAMES == 1
522  this->m_objName,
523 #endif
524  "AF_ASSERT_1 ",
525  file.toChar(),
526  line,
527  arg1
528  );
529 
530  // Null terminate
531  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
532  Fw::TextLogString _logString = _textBuffer;
533  this->m_LogText_OutputPort[0].invoke(
534  _id,
535  _logTime,
537  _logString
538  );
539  }
540 #endif
541  }
542 
545  const Fw::LogStringArg& file,
546  U32 line,
547  U32 arg1,
548  U32 arg2
549  )
550  {
551  // Get the time
552  Fw::Time _logTime;
553  if (this->m_Time_OutputPort[0].isConnected()) {
554  this->m_Time_OutputPort[0].invoke(_logTime);
555  }
556 
557  FwEventIdType _id = static_cast<FwEventIdType>(0);
558 
559  _id = this->getIdBase() + EVENTID_AF_ASSERT_2;
560 
561  // Emit the event on the log port
562  if (this->m_Log_OutputPort[0].isConnected()) {
563  Fw::LogBuffer _logBuff;
565 
566 #if FW_AMPCS_COMPATIBLE
567  // Serialize the number of arguments
568  _status = _logBuff.serialize(static_cast<U8>(4 + 1));
569  FW_ASSERT(
570  _status == Fw::FW_SERIALIZE_OK,
571  static_cast<FwAssertArgType>(_status)
572  );
573 
574  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
575  _status = _logBuff.serialize(static_cast<U8>(4));
576  FW_ASSERT(
577  _status == Fw::FW_SERIALIZE_OK,
578  static_cast<FwAssertArgType>(_status)
579  );
580 
581  _status = _logBuff.serialize(static_cast<U32>(0));
582  FW_ASSERT(
583  _status == Fw::FW_SERIALIZE_OK,
584  static_cast<FwAssertArgType>(_status)
585  );
586 #endif
587 
588  _status = file.serialize(_logBuff, 80);
589  FW_ASSERT(
590  _status == Fw::FW_SERIALIZE_OK,
591  static_cast<FwAssertArgType>(_status)
592  );
593 
594 #if FW_AMPCS_COMPATIBLE
595  // Serialize the argument size
596  _status = _logBuff.serialize(
597  static_cast<U8>(sizeof(U32))
598  );
599  FW_ASSERT(
600  _status == Fw::FW_SERIALIZE_OK,
601  static_cast<FwAssertArgType>(_status)
602  );
603 #endif
604  _status = _logBuff.serialize(line);
605  FW_ASSERT(
606  _status == Fw::FW_SERIALIZE_OK,
607  static_cast<FwAssertArgType>(_status)
608  );
609 
610 #if FW_AMPCS_COMPATIBLE
611  // Serialize the argument size
612  _status = _logBuff.serialize(
613  static_cast<U8>(sizeof(U32))
614  );
615  FW_ASSERT(
616  _status == Fw::FW_SERIALIZE_OK,
617  static_cast<FwAssertArgType>(_status)
618  );
619 #endif
620  _status = _logBuff.serialize(arg1);
621  FW_ASSERT(
622  _status == Fw::FW_SERIALIZE_OK,
623  static_cast<FwAssertArgType>(_status)
624  );
625 
626 #if FW_AMPCS_COMPATIBLE
627  // Serialize the argument size
628  _status = _logBuff.serialize(
629  static_cast<U8>(sizeof(U32))
630  );
631  FW_ASSERT(
632  _status == Fw::FW_SERIALIZE_OK,
633  static_cast<FwAssertArgType>(_status)
634  );
635 #endif
636  _status = _logBuff.serialize(arg2);
637  FW_ASSERT(
638  _status == Fw::FW_SERIALIZE_OK,
639  static_cast<FwAssertArgType>(_status)
640  );
641 
642  this->m_Log_OutputPort[0].invoke(
643  _id,
644  _logTime,
646  _logBuff
647  );
648  }
649 
650  // Emit the event on the text log port
651 #if FW_ENABLE_TEXT_LOGGING
652  if (this->m_LogText_OutputPort[0].isConnected()) {
653 #if FW_OBJECT_NAMES == 1
654  const char* _formatString =
655  "(%s) %s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 "";
656 #else
657  const char* _formatString =
658  "%s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 "";
659 #endif
660 
661  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
662 
663  (void) snprintf(
664  _textBuffer,
666  _formatString,
667 #if FW_OBJECT_NAMES == 1
668  this->m_objName,
669 #endif
670  "AF_ASSERT_2 ",
671  file.toChar(),
672  line,
673  arg1,
674  arg2
675  );
676 
677  // Null terminate
678  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
679  Fw::TextLogString _logString = _textBuffer;
680  this->m_LogText_OutputPort[0].invoke(
681  _id,
682  _logTime,
684  _logString
685  );
686  }
687 #endif
688  }
689 
692  const Fw::LogStringArg& file,
693  U32 line,
694  U32 arg1,
695  U32 arg2,
696  U32 arg3
697  )
698  {
699  // Get the time
700  Fw::Time _logTime;
701  if (this->m_Time_OutputPort[0].isConnected()) {
702  this->m_Time_OutputPort[0].invoke(_logTime);
703  }
704 
705  FwEventIdType _id = static_cast<FwEventIdType>(0);
706 
707  _id = this->getIdBase() + EVENTID_AF_ASSERT_3;
708 
709  // Emit the event on the log port
710  if (this->m_Log_OutputPort[0].isConnected()) {
711  Fw::LogBuffer _logBuff;
713 
714 #if FW_AMPCS_COMPATIBLE
715  // Serialize the number of arguments
716  _status = _logBuff.serialize(static_cast<U8>(5 + 1));
717  FW_ASSERT(
718  _status == Fw::FW_SERIALIZE_OK,
719  static_cast<FwAssertArgType>(_status)
720  );
721 
722  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
723  _status = _logBuff.serialize(static_cast<U8>(4));
724  FW_ASSERT(
725  _status == Fw::FW_SERIALIZE_OK,
726  static_cast<FwAssertArgType>(_status)
727  );
728 
729  _status = _logBuff.serialize(static_cast<U32>(0));
730  FW_ASSERT(
731  _status == Fw::FW_SERIALIZE_OK,
732  static_cast<FwAssertArgType>(_status)
733  );
734 #endif
735 
736  _status = file.serialize(_logBuff, 80);
737  FW_ASSERT(
738  _status == Fw::FW_SERIALIZE_OK,
739  static_cast<FwAssertArgType>(_status)
740  );
741 
742 #if FW_AMPCS_COMPATIBLE
743  // Serialize the argument size
744  _status = _logBuff.serialize(
745  static_cast<U8>(sizeof(U32))
746  );
747  FW_ASSERT(
748  _status == Fw::FW_SERIALIZE_OK,
749  static_cast<FwAssertArgType>(_status)
750  );
751 #endif
752  _status = _logBuff.serialize(line);
753  FW_ASSERT(
754  _status == Fw::FW_SERIALIZE_OK,
755  static_cast<FwAssertArgType>(_status)
756  );
757 
758 #if FW_AMPCS_COMPATIBLE
759  // Serialize the argument size
760  _status = _logBuff.serialize(
761  static_cast<U8>(sizeof(U32))
762  );
763  FW_ASSERT(
764  _status == Fw::FW_SERIALIZE_OK,
765  static_cast<FwAssertArgType>(_status)
766  );
767 #endif
768  _status = _logBuff.serialize(arg1);
769  FW_ASSERT(
770  _status == Fw::FW_SERIALIZE_OK,
771  static_cast<FwAssertArgType>(_status)
772  );
773 
774 #if FW_AMPCS_COMPATIBLE
775  // Serialize the argument size
776  _status = _logBuff.serialize(
777  static_cast<U8>(sizeof(U32))
778  );
779  FW_ASSERT(
780  _status == Fw::FW_SERIALIZE_OK,
781  static_cast<FwAssertArgType>(_status)
782  );
783 #endif
784  _status = _logBuff.serialize(arg2);
785  FW_ASSERT(
786  _status == Fw::FW_SERIALIZE_OK,
787  static_cast<FwAssertArgType>(_status)
788  );
789 
790 #if FW_AMPCS_COMPATIBLE
791  // Serialize the argument size
792  _status = _logBuff.serialize(
793  static_cast<U8>(sizeof(U32))
794  );
795  FW_ASSERT(
796  _status == Fw::FW_SERIALIZE_OK,
797  static_cast<FwAssertArgType>(_status)
798  );
799 #endif
800  _status = _logBuff.serialize(arg3);
801  FW_ASSERT(
802  _status == Fw::FW_SERIALIZE_OK,
803  static_cast<FwAssertArgType>(_status)
804  );
805 
806  this->m_Log_OutputPort[0].invoke(
807  _id,
808  _logTime,
810  _logBuff
811  );
812  }
813 
814  // Emit the event on the text log port
815 #if FW_ENABLE_TEXT_LOGGING
816  if (this->m_LogText_OutputPort[0].isConnected()) {
817 #if FW_OBJECT_NAMES == 1
818  const char* _formatString =
819  "(%s) %s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 "";
820 #else
821  const char* _formatString =
822  "%s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 "";
823 #endif
824 
825  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
826 
827  (void) snprintf(
828  _textBuffer,
830  _formatString,
831 #if FW_OBJECT_NAMES == 1
832  this->m_objName,
833 #endif
834  "AF_ASSERT_3 ",
835  file.toChar(),
836  line,
837  arg1,
838  arg2,
839  arg3
840  );
841 
842  // Null terminate
843  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
844  Fw::TextLogString _logString = _textBuffer;
845  this->m_LogText_OutputPort[0].invoke(
846  _id,
847  _logTime,
849  _logString
850  );
851  }
852 #endif
853  }
854 
857  const Fw::LogStringArg& file,
858  U32 line,
859  U32 arg1,
860  U32 arg2,
861  U32 arg3,
862  U32 arg4
863  )
864  {
865  // Get the time
866  Fw::Time _logTime;
867  if (this->m_Time_OutputPort[0].isConnected()) {
868  this->m_Time_OutputPort[0].invoke(_logTime);
869  }
870 
871  FwEventIdType _id = static_cast<FwEventIdType>(0);
872 
873  _id = this->getIdBase() + EVENTID_AF_ASSERT_4;
874 
875  // Emit the event on the log port
876  if (this->m_Log_OutputPort[0].isConnected()) {
877  Fw::LogBuffer _logBuff;
879 
880 #if FW_AMPCS_COMPATIBLE
881  // Serialize the number of arguments
882  _status = _logBuff.serialize(static_cast<U8>(6 + 1));
883  FW_ASSERT(
884  _status == Fw::FW_SERIALIZE_OK,
885  static_cast<FwAssertArgType>(_status)
886  );
887 
888  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
889  _status = _logBuff.serialize(static_cast<U8>(4));
890  FW_ASSERT(
891  _status == Fw::FW_SERIALIZE_OK,
892  static_cast<FwAssertArgType>(_status)
893  );
894 
895  _status = _logBuff.serialize(static_cast<U32>(0));
896  FW_ASSERT(
897  _status == Fw::FW_SERIALIZE_OK,
898  static_cast<FwAssertArgType>(_status)
899  );
900 #endif
901 
902  _status = file.serialize(_logBuff, 80);
903  FW_ASSERT(
904  _status == Fw::FW_SERIALIZE_OK,
905  static_cast<FwAssertArgType>(_status)
906  );
907 
908 #if FW_AMPCS_COMPATIBLE
909  // Serialize the argument size
910  _status = _logBuff.serialize(
911  static_cast<U8>(sizeof(U32))
912  );
913  FW_ASSERT(
914  _status == Fw::FW_SERIALIZE_OK,
915  static_cast<FwAssertArgType>(_status)
916  );
917 #endif
918  _status = _logBuff.serialize(line);
919  FW_ASSERT(
920  _status == Fw::FW_SERIALIZE_OK,
921  static_cast<FwAssertArgType>(_status)
922  );
923 
924 #if FW_AMPCS_COMPATIBLE
925  // Serialize the argument size
926  _status = _logBuff.serialize(
927  static_cast<U8>(sizeof(U32))
928  );
929  FW_ASSERT(
930  _status == Fw::FW_SERIALIZE_OK,
931  static_cast<FwAssertArgType>(_status)
932  );
933 #endif
934  _status = _logBuff.serialize(arg1);
935  FW_ASSERT(
936  _status == Fw::FW_SERIALIZE_OK,
937  static_cast<FwAssertArgType>(_status)
938  );
939 
940 #if FW_AMPCS_COMPATIBLE
941  // Serialize the argument size
942  _status = _logBuff.serialize(
943  static_cast<U8>(sizeof(U32))
944  );
945  FW_ASSERT(
946  _status == Fw::FW_SERIALIZE_OK,
947  static_cast<FwAssertArgType>(_status)
948  );
949 #endif
950  _status = _logBuff.serialize(arg2);
951  FW_ASSERT(
952  _status == Fw::FW_SERIALIZE_OK,
953  static_cast<FwAssertArgType>(_status)
954  );
955 
956 #if FW_AMPCS_COMPATIBLE
957  // Serialize the argument size
958  _status = _logBuff.serialize(
959  static_cast<U8>(sizeof(U32))
960  );
961  FW_ASSERT(
962  _status == Fw::FW_SERIALIZE_OK,
963  static_cast<FwAssertArgType>(_status)
964  );
965 #endif
966  _status = _logBuff.serialize(arg3);
967  FW_ASSERT(
968  _status == Fw::FW_SERIALIZE_OK,
969  static_cast<FwAssertArgType>(_status)
970  );
971 
972 #if FW_AMPCS_COMPATIBLE
973  // Serialize the argument size
974  _status = _logBuff.serialize(
975  static_cast<U8>(sizeof(U32))
976  );
977  FW_ASSERT(
978  _status == Fw::FW_SERIALIZE_OK,
979  static_cast<FwAssertArgType>(_status)
980  );
981 #endif
982  _status = _logBuff.serialize(arg4);
983  FW_ASSERT(
984  _status == Fw::FW_SERIALIZE_OK,
985  static_cast<FwAssertArgType>(_status)
986  );
987 
988  this->m_Log_OutputPort[0].invoke(
989  _id,
990  _logTime,
992  _logBuff
993  );
994  }
995 
996  // Emit the event on the text log port
997 #if FW_ENABLE_TEXT_LOGGING
998  if (this->m_LogText_OutputPort[0].isConnected()) {
999 #if FW_OBJECT_NAMES == 1
1000  const char* _formatString =
1001  "(%s) %s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "";
1002 #else
1003  const char* _formatString =
1004  "%s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "";
1005 #endif
1006 
1007  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1008 
1009  (void) snprintf(
1010  _textBuffer,
1012  _formatString,
1013 #if FW_OBJECT_NAMES == 1
1014  this->m_objName,
1015 #endif
1016  "AF_ASSERT_4 ",
1017  file.toChar(),
1018  line,
1019  arg1,
1020  arg2,
1021  arg3,
1022  arg4
1023  );
1024 
1025  // Null terminate
1026  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1027  Fw::TextLogString _logString = _textBuffer;
1028  this->m_LogText_OutputPort[0].invoke(
1029  _id,
1030  _logTime,
1032  _logString
1033  );
1034  }
1035 #endif
1036  }
1037 
1040  const Fw::LogStringArg& file,
1041  U32 line,
1042  U32 arg1,
1043  U32 arg2,
1044  U32 arg3,
1045  U32 arg4,
1046  U32 arg5
1047  )
1048  {
1049  // Get the time
1050  Fw::Time _logTime;
1051  if (this->m_Time_OutputPort[0].isConnected()) {
1052  this->m_Time_OutputPort[0].invoke(_logTime);
1053  }
1054 
1055  FwEventIdType _id = static_cast<FwEventIdType>(0);
1056 
1057  _id = this->getIdBase() + EVENTID_AF_ASSERT_5;
1058 
1059  // Emit the event on the log port
1060  if (this->m_Log_OutputPort[0].isConnected()) {
1061  Fw::LogBuffer _logBuff;
1063 
1064 #if FW_AMPCS_COMPATIBLE
1065  // Serialize the number of arguments
1066  _status = _logBuff.serialize(static_cast<U8>(7 + 1));
1067  FW_ASSERT(
1068  _status == Fw::FW_SERIALIZE_OK,
1069  static_cast<FwAssertArgType>(_status)
1070  );
1071 
1072  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
1073  _status = _logBuff.serialize(static_cast<U8>(4));
1074  FW_ASSERT(
1075  _status == Fw::FW_SERIALIZE_OK,
1076  static_cast<FwAssertArgType>(_status)
1077  );
1078 
1079  _status = _logBuff.serialize(static_cast<U32>(0));
1080  FW_ASSERT(
1081  _status == Fw::FW_SERIALIZE_OK,
1082  static_cast<FwAssertArgType>(_status)
1083  );
1084 #endif
1085 
1086  _status = file.serialize(_logBuff, 80);
1087  FW_ASSERT(
1088  _status == Fw::FW_SERIALIZE_OK,
1089  static_cast<FwAssertArgType>(_status)
1090  );
1091 
1092 #if FW_AMPCS_COMPATIBLE
1093  // Serialize the argument size
1094  _status = _logBuff.serialize(
1095  static_cast<U8>(sizeof(U32))
1096  );
1097  FW_ASSERT(
1098  _status == Fw::FW_SERIALIZE_OK,
1099  static_cast<FwAssertArgType>(_status)
1100  );
1101 #endif
1102  _status = _logBuff.serialize(line);
1103  FW_ASSERT(
1104  _status == Fw::FW_SERIALIZE_OK,
1105  static_cast<FwAssertArgType>(_status)
1106  );
1107 
1108 #if FW_AMPCS_COMPATIBLE
1109  // Serialize the argument size
1110  _status = _logBuff.serialize(
1111  static_cast<U8>(sizeof(U32))
1112  );
1113  FW_ASSERT(
1114  _status == Fw::FW_SERIALIZE_OK,
1115  static_cast<FwAssertArgType>(_status)
1116  );
1117 #endif
1118  _status = _logBuff.serialize(arg1);
1119  FW_ASSERT(
1120  _status == Fw::FW_SERIALIZE_OK,
1121  static_cast<FwAssertArgType>(_status)
1122  );
1123 
1124 #if FW_AMPCS_COMPATIBLE
1125  // Serialize the argument size
1126  _status = _logBuff.serialize(
1127  static_cast<U8>(sizeof(U32))
1128  );
1129  FW_ASSERT(
1130  _status == Fw::FW_SERIALIZE_OK,
1131  static_cast<FwAssertArgType>(_status)
1132  );
1133 #endif
1134  _status = _logBuff.serialize(arg2);
1135  FW_ASSERT(
1136  _status == Fw::FW_SERIALIZE_OK,
1137  static_cast<FwAssertArgType>(_status)
1138  );
1139 
1140 #if FW_AMPCS_COMPATIBLE
1141  // Serialize the argument size
1142  _status = _logBuff.serialize(
1143  static_cast<U8>(sizeof(U32))
1144  );
1145  FW_ASSERT(
1146  _status == Fw::FW_SERIALIZE_OK,
1147  static_cast<FwAssertArgType>(_status)
1148  );
1149 #endif
1150  _status = _logBuff.serialize(arg3);
1151  FW_ASSERT(
1152  _status == Fw::FW_SERIALIZE_OK,
1153  static_cast<FwAssertArgType>(_status)
1154  );
1155 
1156 #if FW_AMPCS_COMPATIBLE
1157  // Serialize the argument size
1158  _status = _logBuff.serialize(
1159  static_cast<U8>(sizeof(U32))
1160  );
1161  FW_ASSERT(
1162  _status == Fw::FW_SERIALIZE_OK,
1163  static_cast<FwAssertArgType>(_status)
1164  );
1165 #endif
1166  _status = _logBuff.serialize(arg4);
1167  FW_ASSERT(
1168  _status == Fw::FW_SERIALIZE_OK,
1169  static_cast<FwAssertArgType>(_status)
1170  );
1171 
1172 #if FW_AMPCS_COMPATIBLE
1173  // Serialize the argument size
1174  _status = _logBuff.serialize(
1175  static_cast<U8>(sizeof(U32))
1176  );
1177  FW_ASSERT(
1178  _status == Fw::FW_SERIALIZE_OK,
1179  static_cast<FwAssertArgType>(_status)
1180  );
1181 #endif
1182  _status = _logBuff.serialize(arg5);
1183  FW_ASSERT(
1184  _status == Fw::FW_SERIALIZE_OK,
1185  static_cast<FwAssertArgType>(_status)
1186  );
1187 
1188  this->m_Log_OutputPort[0].invoke(
1189  _id,
1190  _logTime,
1192  _logBuff
1193  );
1194  }
1195 
1196  // Emit the event on the text log port
1197 #if FW_ENABLE_TEXT_LOGGING
1198  if (this->m_LogText_OutputPort[0].isConnected()) {
1199 #if FW_OBJECT_NAMES == 1
1200  const char* _formatString =
1201  "(%s) %s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "";
1202 #else
1203  const char* _formatString =
1204  "%s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "";
1205 #endif
1206 
1207  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1208 
1209  (void) snprintf(
1210  _textBuffer,
1212  _formatString,
1213 #if FW_OBJECT_NAMES == 1
1214  this->m_objName,
1215 #endif
1216  "AF_ASSERT_5 ",
1217  file.toChar(),
1218  line,
1219  arg1,
1220  arg2,
1221  arg3,
1222  arg4,
1223  arg5
1224  );
1225 
1226  // Null terminate
1227  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1228  Fw::TextLogString _logString = _textBuffer;
1229  this->m_LogText_OutputPort[0].invoke(
1230  _id,
1231  _logTime,
1233  _logString
1234  );
1235  }
1236 #endif
1237  }
1238 
1241  const Fw::LogStringArg& file,
1242  U32 line,
1243  U32 arg1,
1244  U32 arg2,
1245  U32 arg3,
1246  U32 arg4,
1247  U32 arg5,
1248  U32 arg6
1249  )
1250  {
1251  // Get the time
1252  Fw::Time _logTime;
1253  if (this->m_Time_OutputPort[0].isConnected()) {
1254  this->m_Time_OutputPort[0].invoke(_logTime);
1255  }
1256 
1257  FwEventIdType _id = static_cast<FwEventIdType>(0);
1258 
1259  _id = this->getIdBase() + EVENTID_AF_ASSERT_6;
1260 
1261  // Emit the event on the log port
1262  if (this->m_Log_OutputPort[0].isConnected()) {
1263  Fw::LogBuffer _logBuff;
1265 
1266 #if FW_AMPCS_COMPATIBLE
1267  // Serialize the number of arguments
1268  _status = _logBuff.serialize(static_cast<U8>(8 + 1));
1269  FW_ASSERT(
1270  _status == Fw::FW_SERIALIZE_OK,
1271  static_cast<FwAssertArgType>(_status)
1272  );
1273 
1274  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
1275  _status = _logBuff.serialize(static_cast<U8>(4));
1276  FW_ASSERT(
1277  _status == Fw::FW_SERIALIZE_OK,
1278  static_cast<FwAssertArgType>(_status)
1279  );
1280 
1281  _status = _logBuff.serialize(static_cast<U32>(0));
1282  FW_ASSERT(
1283  _status == Fw::FW_SERIALIZE_OK,
1284  static_cast<FwAssertArgType>(_status)
1285  );
1286 #endif
1287 
1288  _status = file.serialize(_logBuff, 80);
1289  FW_ASSERT(
1290  _status == Fw::FW_SERIALIZE_OK,
1291  static_cast<FwAssertArgType>(_status)
1292  );
1293 
1294 #if FW_AMPCS_COMPATIBLE
1295  // Serialize the argument size
1296  _status = _logBuff.serialize(
1297  static_cast<U8>(sizeof(U32))
1298  );
1299  FW_ASSERT(
1300  _status == Fw::FW_SERIALIZE_OK,
1301  static_cast<FwAssertArgType>(_status)
1302  );
1303 #endif
1304  _status = _logBuff.serialize(line);
1305  FW_ASSERT(
1306  _status == Fw::FW_SERIALIZE_OK,
1307  static_cast<FwAssertArgType>(_status)
1308  );
1309 
1310 #if FW_AMPCS_COMPATIBLE
1311  // Serialize the argument size
1312  _status = _logBuff.serialize(
1313  static_cast<U8>(sizeof(U32))
1314  );
1315  FW_ASSERT(
1316  _status == Fw::FW_SERIALIZE_OK,
1317  static_cast<FwAssertArgType>(_status)
1318  );
1319 #endif
1320  _status = _logBuff.serialize(arg1);
1321  FW_ASSERT(
1322  _status == Fw::FW_SERIALIZE_OK,
1323  static_cast<FwAssertArgType>(_status)
1324  );
1325 
1326 #if FW_AMPCS_COMPATIBLE
1327  // Serialize the argument size
1328  _status = _logBuff.serialize(
1329  static_cast<U8>(sizeof(U32))
1330  );
1331  FW_ASSERT(
1332  _status == Fw::FW_SERIALIZE_OK,
1333  static_cast<FwAssertArgType>(_status)
1334  );
1335 #endif
1336  _status = _logBuff.serialize(arg2);
1337  FW_ASSERT(
1338  _status == Fw::FW_SERIALIZE_OK,
1339  static_cast<FwAssertArgType>(_status)
1340  );
1341 
1342 #if FW_AMPCS_COMPATIBLE
1343  // Serialize the argument size
1344  _status = _logBuff.serialize(
1345  static_cast<U8>(sizeof(U32))
1346  );
1347  FW_ASSERT(
1348  _status == Fw::FW_SERIALIZE_OK,
1349  static_cast<FwAssertArgType>(_status)
1350  );
1351 #endif
1352  _status = _logBuff.serialize(arg3);
1353  FW_ASSERT(
1354  _status == Fw::FW_SERIALIZE_OK,
1355  static_cast<FwAssertArgType>(_status)
1356  );
1357 
1358 #if FW_AMPCS_COMPATIBLE
1359  // Serialize the argument size
1360  _status = _logBuff.serialize(
1361  static_cast<U8>(sizeof(U32))
1362  );
1363  FW_ASSERT(
1364  _status == Fw::FW_SERIALIZE_OK,
1365  static_cast<FwAssertArgType>(_status)
1366  );
1367 #endif
1368  _status = _logBuff.serialize(arg4);
1369  FW_ASSERT(
1370  _status == Fw::FW_SERIALIZE_OK,
1371  static_cast<FwAssertArgType>(_status)
1372  );
1373 
1374 #if FW_AMPCS_COMPATIBLE
1375  // Serialize the argument size
1376  _status = _logBuff.serialize(
1377  static_cast<U8>(sizeof(U32))
1378  );
1379  FW_ASSERT(
1380  _status == Fw::FW_SERIALIZE_OK,
1381  static_cast<FwAssertArgType>(_status)
1382  );
1383 #endif
1384  _status = _logBuff.serialize(arg5);
1385  FW_ASSERT(
1386  _status == Fw::FW_SERIALIZE_OK,
1387  static_cast<FwAssertArgType>(_status)
1388  );
1389 
1390 #if FW_AMPCS_COMPATIBLE
1391  // Serialize the argument size
1392  _status = _logBuff.serialize(
1393  static_cast<U8>(sizeof(U32))
1394  );
1395  FW_ASSERT(
1396  _status == Fw::FW_SERIALIZE_OK,
1397  static_cast<FwAssertArgType>(_status)
1398  );
1399 #endif
1400  _status = _logBuff.serialize(arg6);
1401  FW_ASSERT(
1402  _status == Fw::FW_SERIALIZE_OK,
1403  static_cast<FwAssertArgType>(_status)
1404  );
1405 
1406  this->m_Log_OutputPort[0].invoke(
1407  _id,
1408  _logTime,
1410  _logBuff
1411  );
1412  }
1413 
1414  // Emit the event on the text log port
1415 #if FW_ENABLE_TEXT_LOGGING
1416  if (this->m_LogText_OutputPort[0].isConnected()) {
1417 #if FW_OBJECT_NAMES == 1
1418  const char* _formatString =
1419  "(%s) %s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "";
1420 #else
1421  const char* _formatString =
1422  "%s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "";
1423 #endif
1424 
1425  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1426 
1427  (void) snprintf(
1428  _textBuffer,
1430  _formatString,
1431 #if FW_OBJECT_NAMES == 1
1432  this->m_objName,
1433 #endif
1434  "AF_ASSERT_6 ",
1435  file.toChar(),
1436  line,
1437  arg1,
1438  arg2,
1439  arg3,
1440  arg4,
1441  arg5,
1442  arg6
1443  );
1444 
1445  // Null terminate
1446  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1447  Fw::TextLogString _logString = _textBuffer;
1448  this->m_LogText_OutputPort[0].invoke(
1449  _id,
1450  _logTime,
1452  _logString
1453  );
1454  }
1455 #endif
1456  }
1457 
1460  const Fw::LogStringArg& file,
1461  U32 line,
1462  U32 numArgs
1463  )
1464  {
1465  // Get the time
1466  Fw::Time _logTime;
1467  if (this->m_Time_OutputPort[0].isConnected()) {
1468  this->m_Time_OutputPort[0].invoke(_logTime);
1469  }
1470 
1471  FwEventIdType _id = static_cast<FwEventIdType>(0);
1472 
1473  _id = this->getIdBase() + EVENTID_AF_UNEXPECTED_ASSERT;
1474 
1475  // Emit the event on the log port
1476  if (this->m_Log_OutputPort[0].isConnected()) {
1477  Fw::LogBuffer _logBuff;
1479 
1480 #if FW_AMPCS_COMPATIBLE
1481  // Serialize the number of arguments
1482  _status = _logBuff.serialize(static_cast<U8>(3 + 1));
1483  FW_ASSERT(
1484  _status == Fw::FW_SERIALIZE_OK,
1485  static_cast<FwAssertArgType>(_status)
1486  );
1487 
1488  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
1489  _status = _logBuff.serialize(static_cast<U8>(4));
1490  FW_ASSERT(
1491  _status == Fw::FW_SERIALIZE_OK,
1492  static_cast<FwAssertArgType>(_status)
1493  );
1494 
1495  _status = _logBuff.serialize(static_cast<U32>(0));
1496  FW_ASSERT(
1497  _status == Fw::FW_SERIALIZE_OK,
1498  static_cast<FwAssertArgType>(_status)
1499  );
1500 #endif
1501 
1502  _status = file.serialize(_logBuff, 80);
1503  FW_ASSERT(
1504  _status == Fw::FW_SERIALIZE_OK,
1505  static_cast<FwAssertArgType>(_status)
1506  );
1507 
1508 #if FW_AMPCS_COMPATIBLE
1509  // Serialize the argument size
1510  _status = _logBuff.serialize(
1511  static_cast<U8>(sizeof(U32))
1512  );
1513  FW_ASSERT(
1514  _status == Fw::FW_SERIALIZE_OK,
1515  static_cast<FwAssertArgType>(_status)
1516  );
1517 #endif
1518  _status = _logBuff.serialize(line);
1519  FW_ASSERT(
1520  _status == Fw::FW_SERIALIZE_OK,
1521  static_cast<FwAssertArgType>(_status)
1522  );
1523 
1524 #if FW_AMPCS_COMPATIBLE
1525  // Serialize the argument size
1526  _status = _logBuff.serialize(
1527  static_cast<U8>(sizeof(U32))
1528  );
1529  FW_ASSERT(
1530  _status == Fw::FW_SERIALIZE_OK,
1531  static_cast<FwAssertArgType>(_status)
1532  );
1533 #endif
1534  _status = _logBuff.serialize(numArgs);
1535  FW_ASSERT(
1536  _status == Fw::FW_SERIALIZE_OK,
1537  static_cast<FwAssertArgType>(_status)
1538  );
1539 
1540  this->m_Log_OutputPort[0].invoke(
1541  _id,
1542  _logTime,
1544  _logBuff
1545  );
1546  }
1547 
1548  // Emit the event on the text log port
1549 #if FW_ENABLE_TEXT_LOGGING
1550  if (this->m_LogText_OutputPort[0].isConnected()) {
1551 #if FW_OBJECT_NAMES == 1
1552  const char* _formatString =
1553  "(%s) %s: Unexpected assert in file %s, line %" PRIu32 ", args %" PRIu32 "";
1554 #else
1555  const char* _formatString =
1556  "%s: Unexpected assert in file %s, line %" PRIu32 ", args %" PRIu32 "";
1557 #endif
1558 
1559  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1560 
1561  (void) snprintf(
1562  _textBuffer,
1564  _formatString,
1565 #if FW_OBJECT_NAMES == 1
1566  this->m_objName,
1567 #endif
1568  "AF_UNEXPECTED_ASSERT ",
1569  file.toChar(),
1570  line,
1571  numArgs
1572  );
1573 
1574  // Null terminate
1575  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1576  Fw::TextLogString _logString = _textBuffer;
1577  this->m_LogText_OutputPort[0].invoke(
1578  _id,
1579  _logTime,
1581  _logString
1582  );
1583  }
1584 #endif
1585  }
1586 
1587  // ----------------------------------------------------------------------
1588  // Time
1589  // ----------------------------------------------------------------------
1590 
1592  getTime()
1593  {
1594  if (this->m_Time_OutputPort[0].isConnected()) {
1595  Fw::Time _time;
1596  this->m_Time_OutputPort[0].invoke(_time);
1597  return _time;
1598  }
1599  else {
1600  return Fw::Time(TB_NONE, 0, 0);
1601  }
1602  }
1603 
1604 }
#define FW_ASSERT(...)
Definition: Assert.hpp:14
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:26
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:66
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
Definition: FpConfig.h:39
PlatformAssertArgType FwAssertArgType
Definition: FpConfig.h:21
U32 FwEventIdType
Definition: FpConfig.h:62
#define FW_LOG_TEXT_BUFFER_SIZE
Max size of string for text log message.
Definition: FpConfig.h:299
#define FW_OBJ_NAME_MAX_SIZE
Size of object name (if object names enabled). AC Limits to 80, truncation occurs above 80.
Definition: FpConfig.h:184
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
Definition: FpConfig.h:88
@ FATAL
A fatal non-recoverable event.
const char * toChar() const override
Definition: LogString.cpp:49
SerializeStatus serialize(SerializeBufferBase &buffer) const override
serialization function
Definition: LogString.cpp:57
void init()
Object initializer.
Definition: ObjBase.cpp:27
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
Definition: LogPortAc.cpp:170
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
void invoke(Fw::Time &time)
Invoke a port interface.
Definition: TimePortAc.cpp:147
void init()
Initialization function.
Definition: TimePortAc.cpp:128
bool isConnected()
Definition: PortBase.cpp:41
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
Definition: Time.hpp:9
AssertFatalAdapterComponentBase(const char *compName="")
Construct AssertFatalAdapterComponentBase object.
void set_Log_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void log_FATAL_AF_UNEXPECTED_ASSERT(const Fw::LogStringArg &file, U32 line, U32 numArgs)
void log_FATAL_AF_ASSERT_2(const Fw::LogStringArg &file, U32 line, U32 arg1, U32 arg2)
void log_FATAL_AF_ASSERT_4(const Fw::LogStringArg &file, U32 line, U32 arg1, U32 arg2, U32 arg3, U32 arg4)
void log_FATAL_AF_ASSERT_1(const Fw::LogStringArg &file, U32 line, U32 arg1)
void set_Time_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
bool isConnected_Time_OutputPort(NATIVE_INT_TYPE portNum)
virtual ~AssertFatalAdapterComponentBase()
Destroy AssertFatalAdapterComponentBase object.
@ EVENTID_AF_UNEXPECTED_ASSERT
An unexpected assert happened.
void log_FATAL_AF_ASSERT_3(const Fw::LogStringArg &file, U32 line, U32 arg1, U32 arg2, U32 arg3)
void log_FATAL_AF_ASSERT_6(const Fw::LogStringArg &file, U32 line, U32 arg1, U32 arg2, U32 arg3, U32 arg4, U32 arg5, U32 arg6)
bool isConnected_Log_OutputPort(NATIVE_INT_TYPE portNum)
void log_FATAL_AF_ASSERT_0(const Fw::LogStringArg &file, U32 line)
void log_FATAL_AF_ASSERT_5(const Fw::LogStringArg &file, U32 line, U32 arg1, U32 arg2, U32 arg3, U32 arg4, U32 arg5)
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.