F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FprimeDeframerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FprimeDeframerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for FprimeDeframer component base class
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #endif
13 
14 namespace Svc {
15 
16  // ----------------------------------------------------------------------
17  // Component initialization
18  // ----------------------------------------------------------------------
19 
22  {
23  // Initialize base class
25 
26  // Connect input port dataIn
27  for (
28  FwIndexType port = 0;
29  port < static_cast<FwIndexType>(this->getNum_dataIn_InputPorts());
30  port++
31  ) {
32  this->m_dataIn_InputPort[port].init();
33  this->m_dataIn_InputPort[port].addCallComp(
34  this,
35  m_p_dataIn_in
36  );
37  this->m_dataIn_InputPort[port].setPortNum(port);
38 
39 #if FW_OBJECT_NAMES == 1
40  Fw::ObjectName portName;
41  portName.format(
42  "%s_dataIn_InputPort[%" PRI_FwIndexType "]",
43  this->m_objName.toChar(),
44  port
45  );
46  this->m_dataIn_InputPort[port].setObjName(portName.toChar());
47 #endif
48  }
49 
50  // Connect input port dataReturnIn
51  for (
52  FwIndexType port = 0;
53  port < static_cast<FwIndexType>(this->getNum_dataReturnIn_InputPorts());
54  port++
55  ) {
56  this->m_dataReturnIn_InputPort[port].init();
57  this->m_dataReturnIn_InputPort[port].addCallComp(
58  this,
59  m_p_dataReturnIn_in
60  );
61  this->m_dataReturnIn_InputPort[port].setPortNum(port);
62 
63 #if FW_OBJECT_NAMES == 1
64  Fw::ObjectName portName;
65  portName.format(
66  "%s_dataReturnIn_InputPort[%" PRI_FwIndexType "]",
67  this->m_objName.toChar(),
68  port
69  );
70  this->m_dataReturnIn_InputPort[port].setObjName(portName.toChar());
71 #endif
72  }
73 
74  // Connect output port logOut
75  for (
76  FwIndexType port = 0;
77  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
78  port++
79  ) {
80  this->m_logOut_OutputPort[port].init();
81 
82 #if FW_OBJECT_NAMES == 1
83  Fw::ObjectName portName;
84  portName.format(
85  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
86  this->m_objName.toChar(),
87  port
88  );
89  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
90 #endif
91  }
92 
93 #if FW_ENABLE_TEXT_LOGGING == 1
94  // Connect output port logTextOut
95  for (
96  FwIndexType port = 0;
97  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
98  port++
99  ) {
100  this->m_logTextOut_OutputPort[port].init();
101 
102 #if FW_OBJECT_NAMES == 1
103  Fw::ObjectName portName;
104  portName.format(
105  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
106  this->m_objName.toChar(),
107  port
108  );
109  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
110 #endif
111  }
112 #endif
113 
114  // Connect output port timeCaller
115  for (
116  FwIndexType port = 0;
117  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
118  port++
119  ) {
120  this->m_timeCaller_OutputPort[port].init();
121 
122 #if FW_OBJECT_NAMES == 1
123  Fw::ObjectName portName;
124  portName.format(
125  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
126  this->m_objName.toChar(),
127  port
128  );
129  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
130 #endif
131  }
132 
133  // Connect output port dataOut
134  for (
135  FwIndexType port = 0;
136  port < static_cast<FwIndexType>(this->getNum_dataOut_OutputPorts());
137  port++
138  ) {
139  this->m_dataOut_OutputPort[port].init();
140 
141 #if FW_OBJECT_NAMES == 1
142  Fw::ObjectName portName;
143  portName.format(
144  "%s_dataOut_OutputPort[%" PRI_FwIndexType "]",
145  this->m_objName.toChar(),
146  port
147  );
148  this->m_dataOut_OutputPort[port].setObjName(portName.toChar());
149 #endif
150  }
151 
152  // Connect output port dataReturnOut
153  for (
154  FwIndexType port = 0;
155  port < static_cast<FwIndexType>(this->getNum_dataReturnOut_OutputPorts());
156  port++
157  ) {
158  this->m_dataReturnOut_OutputPort[port].init();
159 
160 #if FW_OBJECT_NAMES == 1
161  Fw::ObjectName portName;
162  portName.format(
163  "%s_dataReturnOut_OutputPort[%" PRI_FwIndexType "]",
164  this->m_objName.toChar(),
165  port
166  );
167  this->m_dataReturnOut_OutputPort[port].setObjName(portName.toChar());
168 #endif
169  }
170  }
171 
172  // ----------------------------------------------------------------------
173  // Getters for typed input ports
174  // ----------------------------------------------------------------------
175 
178  {
179  FW_ASSERT(
180  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
181  static_cast<FwAssertArgType>(portNum)
182  );
183 
184  return &this->m_dataIn_InputPort[portNum];
185  }
186 
189  {
190  FW_ASSERT(
191  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
192  static_cast<FwAssertArgType>(portNum)
193  );
194 
195  return &this->m_dataReturnIn_InputPort[portNum];
196  }
197 
198  // ----------------------------------------------------------------------
199  // Connect input ports to special output ports
200  // ----------------------------------------------------------------------
201 
204  FwIndexType portNum,
205  Fw::InputLogPort* port
206  )
207  {
208  FW_ASSERT(
209  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
210  static_cast<FwAssertArgType>(portNum)
211  );
212 
213  this->m_logOut_OutputPort[portNum].addCallPort(port);
214  }
215 
216 #if FW_ENABLE_TEXT_LOGGING == 1
217 
218  void FprimeDeframerComponentBase ::
219  set_logTextOut_OutputPort(
220  FwIndexType portNum,
222  )
223  {
224  FW_ASSERT(
225  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
226  static_cast<FwAssertArgType>(portNum)
227  );
228 
229  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
230  }
231 
232 #endif
233 
236  FwIndexType portNum,
237  Fw::InputTimePort* port
238  )
239  {
240  FW_ASSERT(
241  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
242  static_cast<FwAssertArgType>(portNum)
243  );
244 
245  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
246  }
247 
248  // ----------------------------------------------------------------------
249  // Connect typed input ports to typed output ports
250  // ----------------------------------------------------------------------
251 
254  FwIndexType portNum,
256  )
257  {
258  FW_ASSERT(
259  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
260  static_cast<FwAssertArgType>(portNum)
261  );
262 
263  this->m_dataOut_OutputPort[portNum].addCallPort(port);
264  }
265 
268  FwIndexType portNum,
270  )
271  {
272  FW_ASSERT(
273  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
274  static_cast<FwAssertArgType>(portNum)
275  );
276 
277  this->m_dataReturnOut_OutputPort[portNum].addCallPort(port);
278  }
279 
280 #if FW_PORT_SERIALIZATION
281 
282  // ----------------------------------------------------------------------
283  // Connect serial input ports to special output ports
284  // ----------------------------------------------------------------------
285 
288  FwIndexType portNum,
289  Fw::InputSerializePort* port
290  )
291  {
292  FW_ASSERT(
293  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
294  static_cast<FwAssertArgType>(portNum)
295  );
296 
297  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
298  }
299 
300 #if FW_ENABLE_TEXT_LOGGING == 1
301 
302  void FprimeDeframerComponentBase ::
303  set_logTextOut_OutputPort(
304  FwIndexType portNum,
305  Fw::InputSerializePort* port
306  )
307  {
308  FW_ASSERT(
309  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
310  static_cast<FwAssertArgType>(portNum)
311  );
312 
313  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
314  }
315 
316 #endif
317 
320  FwIndexType portNum,
321  Fw::InputSerializePort* port
322  )
323  {
324  FW_ASSERT(
325  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
326  static_cast<FwAssertArgType>(portNum)
327  );
328 
329  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
330  }
331 
332 #endif
333 
334 #if FW_PORT_SERIALIZATION
335 
336  // ----------------------------------------------------------------------
337  // Connect serial input ports to typed output ports
338  // ----------------------------------------------------------------------
339 
342  FwIndexType portNum,
343  Fw::InputSerializePort* port
344  )
345  {
346  FW_ASSERT(
347  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
348  static_cast<FwAssertArgType>(portNum)
349  );
350 
351  this->m_dataOut_OutputPort[portNum].registerSerialPort(port);
352  }
353 
356  FwIndexType portNum,
357  Fw::InputSerializePort* port
358  )
359  {
360  FW_ASSERT(
361  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
362  static_cast<FwAssertArgType>(portNum)
363  );
364 
365  this->m_dataReturnOut_OutputPort[portNum].registerSerialPort(port);
366  }
367 
368 #endif
369 
370  // ----------------------------------------------------------------------
371  // Component construction and destruction
372  // ----------------------------------------------------------------------
373 
375  FprimeDeframerComponentBase(const char* compName) :
376  Fw::PassiveComponentBase(compName)
377  {
378 
379  }
380 
383  {
384 
385  }
386 
387  // ----------------------------------------------------------------------
388  // Connection status queries for special output ports
389  // ----------------------------------------------------------------------
390 
393  {
394  FW_ASSERT(
395  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
396  static_cast<FwAssertArgType>(portNum)
397  );
398 
399  return this->m_logOut_OutputPort[portNum].isConnected();
400  }
401 
402 #if FW_ENABLE_TEXT_LOGGING == 1
403 
404  bool FprimeDeframerComponentBase ::
405  isConnected_logTextOut_OutputPort(FwIndexType portNum)
406  {
407  FW_ASSERT(
408  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
409  static_cast<FwAssertArgType>(portNum)
410  );
411 
412  return this->m_logTextOut_OutputPort[portNum].isConnected();
413  }
414 
415 #endif
416 
419  {
420  FW_ASSERT(
421  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
422  static_cast<FwAssertArgType>(portNum)
423  );
424 
425  return this->m_timeCaller_OutputPort[portNum].isConnected();
426  }
427 
428  // ----------------------------------------------------------------------
429  // Connection status queries for typed output ports
430  // ----------------------------------------------------------------------
431 
434  {
435  FW_ASSERT(
436  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
437  static_cast<FwAssertArgType>(portNum)
438  );
439 
440  return this->m_dataOut_OutputPort[portNum].isConnected();
441  }
442 
445  {
446  FW_ASSERT(
447  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
448  static_cast<FwAssertArgType>(portNum)
449  );
450 
451  return this->m_dataReturnOut_OutputPort[portNum].isConnected();
452  }
453 
454  // ----------------------------------------------------------------------
455  // Port handler base-class functions for typed input ports
456  //
457  // Call these functions directly to bypass the corresponding ports
458  // ----------------------------------------------------------------------
459 
462  FwIndexType portNum,
463  Fw::Buffer& data,
464  const ComCfg::FrameContext& context
465  )
466  {
467  // Make sure port number is valid
468  FW_ASSERT(
469  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
470  static_cast<FwAssertArgType>(portNum)
471  );
472 
473  // Lock guard mutex before calling
474  this->lock();
475 
476  // Call handler function
477  this->dataIn_handler(
478  portNum,
479  data,
480  context
481  );
482 
483  // Unlock guard mutex
484  this->unLock();
485  }
486 
489  FwIndexType portNum,
490  Fw::Buffer& data,
491  const ComCfg::FrameContext& context
492  )
493  {
494  // Make sure port number is valid
495  FW_ASSERT(
496  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
497  static_cast<FwAssertArgType>(portNum)
498  );
499 
500  // Call handler function
501  this->dataReturnIn_handler(
502  portNum,
503  data,
504  context
505  );
506  }
507 
508  // ----------------------------------------------------------------------
509  // Invocation functions for typed output ports
510  // ----------------------------------------------------------------------
511 
514  FwIndexType portNum,
515  Fw::Buffer& data,
516  const ComCfg::FrameContext& context
517  )
518  {
519  FW_ASSERT(
520  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
521  static_cast<FwAssertArgType>(portNum)
522  );
523 
524  FW_ASSERT(
525  this->m_dataOut_OutputPort[portNum].isConnected(),
526  static_cast<FwAssertArgType>(portNum)
527  );
528  this->m_dataOut_OutputPort[portNum].invoke(
529  data,
530  context
531  );
532  }
533 
536  FwIndexType portNum,
537  Fw::Buffer& data,
538  const ComCfg::FrameContext& context
539  )
540  {
541  FW_ASSERT(
542  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
543  static_cast<FwAssertArgType>(portNum)
544  );
545 
546  FW_ASSERT(
547  this->m_dataReturnOut_OutputPort[portNum].isConnected(),
548  static_cast<FwAssertArgType>(portNum)
549  );
550  this->m_dataReturnOut_OutputPort[portNum].invoke(
551  data,
552  context
553  );
554  }
555 
556  // ----------------------------------------------------------------------
557  // Event logging functions
558  // ----------------------------------------------------------------------
559 
562  {
563  // Get the time
564  Fw::Time _logTime;
565  if (this->m_timeCaller_OutputPort[0].isConnected()) {
566  this->m_timeCaller_OutputPort[0].invoke(_logTime);
567  }
568 
569  FwEventIdType _id = static_cast<FwEventIdType>(0);
570 
572 
573  // Emit the event on the log port
574  if (this->m_logOut_OutputPort[0].isConnected()) {
575  Fw::LogBuffer _logBuff;
576 
577 #if FW_AMPCS_COMPATIBLE
579  // Serialize the number of arguments
580  _status = _logBuff.serializeFrom(static_cast<U8>(0));
581  FW_ASSERT(
582  _status == Fw::FW_SERIALIZE_OK,
583  static_cast<FwAssertArgType>(_status)
584  );
585 #endif
586 
587  this->m_logOut_OutputPort[0].invoke(
588  _id,
589  _logTime,
591  _logBuff
592  );
593  }
594 
595  // Emit the event on the text log port
596 #if FW_ENABLE_TEXT_LOGGING
597  if (this->m_logTextOut_OutputPort[0].isConnected()) {
598 #if FW_OBJECT_NAMES == 1
599  const char* _formatString =
600  "(%s) %s: Frame dropped: The received buffer is not long enough to contain a valid frame (header + trailer)";
601 #else
602  const char* _formatString =
603  "%s: Frame dropped: The received buffer is not long enough to contain a valid frame (header + trailer)";
604 #endif
605 
606  Fw::TextLogString _logString;
607  _logString.format(
608  _formatString,
609 #if FW_OBJECT_NAMES == 1
610  this->m_objName.toChar(),
611 #endif
612  "InvalidBufferReceived "
613  );
614 
615  this->m_logTextOut_OutputPort[0].invoke(
616  _id,
617  _logTime,
619  _logString
620  );
621  }
622 #endif
623  }
624 
627  {
628  // Get the time
629  Fw::Time _logTime;
630  if (this->m_timeCaller_OutputPort[0].isConnected()) {
631  this->m_timeCaller_OutputPort[0].invoke(_logTime);
632  }
633 
634  FwEventIdType _id = static_cast<FwEventIdType>(0);
635 
636  _id = this->getIdBase() + EVENTID_INVALIDSTARTWORD;
637 
638  // Emit the event on the log port
639  if (this->m_logOut_OutputPort[0].isConnected()) {
640  Fw::LogBuffer _logBuff;
641 
642 #if FW_AMPCS_COMPATIBLE
644  // Serialize the number of arguments
645  _status = _logBuff.serializeFrom(static_cast<U8>(0));
646  FW_ASSERT(
647  _status == Fw::FW_SERIALIZE_OK,
648  static_cast<FwAssertArgType>(_status)
649  );
650 #endif
651 
652  this->m_logOut_OutputPort[0].invoke(
653  _id,
654  _logTime,
656  _logBuff
657  );
658  }
659 
660  // Emit the event on the text log port
661 #if FW_ENABLE_TEXT_LOGGING
662  if (this->m_logTextOut_OutputPort[0].isConnected()) {
663 #if FW_OBJECT_NAMES == 1
664  const char* _formatString =
665  "(%s) %s: Frame dropped: The received buffer does not start with the F Prime start word";
666 #else
667  const char* _formatString =
668  "%s: Frame dropped: The received buffer does not start with the F Prime start word";
669 #endif
670 
671  Fw::TextLogString _logString;
672  _logString.format(
673  _formatString,
674 #if FW_OBJECT_NAMES == 1
675  this->m_objName.toChar(),
676 #endif
677  "InvalidStartWord "
678  );
679 
680  this->m_logTextOut_OutputPort[0].invoke(
681  _id,
682  _logTime,
684  _logString
685  );
686  }
687 #endif
688  }
689 
692  {
693  // Get the time
694  Fw::Time _logTime;
695  if (this->m_timeCaller_OutputPort[0].isConnected()) {
696  this->m_timeCaller_OutputPort[0].invoke(_logTime);
697  }
698 
699  FwEventIdType _id = static_cast<FwEventIdType>(0);
700 
702 
703  // Emit the event on the log port
704  if (this->m_logOut_OutputPort[0].isConnected()) {
705  Fw::LogBuffer _logBuff;
706 
707 #if FW_AMPCS_COMPATIBLE
709  // Serialize the number of arguments
710  _status = _logBuff.serializeFrom(static_cast<U8>(0));
711  FW_ASSERT(
712  _status == Fw::FW_SERIALIZE_OK,
713  static_cast<FwAssertArgType>(_status)
714  );
715 #endif
716 
717  this->m_logOut_OutputPort[0].invoke(
718  _id,
719  _logTime,
721  _logBuff
722  );
723  }
724 
725  // Emit the event on the text log port
726 #if FW_ENABLE_TEXT_LOGGING
727  if (this->m_logTextOut_OutputPort[0].isConnected()) {
728 #if FW_OBJECT_NAMES == 1
729  const char* _formatString =
730  "(%s) %s: Frame dropped: The received buffer size cannot hold a frame of specified payload length";
731 #else
732  const char* _formatString =
733  "%s: Frame dropped: The received buffer size cannot hold a frame of specified payload length";
734 #endif
735 
736  Fw::TextLogString _logString;
737  _logString.format(
738  _formatString,
739 #if FW_OBJECT_NAMES == 1
740  this->m_objName.toChar(),
741 #endif
742  "InvalidLengthReceived "
743  );
744 
745  this->m_logTextOut_OutputPort[0].invoke(
746  _id,
747  _logTime,
749  _logString
750  );
751  }
752 #endif
753  }
754 
757  {
758  // Get the time
759  Fw::Time _logTime;
760  if (this->m_timeCaller_OutputPort[0].isConnected()) {
761  this->m_timeCaller_OutputPort[0].invoke(_logTime);
762  }
763 
764  FwEventIdType _id = static_cast<FwEventIdType>(0);
765 
766  _id = this->getIdBase() + EVENTID_INVALIDCHECKSUM;
767 
768  // Emit the event on the log port
769  if (this->m_logOut_OutputPort[0].isConnected()) {
770  Fw::LogBuffer _logBuff;
771 
772 #if FW_AMPCS_COMPATIBLE
774  // Serialize the number of arguments
775  _status = _logBuff.serializeFrom(static_cast<U8>(0));
776  FW_ASSERT(
777  _status == Fw::FW_SERIALIZE_OK,
778  static_cast<FwAssertArgType>(_status)
779  );
780 #endif
781 
782  this->m_logOut_OutputPort[0].invoke(
783  _id,
784  _logTime,
786  _logBuff
787  );
788  }
789 
790  // Emit the event on the text log port
791 #if FW_ENABLE_TEXT_LOGGING
792  if (this->m_logTextOut_OutputPort[0].isConnected()) {
793 #if FW_OBJECT_NAMES == 1
794  const char* _formatString =
795  "(%s) %s: Frame dropped: The transmitted frame checksum does not match that computed by the receiver";
796 #else
797  const char* _formatString =
798  "%s: Frame dropped: The transmitted frame checksum does not match that computed by the receiver";
799 #endif
800 
801  Fw::TextLogString _logString;
802  _logString.format(
803  _formatString,
804 #if FW_OBJECT_NAMES == 1
805  this->m_objName.toChar(),
806 #endif
807  "InvalidChecksum "
808  );
809 
810  this->m_logTextOut_OutputPort[0].invoke(
811  _id,
812  _logTime,
814  _logString
815  );
816  }
817 #endif
818  }
819 
822  {
823  // Get the time
824  Fw::Time _logTime;
825  if (this->m_timeCaller_OutputPort[0].isConnected()) {
826  this->m_timeCaller_OutputPort[0].invoke(_logTime);
827  }
828 
829  FwEventIdType _id = static_cast<FwEventIdType>(0);
830 
831  _id = this->getIdBase() + EVENTID_PAYLOADTOOSHORT;
832 
833  // Emit the event on the log port
834  if (this->m_logOut_OutputPort[0].isConnected()) {
835  Fw::LogBuffer _logBuff;
836 
837 #if FW_AMPCS_COMPATIBLE
839  // Serialize the number of arguments
840  _status = _logBuff.serializeFrom(static_cast<U8>(0));
841  FW_ASSERT(
842  _status == Fw::FW_SERIALIZE_OK,
843  static_cast<FwAssertArgType>(_status)
844  );
845 #endif
846 
847  this->m_logOut_OutputPort[0].invoke(
848  _id,
849  _logTime,
851  _logBuff
852  );
853  }
854 
855  // Emit the event on the text log port
856 #if FW_ENABLE_TEXT_LOGGING
857  if (this->m_logTextOut_OutputPort[0].isConnected()) {
858 #if FW_OBJECT_NAMES == 1
859  const char* _formatString =
860  "(%s) %s: The received buffer is too short to contain a valid FwPacketDescriptor";
861 #else
862  const char* _formatString =
863  "%s: The received buffer is too short to contain a valid FwPacketDescriptor";
864 #endif
865 
866  Fw::TextLogString _logString;
867  _logString.format(
868  _formatString,
869 #if FW_OBJECT_NAMES == 1
870  this->m_objName.toChar(),
871 #endif
872  "PayloadTooShort "
873  );
874 
875  this->m_logTextOut_OutputPort[0].invoke(
876  _id,
877  _logTime,
879  _logString
880  );
881  }
882 #endif
883  }
884 
885  // ----------------------------------------------------------------------
886  // Time
887  // ----------------------------------------------------------------------
888 
890  getTime() const
891  {
892  if (this->m_timeCaller_OutputPort[0].isConnected()) {
893  Fw::Time _time;
894  this->m_timeCaller_OutputPort[0].invoke(_time);
895  return _time;
896  }
897  else {
898  return Fw::Time(TimeBase::TB_NONE, 0, 0);
899  }
900  }
901 
902  // ----------------------------------------------------------------------
903  // Mutex operations for guarded ports
904  //
905  // You can override these operations to provide more sophisticated
906  // synchronization
907  // ----------------------------------------------------------------------
908 
911  {
912  this->m_guardedPortMutex.lock();
913  }
914 
917  {
918  this->m_guardedPortMutex.unLock();
919  }
920 
921  // ----------------------------------------------------------------------
922  // Calls for messages received on typed input ports
923  // ----------------------------------------------------------------------
924 
925  void FprimeDeframerComponentBase ::
926  m_p_dataIn_in(
927  Fw::PassiveComponentBase* callComp,
928  FwIndexType portNum,
929  Fw::Buffer& data,
930  const ComCfg::FrameContext& context
931  )
932  {
933  FW_ASSERT(callComp);
934  FprimeDeframerComponentBase* compPtr = static_cast<FprimeDeframerComponentBase*>(callComp);
935  compPtr->dataIn_handlerBase(
936  portNum,
937  data,
938  context
939  );
940  }
941 
942  void FprimeDeframerComponentBase ::
943  m_p_dataReturnIn_in(
944  Fw::PassiveComponentBase* callComp,
945  FwIndexType portNum,
946  Fw::Buffer& data,
947  const ComCfg::FrameContext& context
948  )
949  {
950  FW_ASSERT(callComp);
951  FprimeDeframerComponentBase* compPtr = static_cast<FprimeDeframerComponentBase*>(callComp);
952  compPtr->dataReturnIn_handlerBase(
953  portNum,
954  data,
955  context
956  );
957  }
958 
959 }
Serialization/Deserialization operation was successful.
bool isConnected_logOut_OutputPort(FwIndexType portNum)
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
I32 FwEnumStoreType
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_logOut_OutputPorts()
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:41
No time base has been established (Required)
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
void addCallPort(InputComDataWithContextPort *callPort)
Register an input port.
void init()
Object initializer.
Definition: ObjBase.cpp:24
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
SerializeStatus
forward declaration for string
FwIdType FwEventIdType
The type of an event identifier.
FprimeDeframerComponentBase(const char *compName="")
Construct FprimeDeframerComponentBase object.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:26
void init()
Initialization function.
Definition: TimePortAc.cpp:128
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
A less serious but recoverable event.
An invalid frame was received (too short to be a frame)
An invalid frame was received (not enough data to contain a valid FwPacketDescriptor type) ...
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
const char * toChar() const
Convert to a C-style char*.
Definition: ObjectName.hpp:50
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
void invoke(Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke a port interface.
static constexpr FwIndexType getNum_dataIn_InputPorts()
Auto-generated base for FprimeDeframer component.
A serious but recoverable event.
void init()
Initialization function.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
bool isConnected() const
Definition: PortBase.cpp:38
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void setPortNum(FwIndexType portNum)
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
virtual ~FprimeDeframerComponentBase()
Destroy FprimeDeframerComponentBase object.
virtual void lock()
Lock the guarded mutex.
void init()
Initialization function.
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
PlatformIndexType FwIndexType
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
Type used to pass context info between components during framing/deframing.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
RateGroupDivider component implementation.
An invalid frame was received (start word is wrong)
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
An invalid frame was received (checksum mismatch)
Implementation of malloc based allocator.
static constexpr FwIndexType getNum_dataReturnIn_InputPorts()
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
virtual void unLock()
Unlock the guarded mutex.
static constexpr FwIndexType getNum_dataOut_OutputPorts()
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34