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 #if !FW_DIRECT_PORT_CALLS
27  // Connect input port dataIn
28  for (
29  FwIndexType port = 0;
30  port < static_cast<FwIndexType>(this->getNum_dataIn_InputPorts());
31  port++
32  ) {
33  this->m_dataIn_InputPort[port].init();
34  this->m_dataIn_InputPort[port].addCallComp(
35  this,
36  m_p_dataIn_in
37  );
38  this->m_dataIn_InputPort[port].setPortNum(port);
39 
40 #if FW_OBJECT_NAMES == 1
41  Fw::ObjectName portName;
42  portName.format(
43  "%s_dataIn_InputPort[%" PRI_FwIndexType "]",
44  this->m_objName.toChar(),
45  port
46  );
47  this->m_dataIn_InputPort[port].setObjName(portName.toChar());
48 #endif
49  }
50 #endif
51 
52 #if !FW_DIRECT_PORT_CALLS
53  // Connect input port dataReturnIn
54  for (
55  FwIndexType port = 0;
56  port < static_cast<FwIndexType>(this->getNum_dataReturnIn_InputPorts());
57  port++
58  ) {
59  this->m_dataReturnIn_InputPort[port].init();
60  this->m_dataReturnIn_InputPort[port].addCallComp(
61  this,
62  m_p_dataReturnIn_in
63  );
64  this->m_dataReturnIn_InputPort[port].setPortNum(port);
65 
66 #if FW_OBJECT_NAMES == 1
67  Fw::ObjectName portName;
68  portName.format(
69  "%s_dataReturnIn_InputPort[%" PRI_FwIndexType "]",
70  this->m_objName.toChar(),
71  port
72  );
73  this->m_dataReturnIn_InputPort[port].setObjName(portName.toChar());
74 #endif
75  }
76 #endif
77 
78 #if !FW_DIRECT_PORT_CALLS
79  // Connect output port logOut
80  for (
81  FwIndexType port = 0;
82  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
83  port++
84  ) {
85  this->m_logOut_OutputPort[port].init();
86 
87 #if FW_OBJECT_NAMES == 1
88  Fw::ObjectName portName;
89  portName.format(
90  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
91  this->m_objName.toChar(),
92  port
93  );
94  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
95 #endif
96  }
97 #endif
98 
99 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
100  // Connect output port logTextOut
101  for (
102  FwIndexType port = 0;
103  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
104  port++
105  ) {
106  this->m_logTextOut_OutputPort[port].init();
107 
108 #if FW_OBJECT_NAMES == 1
109  Fw::ObjectName portName;
110  portName.format(
111  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
112  this->m_objName.toChar(),
113  port
114  );
115  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
116 #endif
117  }
118 #endif
119 
120 #if !FW_DIRECT_PORT_CALLS
121  // Connect output port timeCaller
122  for (
123  FwIndexType port = 0;
124  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
125  port++
126  ) {
127  this->m_timeCaller_OutputPort[port].init();
128 
129 #if FW_OBJECT_NAMES == 1
130  Fw::ObjectName portName;
131  portName.format(
132  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
133  this->m_objName.toChar(),
134  port
135  );
136  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
137 #endif
138  }
139 #endif
140 
141 #if !FW_DIRECT_PORT_CALLS
142  // Connect output port dataOut
143  for (
144  FwIndexType port = 0;
145  port < static_cast<FwIndexType>(this->getNum_dataOut_OutputPorts());
146  port++
147  ) {
148  this->m_dataOut_OutputPort[port].init();
149 
150 #if FW_OBJECT_NAMES == 1
151  Fw::ObjectName portName;
152  portName.format(
153  "%s_dataOut_OutputPort[%" PRI_FwIndexType "]",
154  this->m_objName.toChar(),
155  port
156  );
157  this->m_dataOut_OutputPort[port].setObjName(portName.toChar());
158 #endif
159  }
160 #endif
161 
162 #if !FW_DIRECT_PORT_CALLS
163  // Connect output port dataReturnOut
164  for (
165  FwIndexType port = 0;
166  port < static_cast<FwIndexType>(this->getNum_dataReturnOut_OutputPorts());
167  port++
168  ) {
169  this->m_dataReturnOut_OutputPort[port].init();
170 
171 #if FW_OBJECT_NAMES == 1
172  Fw::ObjectName portName;
173  portName.format(
174  "%s_dataReturnOut_OutputPort[%" PRI_FwIndexType "]",
175  this->m_objName.toChar(),
176  port
177  );
178  this->m_dataReturnOut_OutputPort[port].setObjName(portName.toChar());
179 #endif
180  }
181 #endif
182  }
183 
184 #if !FW_DIRECT_PORT_CALLS
185 
186  // ----------------------------------------------------------------------
187  // Getters for typed input ports
188  // ----------------------------------------------------------------------
189 
192  {
193  FW_ASSERT(
194  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
195  static_cast<FwAssertArgType>(portNum)
196  );
197 
198  return &this->m_dataIn_InputPort[portNum];
199  }
200 
203  {
204  FW_ASSERT(
205  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
206  static_cast<FwAssertArgType>(portNum)
207  );
208 
209  return &this->m_dataReturnIn_InputPort[portNum];
210  }
211 
212 #endif
213 
214 #if !FW_DIRECT_PORT_CALLS
215 
216  // ----------------------------------------------------------------------
217  // Connect input ports to special output ports
218  // ----------------------------------------------------------------------
219 
222  FwIndexType portNum,
223  Fw::InputLogPort* port
224  )
225  {
226  FW_ASSERT(
227  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
228  static_cast<FwAssertArgType>(portNum)
229  );
230 
231  this->m_logOut_OutputPort[portNum].addCallPort(port);
232  }
233 
234 #if FW_ENABLE_TEXT_LOGGING == 1
235 
236  void FprimeDeframerComponentBase ::
237  set_logTextOut_OutputPort(
238  FwIndexType portNum,
240  )
241  {
242  FW_ASSERT(
243  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
244  static_cast<FwAssertArgType>(portNum)
245  );
246 
247  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
248  }
249 
250 #endif
251 
254  FwIndexType portNum,
255  Fw::InputTimePort* port
256  )
257  {
258  FW_ASSERT(
259  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
260  static_cast<FwAssertArgType>(portNum)
261  );
262 
263  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
264  }
265 
266 #endif
267 
268 #if !FW_DIRECT_PORT_CALLS
269 
270  // ----------------------------------------------------------------------
271  // Connect typed input ports to typed output ports
272  // ----------------------------------------------------------------------
273 
276  FwIndexType portNum,
278  )
279  {
280  FW_ASSERT(
281  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
282  static_cast<FwAssertArgType>(portNum)
283  );
284 
285  this->m_dataOut_OutputPort[portNum].addCallPort(port);
286  }
287 
290  FwIndexType portNum,
292  )
293  {
294  FW_ASSERT(
295  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
296  static_cast<FwAssertArgType>(portNum)
297  );
298 
299  this->m_dataReturnOut_OutputPort[portNum].addCallPort(port);
300  }
301 
302 #endif
303 
304 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
305 
306  // ----------------------------------------------------------------------
307  // Connect serial input ports to special output ports
308  // ----------------------------------------------------------------------
309 
312  FwIndexType portNum,
313  Fw::InputSerializePort* port
314  )
315  {
316  FW_ASSERT(
317  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
318  static_cast<FwAssertArgType>(portNum)
319  );
320 
321  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
322  }
323 
324 #if FW_ENABLE_TEXT_LOGGING == 1
325 
326  void FprimeDeframerComponentBase ::
327  set_logTextOut_OutputPort(
328  FwIndexType portNum,
329  Fw::InputSerializePort* port
330  )
331  {
332  FW_ASSERT(
333  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
334  static_cast<FwAssertArgType>(portNum)
335  );
336 
337  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
338  }
339 
340 #endif
341 
344  FwIndexType portNum,
345  Fw::InputSerializePort* port
346  )
347  {
348  FW_ASSERT(
349  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
350  static_cast<FwAssertArgType>(portNum)
351  );
352 
353  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
354  }
355 
356 #endif
357 
358 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
359 
360  // ----------------------------------------------------------------------
361  // Connect serial input ports to typed output ports
362  // ----------------------------------------------------------------------
363 
366  FwIndexType portNum,
367  Fw::InputSerializePort* port
368  )
369  {
370  FW_ASSERT(
371  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
372  static_cast<FwAssertArgType>(portNum)
373  );
374 
375  this->m_dataOut_OutputPort[portNum].registerSerialPort(port);
376  }
377 
380  FwIndexType portNum,
381  Fw::InputSerializePort* port
382  )
383  {
384  FW_ASSERT(
385  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
386  static_cast<FwAssertArgType>(portNum)
387  );
388 
389  this->m_dataReturnOut_OutputPort[portNum].registerSerialPort(port);
390  }
391 
392 #endif
393 
394  // ----------------------------------------------------------------------
395  // Component construction and destruction
396  // ----------------------------------------------------------------------
397 
399  FprimeDeframerComponentBase(const char* compName) :
400  Fw::PassiveComponentBase(compName)
401  {
402 
403  }
404 
407  {
408 
409  }
410 
411 #if !FW_DIRECT_PORT_CALLS
412 
413  // ----------------------------------------------------------------------
414  // Connection status queries for special output ports
415  // ----------------------------------------------------------------------
416 
419  {
420  FW_ASSERT(
421  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
422  static_cast<FwAssertArgType>(portNum)
423  );
424 
425  return this->m_logOut_OutputPort[portNum].isConnected();
426  }
427 
428 #if FW_ENABLE_TEXT_LOGGING == 1
429 
430  bool FprimeDeframerComponentBase ::
431  isConnected_logTextOut_OutputPort(FwIndexType portNum) const
432  {
433  FW_ASSERT(
434  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
435  static_cast<FwAssertArgType>(portNum)
436  );
437 
438  return this->m_logTextOut_OutputPort[portNum].isConnected();
439  }
440 
441 #endif
442 
445  {
446  FW_ASSERT(
447  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
448  static_cast<FwAssertArgType>(portNum)
449  );
450 
451  return this->m_timeCaller_OutputPort[portNum].isConnected();
452  }
453 
454 #endif
455 
456 #if !FW_DIRECT_PORT_CALLS
457 
458  // ----------------------------------------------------------------------
459  // Connection status queries for typed output ports
460  // ----------------------------------------------------------------------
461 
464  {
465  FW_ASSERT(
466  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
467  static_cast<FwAssertArgType>(portNum)
468  );
469 
470  return this->m_dataOut_OutputPort[portNum].isConnected();
471  }
472 
475  {
476  FW_ASSERT(
477  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
478  static_cast<FwAssertArgType>(portNum)
479  );
480 
481  return this->m_dataReturnOut_OutputPort[portNum].isConnected();
482  }
483 
484 #endif
485 
486  // ----------------------------------------------------------------------
487  // Port handler base-class functions for typed input ports
488  //
489  // Call these functions directly to bypass the corresponding ports
490  // ----------------------------------------------------------------------
491 
494  FwIndexType portNum,
495  Fw::Buffer& data,
496  const ComCfg::FrameContext& context
497  )
498  {
499  // Make sure port number is valid
500  FW_ASSERT(
501  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
502  static_cast<FwAssertArgType>(portNum)
503  );
504 
505  // Lock guard mutex before calling
506  this->lock();
507 
508  // Call handler function
509  this->dataIn_handler(
510  portNum,
511  data,
512  context
513  );
514 
515  // Unlock guard mutex
516  this->unLock();
517  }
518 
521  FwIndexType portNum,
522  Fw::Buffer& data,
523  const ComCfg::FrameContext& context
524  )
525  {
526  // Make sure port number is valid
527  FW_ASSERT(
528  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
529  static_cast<FwAssertArgType>(portNum)
530  );
531 
532  // Call handler function
533  this->dataReturnIn_handler(
534  portNum,
535  data,
536  context
537  );
538  }
539 
540 #if !FW_DIRECT_PORT_CALLS
541 
542  // ----------------------------------------------------------------------
543  // Invocation functions for typed output ports
544  // ----------------------------------------------------------------------
545 
548  FwIndexType portNum,
549  Fw::Buffer& data,
550  const ComCfg::FrameContext& context
551  ) const
552  {
553  FW_ASSERT(
554  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
555  static_cast<FwAssertArgType>(portNum)
556  );
557 
558  FW_ASSERT(
559  this->m_dataOut_OutputPort[portNum].isConnected(),
560  static_cast<FwAssertArgType>(portNum)
561  );
562  this->m_dataOut_OutputPort[portNum].invoke(
563  data,
564  context
565  );
566  }
567 
570  FwIndexType portNum,
571  Fw::Buffer& data,
572  const ComCfg::FrameContext& context
573  ) const
574  {
575  FW_ASSERT(
576  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
577  static_cast<FwAssertArgType>(portNum)
578  );
579 
580  FW_ASSERT(
581  this->m_dataReturnOut_OutputPort[portNum].isConnected(),
582  static_cast<FwAssertArgType>(portNum)
583  );
584  this->m_dataReturnOut_OutputPort[portNum].invoke(
585  data,
586  context
587  );
588  }
589 
590 #endif
591 
592  // ----------------------------------------------------------------------
593  // Event logging functions
594  // ----------------------------------------------------------------------
595 
598  {
599  // Get the time
600  Fw::Time _logTime;
601  if (this->isConnected_timeCaller_OutputPort(0)) {
602  this->timeCaller_out(0, _logTime);
603  }
604 
606 
607  // Emit the event on the log port
608  if (this->isConnected_logOut_OutputPort(0)) {
609  Fw::LogBuffer _logBuff;
610 
611 #if FW_AMPCS_COMPATIBLE
613  // Serialize the number of arguments
614  _status = _logBuff.serializeFrom(static_cast<U8>(0));
615  FW_ASSERT(
616  _status == Fw::FW_SERIALIZE_OK,
617  static_cast<FwAssertArgType>(_status)
618  );
619 #endif
620 
621  this->logOut_out(
622  0,
623  _id,
624  _logTime,
626  _logBuff
627  );
628  }
629 
630  // Emit the event on the text log port
631 #if FW_ENABLE_TEXT_LOGGING
632  if (this->isConnected_logTextOut_OutputPort(0)) {
633 #if FW_OBJECT_NAMES == 1
634  const char* _formatString =
635  "(%s) %s: Frame dropped: The received buffer is not long enough to contain a valid frame (header + trailer)";
636 #else
637  const char* _formatString =
638  "%s: Frame dropped: The received buffer is not long enough to contain a valid frame (header + trailer)";
639 #endif
640 
641  Fw::TextLogString _logString;
642  _logString.format(
643  _formatString,
644 #if FW_OBJECT_NAMES == 1
645  this->m_objName.toChar(),
646 #endif
647  "InvalidBufferReceived "
648  );
649 
650  this->logTextOut_out(
651  0,
652  _id,
653  _logTime,
655  _logString
656  );
657  }
658 #endif
659  }
660 
663  {
664  // Get the time
665  Fw::Time _logTime;
666  if (this->isConnected_timeCaller_OutputPort(0)) {
667  this->timeCaller_out(0, _logTime);
668  }
669 
670  const FwEventIdType _id = this->getIdBase() + EVENTID_INVALIDSTARTWORD;
671 
672  // Emit the event on the log port
673  if (this->isConnected_logOut_OutputPort(0)) {
674  Fw::LogBuffer _logBuff;
675 
676 #if FW_AMPCS_COMPATIBLE
678  // Serialize the number of arguments
679  _status = _logBuff.serializeFrom(static_cast<U8>(0));
680  FW_ASSERT(
681  _status == Fw::FW_SERIALIZE_OK,
682  static_cast<FwAssertArgType>(_status)
683  );
684 #endif
685 
686  this->logOut_out(
687  0,
688  _id,
689  _logTime,
691  _logBuff
692  );
693  }
694 
695  // Emit the event on the text log port
696 #if FW_ENABLE_TEXT_LOGGING
697  if (this->isConnected_logTextOut_OutputPort(0)) {
698 #if FW_OBJECT_NAMES == 1
699  const char* _formatString =
700  "(%s) %s: Frame dropped: The received buffer does not start with the F Prime start word";
701 #else
702  const char* _formatString =
703  "%s: Frame dropped: The received buffer does not start with the F Prime start word";
704 #endif
705 
706  Fw::TextLogString _logString;
707  _logString.format(
708  _formatString,
709 #if FW_OBJECT_NAMES == 1
710  this->m_objName.toChar(),
711 #endif
712  "InvalidStartWord "
713  );
714 
715  this->logTextOut_out(
716  0,
717  _id,
718  _logTime,
720  _logString
721  );
722  }
723 #endif
724  }
725 
728  {
729  // Get the time
730  Fw::Time _logTime;
731  if (this->isConnected_timeCaller_OutputPort(0)) {
732  this->timeCaller_out(0, _logTime);
733  }
734 
736 
737  // Emit the event on the log port
738  if (this->isConnected_logOut_OutputPort(0)) {
739  Fw::LogBuffer _logBuff;
740 
741 #if FW_AMPCS_COMPATIBLE
743  // Serialize the number of arguments
744  _status = _logBuff.serializeFrom(static_cast<U8>(0));
745  FW_ASSERT(
746  _status == Fw::FW_SERIALIZE_OK,
747  static_cast<FwAssertArgType>(_status)
748  );
749 #endif
750 
751  this->logOut_out(
752  0,
753  _id,
754  _logTime,
756  _logBuff
757  );
758  }
759 
760  // Emit the event on the text log port
761 #if FW_ENABLE_TEXT_LOGGING
762  if (this->isConnected_logTextOut_OutputPort(0)) {
763 #if FW_OBJECT_NAMES == 1
764  const char* _formatString =
765  "(%s) %s: Frame dropped: The received buffer size cannot hold a frame of specified payload length";
766 #else
767  const char* _formatString =
768  "%s: Frame dropped: The received buffer size cannot hold a frame of specified payload length";
769 #endif
770 
771  Fw::TextLogString _logString;
772  _logString.format(
773  _formatString,
774 #if FW_OBJECT_NAMES == 1
775  this->m_objName.toChar(),
776 #endif
777  "InvalidLengthReceived "
778  );
779 
780  this->logTextOut_out(
781  0,
782  _id,
783  _logTime,
785  _logString
786  );
787  }
788 #endif
789  }
790 
793  {
794  // Get the time
795  Fw::Time _logTime;
796  if (this->isConnected_timeCaller_OutputPort(0)) {
797  this->timeCaller_out(0, _logTime);
798  }
799 
800  const FwEventIdType _id = this->getIdBase() + EVENTID_INVALIDCHECKSUM;
801 
802  // Emit the event on the log port
803  if (this->isConnected_logOut_OutputPort(0)) {
804  Fw::LogBuffer _logBuff;
805 
806 #if FW_AMPCS_COMPATIBLE
808  // Serialize the number of arguments
809  _status = _logBuff.serializeFrom(static_cast<U8>(0));
810  FW_ASSERT(
811  _status == Fw::FW_SERIALIZE_OK,
812  static_cast<FwAssertArgType>(_status)
813  );
814 #endif
815 
816  this->logOut_out(
817  0,
818  _id,
819  _logTime,
821  _logBuff
822  );
823  }
824 
825  // Emit the event on the text log port
826 #if FW_ENABLE_TEXT_LOGGING
827  if (this->isConnected_logTextOut_OutputPort(0)) {
828 #if FW_OBJECT_NAMES == 1
829  const char* _formatString =
830  "(%s) %s: Frame dropped: The transmitted frame checksum does not match that computed by the receiver";
831 #else
832  const char* _formatString =
833  "%s: Frame dropped: The transmitted frame checksum does not match that computed by the receiver";
834 #endif
835 
836  Fw::TextLogString _logString;
837  _logString.format(
838  _formatString,
839 #if FW_OBJECT_NAMES == 1
840  this->m_objName.toChar(),
841 #endif
842  "InvalidChecksum "
843  );
844 
845  this->logTextOut_out(
846  0,
847  _id,
848  _logTime,
850  _logString
851  );
852  }
853 #endif
854  }
855 
858  {
859  // Get the time
860  Fw::Time _logTime;
861  if (this->isConnected_timeCaller_OutputPort(0)) {
862  this->timeCaller_out(0, _logTime);
863  }
864 
865  const FwEventIdType _id = this->getIdBase() + EVENTID_PAYLOADTOOSHORT;
866 
867  // Emit the event on the log port
868  if (this->isConnected_logOut_OutputPort(0)) {
869  Fw::LogBuffer _logBuff;
870 
871 #if FW_AMPCS_COMPATIBLE
873  // Serialize the number of arguments
874  _status = _logBuff.serializeFrom(static_cast<U8>(0));
875  FW_ASSERT(
876  _status == Fw::FW_SERIALIZE_OK,
877  static_cast<FwAssertArgType>(_status)
878  );
879 #endif
880 
881  this->logOut_out(
882  0,
883  _id,
884  _logTime,
886  _logBuff
887  );
888  }
889 
890  // Emit the event on the text log port
891 #if FW_ENABLE_TEXT_LOGGING
892  if (this->isConnected_logTextOut_OutputPort(0)) {
893 #if FW_OBJECT_NAMES == 1
894  const char* _formatString =
895  "(%s) %s: The received buffer is too short to contain a valid FwPacketDescriptor";
896 #else
897  const char* _formatString =
898  "%s: The received buffer is too short to contain a valid FwPacketDescriptor";
899 #endif
900 
901  Fw::TextLogString _logString;
902  _logString.format(
903  _formatString,
904 #if FW_OBJECT_NAMES == 1
905  this->m_objName.toChar(),
906 #endif
907  "PayloadTooShort "
908  );
909 
910  this->logTextOut_out(
911  0,
912  _id,
913  _logTime,
915  _logString
916  );
917  }
918 #endif
919  }
920 
921  // ----------------------------------------------------------------------
922  // Time
923  // ----------------------------------------------------------------------
924 
926  getTime() const
927  {
928  if (this->isConnected_timeCaller_OutputPort(0)) {
929  Fw::Time _time;
930  this->timeCaller_out(0, _time);
931  return _time;
932  }
933  else {
934  return Fw::Time(TimeBase::TB_NONE, 0, 0);
935  }
936  }
937 
938  // ----------------------------------------------------------------------
939  // Mutex operations for guarded ports
940  //
941  // You can override these operations to provide more sophisticated
942  // synchronization
943  // ----------------------------------------------------------------------
944 
947  {
948  this->m_guardedPortMutex.lock();
949  }
950 
953  {
954  this->m_guardedPortMutex.unLock();
955  }
956 
957  // ----------------------------------------------------------------------
958  // Calls for messages received on typed input ports
959  // ----------------------------------------------------------------------
960 
961  void FprimeDeframerComponentBase ::
962  m_p_dataIn_in(
963  Fw::PassiveComponentBase* callComp,
964  FwIndexType portNum,
965  Fw::Buffer& data,
966  const ComCfg::FrameContext& context
967  )
968  {
969  FW_ASSERT(callComp);
970  FprimeDeframerComponentBase* compPtr = static_cast<FprimeDeframerComponentBase*>(callComp);
971  compPtr->dataIn_handlerBase(
972  portNum,
973  data,
974  context
975  );
976  }
977 
978  void FprimeDeframerComponentBase ::
979  m_p_dataReturnIn_in(
980  Fw::PassiveComponentBase* callComp,
981  FwIndexType portNum,
982  Fw::Buffer& data,
983  const ComCfg::FrameContext& context
984  )
985  {
986  FW_ASSERT(callComp);
987  FprimeDeframerComponentBase* compPtr = static_cast<FprimeDeframerComponentBase*>(callComp);
988  compPtr->dataReturnIn_handlerBase(
989  portNum,
990  data,
991  context
992  );
993  }
994 
995 #if !FW_DIRECT_PORT_CALLS
996 
997  // ----------------------------------------------------------------------
998  // Invocation functions for special output ports
999  // ----------------------------------------------------------------------
1000 
1001  void FprimeDeframerComponentBase ::
1002  logOut_out(
1003  FwIndexType portNum,
1004  FwEventIdType id,
1005  Fw::Time& timeTag,
1006  const Fw::LogSeverity& severity,
1007  Fw::LogBuffer& args
1008  ) const
1009  {
1010  FW_ASSERT(
1011  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
1012  static_cast<FwAssertArgType>(portNum)
1013  );
1014 
1015  FW_ASSERT(
1016  this->m_logOut_OutputPort[portNum].isConnected(),
1017  static_cast<FwAssertArgType>(portNum)
1018  );
1019  this->m_logOut_OutputPort[portNum].invoke(
1020  id,
1021  timeTag,
1022  severity,
1023  args
1024  );
1025  }
1026 
1027 #if FW_ENABLE_TEXT_LOGGING
1028 
1029  void FprimeDeframerComponentBase ::
1030  logTextOut_out(
1031  FwIndexType portNum,
1032  FwEventIdType id,
1033  Fw::Time& timeTag,
1034  const Fw::LogSeverity& severity,
1035  Fw::TextLogString& text
1036  ) const
1037  {
1038  FW_ASSERT(
1039  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
1040  static_cast<FwAssertArgType>(portNum)
1041  );
1042 
1043  FW_ASSERT(
1044  this->m_logTextOut_OutputPort[portNum].isConnected(),
1045  static_cast<FwAssertArgType>(portNum)
1046  );
1047  this->m_logTextOut_OutputPort[portNum].invoke(
1048  id,
1049  timeTag,
1050  severity,
1051  text
1052  );
1053  }
1054 
1055 #endif
1056 
1057  void FprimeDeframerComponentBase ::
1058  timeCaller_out(
1059  FwIndexType portNum,
1060  Fw::Time& time
1061  ) const
1062  {
1063  FW_ASSERT(
1064  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
1065  static_cast<FwAssertArgType>(portNum)
1066  );
1067 
1068  FW_ASSERT(
1069  this->m_timeCaller_OutputPort[portNum].isConnected(),
1070  static_cast<FwAssertArgType>(portNum)
1071  );
1072  this->m_timeCaller_OutputPort[portNum].invoke(
1073  time
1074  );
1075  }
1076 
1077 #endif
1078 
1079 }
Serialization/Deserialization operation was successful.
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum) const
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
An invalid frame was received (start word is wrong)
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.
I32 FwEnumStoreType
An invalid frame was received (too short to be a frame)
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
SerializeStatus
forward declaration for string
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
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:40
void init()
Initialization function.
Definition: TimePortAc.cpp:151
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.
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataOut.
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
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 connection.
static constexpr FwIndexType getNum_dataIn_InputPorts()
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataReturnOut.
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
Enum representing event severity.
#define PRI_FwIndexType
An invalid frame was received (checksum mismatch)
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
void init()
Initialization function.
Definition: LogPortAc.cpp:180
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 connection.
Definition: LogPortAc.cpp:199
bool isConnected_dataOut_OutputPort(FwIndexType portNum) const
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:186
Type used to pass context info between components during framing/deframing.
RateGroupDivider component implementation.
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
An invalid frame was received (not enough data to contain a valid FwPacketDescriptor type) ...
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
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