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  // Getters for numbers of typed input ports
389  // ----------------------------------------------------------------------
390 
393  {
394  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_dataIn_InputPort));
395  }
396 
399  {
400  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_dataReturnIn_InputPort));
401  }
402 
403  // ----------------------------------------------------------------------
404  // Getters for numbers of special output ports
405  // ----------------------------------------------------------------------
406 
409  {
410  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_logOut_OutputPort));
411  }
412 
413 #if FW_ENABLE_TEXT_LOGGING == 1
414 
415  FwIndexType FprimeDeframerComponentBase ::
416  getNum_logTextOut_OutputPorts() const
417  {
418  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_logTextOut_OutputPort));
419  }
420 
421 #endif
422 
425  {
426  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_timeCaller_OutputPort));
427  }
428 
429  // ----------------------------------------------------------------------
430  // Getters for numbers of typed output ports
431  // ----------------------------------------------------------------------
432 
435  {
436  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_dataOut_OutputPort));
437  }
438 
441  {
442  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_dataReturnOut_OutputPort));
443  }
444 
445  // ----------------------------------------------------------------------
446  // Connection status queries for special output ports
447  // ----------------------------------------------------------------------
448 
451  {
452  FW_ASSERT(
453  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
454  static_cast<FwAssertArgType>(portNum)
455  );
456 
457  return this->m_logOut_OutputPort[portNum].isConnected();
458  }
459 
460 #if FW_ENABLE_TEXT_LOGGING == 1
461 
462  bool FprimeDeframerComponentBase ::
463  isConnected_logTextOut_OutputPort(FwIndexType portNum)
464  {
465  FW_ASSERT(
466  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
467  static_cast<FwAssertArgType>(portNum)
468  );
469 
470  return this->m_logTextOut_OutputPort[portNum].isConnected();
471  }
472 
473 #endif
474 
477  {
478  FW_ASSERT(
479  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
480  static_cast<FwAssertArgType>(portNum)
481  );
482 
483  return this->m_timeCaller_OutputPort[portNum].isConnected();
484  }
485 
486  // ----------------------------------------------------------------------
487  // Connection status queries for typed output ports
488  // ----------------------------------------------------------------------
489 
492  {
493  FW_ASSERT(
494  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
495  static_cast<FwAssertArgType>(portNum)
496  );
497 
498  return this->m_dataOut_OutputPort[portNum].isConnected();
499  }
500 
503  {
504  FW_ASSERT(
505  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
506  static_cast<FwAssertArgType>(portNum)
507  );
508 
509  return this->m_dataReturnOut_OutputPort[portNum].isConnected();
510  }
511 
512  // ----------------------------------------------------------------------
513  // Port handler base-class functions for typed input ports
514  //
515  // Call these functions directly to bypass the corresponding ports
516  // ----------------------------------------------------------------------
517 
520  FwIndexType portNum,
521  Fw::Buffer& data,
522  const ComCfg::FrameContext& context
523  )
524  {
525  // Make sure port number is valid
526  FW_ASSERT(
527  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
528  static_cast<FwAssertArgType>(portNum)
529  );
530 
531  // Lock guard mutex before calling
532  this->lock();
533 
534  // Call handler function
535  this->dataIn_handler(
536  portNum,
537  data,
538  context
539  );
540 
541  // Unlock guard mutex
542  this->unLock();
543  }
544 
547  FwIndexType portNum,
548  Fw::Buffer& data,
549  const ComCfg::FrameContext& context
550  )
551  {
552  // Make sure port number is valid
553  FW_ASSERT(
554  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
555  static_cast<FwAssertArgType>(portNum)
556  );
557 
558  // Call handler function
559  this->dataReturnIn_handler(
560  portNum,
561  data,
562  context
563  );
564  }
565 
566  // ----------------------------------------------------------------------
567  // Invocation functions for typed output ports
568  // ----------------------------------------------------------------------
569 
572  FwIndexType portNum,
573  Fw::Buffer& data,
574  const ComCfg::FrameContext& context
575  )
576  {
577  FW_ASSERT(
578  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
579  static_cast<FwAssertArgType>(portNum)
580  );
581 
582  FW_ASSERT(
583  this->m_dataOut_OutputPort[portNum].isConnected(),
584  static_cast<FwAssertArgType>(portNum)
585  );
586  this->m_dataOut_OutputPort[portNum].invoke(
587  data,
588  context
589  );
590  }
591 
594  FwIndexType portNum,
595  Fw::Buffer& data,
596  const ComCfg::FrameContext& context
597  )
598  {
599  FW_ASSERT(
600  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
601  static_cast<FwAssertArgType>(portNum)
602  );
603 
604  FW_ASSERT(
605  this->m_dataReturnOut_OutputPort[portNum].isConnected(),
606  static_cast<FwAssertArgType>(portNum)
607  );
608  this->m_dataReturnOut_OutputPort[portNum].invoke(
609  data,
610  context
611  );
612  }
613 
614  // ----------------------------------------------------------------------
615  // Event logging functions
616  // ----------------------------------------------------------------------
617 
620  {
621  // Get the time
622  Fw::Time _logTime;
623  if (this->m_timeCaller_OutputPort[0].isConnected()) {
624  this->m_timeCaller_OutputPort[0].invoke(_logTime);
625  }
626 
627  FwEventIdType _id = static_cast<FwEventIdType>(0);
628 
630 
631  // Emit the event on the log port
632  if (this->m_logOut_OutputPort[0].isConnected()) {
633  Fw::LogBuffer _logBuff;
634 
635 #if FW_AMPCS_COMPATIBLE
637  // Serialize the number of arguments
638  _status = _logBuff.serialize(static_cast<U8>(0));
639  FW_ASSERT(
640  _status == Fw::FW_SERIALIZE_OK,
641  static_cast<FwAssertArgType>(_status)
642  );
643 #endif
644 
645  this->m_logOut_OutputPort[0].invoke(
646  _id,
647  _logTime,
649  _logBuff
650  );
651  }
652 
653  // Emit the event on the text log port
654 #if FW_ENABLE_TEXT_LOGGING
655  if (this->m_logTextOut_OutputPort[0].isConnected()) {
656 #if FW_OBJECT_NAMES == 1
657  const char* _formatString =
658  "(%s) %s: Frame dropped: The received buffer is not long enough to contain a valid frame (header + trailer)";
659 #else
660  const char* _formatString =
661  "%s: Frame dropped: The received buffer is not long enough to contain a valid frame (header + trailer)";
662 #endif
663 
664  Fw::TextLogString _logString;
665  _logString.format(
666  _formatString,
667 #if FW_OBJECT_NAMES == 1
668  this->m_objName.toChar(),
669 #endif
670  "InvalidBufferReceived "
671  );
672 
673  this->m_logTextOut_OutputPort[0].invoke(
674  _id,
675  _logTime,
677  _logString
678  );
679  }
680 #endif
681  }
682 
685  {
686  // Get the time
687  Fw::Time _logTime;
688  if (this->m_timeCaller_OutputPort[0].isConnected()) {
689  this->m_timeCaller_OutputPort[0].invoke(_logTime);
690  }
691 
692  FwEventIdType _id = static_cast<FwEventIdType>(0);
693 
694  _id = this->getIdBase() + EVENTID_INVALIDSTARTWORD;
695 
696  // Emit the event on the log port
697  if (this->m_logOut_OutputPort[0].isConnected()) {
698  Fw::LogBuffer _logBuff;
699 
700 #if FW_AMPCS_COMPATIBLE
702  // Serialize the number of arguments
703  _status = _logBuff.serialize(static_cast<U8>(0));
704  FW_ASSERT(
705  _status == Fw::FW_SERIALIZE_OK,
706  static_cast<FwAssertArgType>(_status)
707  );
708 #endif
709 
710  this->m_logOut_OutputPort[0].invoke(
711  _id,
712  _logTime,
714  _logBuff
715  );
716  }
717 
718  // Emit the event on the text log port
719 #if FW_ENABLE_TEXT_LOGGING
720  if (this->m_logTextOut_OutputPort[0].isConnected()) {
721 #if FW_OBJECT_NAMES == 1
722  const char* _formatString =
723  "(%s) %s: Frame dropped: The received buffer does not start with the F Prime start word";
724 #else
725  const char* _formatString =
726  "%s: Frame dropped: The received buffer does not start with the F Prime start word";
727 #endif
728 
729  Fw::TextLogString _logString;
730  _logString.format(
731  _formatString,
732 #if FW_OBJECT_NAMES == 1
733  this->m_objName.toChar(),
734 #endif
735  "InvalidStartWord "
736  );
737 
738  this->m_logTextOut_OutputPort[0].invoke(
739  _id,
740  _logTime,
742  _logString
743  );
744  }
745 #endif
746  }
747 
750  {
751  // Get the time
752  Fw::Time _logTime;
753  if (this->m_timeCaller_OutputPort[0].isConnected()) {
754  this->m_timeCaller_OutputPort[0].invoke(_logTime);
755  }
756 
757  FwEventIdType _id = static_cast<FwEventIdType>(0);
758 
760 
761  // Emit the event on the log port
762  if (this->m_logOut_OutputPort[0].isConnected()) {
763  Fw::LogBuffer _logBuff;
764 
765 #if FW_AMPCS_COMPATIBLE
767  // Serialize the number of arguments
768  _status = _logBuff.serialize(static_cast<U8>(0));
769  FW_ASSERT(
770  _status == Fw::FW_SERIALIZE_OK,
771  static_cast<FwAssertArgType>(_status)
772  );
773 #endif
774 
775  this->m_logOut_OutputPort[0].invoke(
776  _id,
777  _logTime,
779  _logBuff
780  );
781  }
782 
783  // Emit the event on the text log port
784 #if FW_ENABLE_TEXT_LOGGING
785  if (this->m_logTextOut_OutputPort[0].isConnected()) {
786 #if FW_OBJECT_NAMES == 1
787  const char* _formatString =
788  "(%s) %s: Frame dropped: The received buffer size cannot hold a frame of specified payload length";
789 #else
790  const char* _formatString =
791  "%s: Frame dropped: The received buffer size cannot hold a frame of specified payload length";
792 #endif
793 
794  Fw::TextLogString _logString;
795  _logString.format(
796  _formatString,
797 #if FW_OBJECT_NAMES == 1
798  this->m_objName.toChar(),
799 #endif
800  "InvalidLengthReceived "
801  );
802 
803  this->m_logTextOut_OutputPort[0].invoke(
804  _id,
805  _logTime,
807  _logString
808  );
809  }
810 #endif
811  }
812 
815  {
816  // Get the time
817  Fw::Time _logTime;
818  if (this->m_timeCaller_OutputPort[0].isConnected()) {
819  this->m_timeCaller_OutputPort[0].invoke(_logTime);
820  }
821 
822  FwEventIdType _id = static_cast<FwEventIdType>(0);
823 
824  _id = this->getIdBase() + EVENTID_INVALIDCHECKSUM;
825 
826  // Emit the event on the log port
827  if (this->m_logOut_OutputPort[0].isConnected()) {
828  Fw::LogBuffer _logBuff;
829 
830 #if FW_AMPCS_COMPATIBLE
832  // Serialize the number of arguments
833  _status = _logBuff.serialize(static_cast<U8>(0));
834  FW_ASSERT(
835  _status == Fw::FW_SERIALIZE_OK,
836  static_cast<FwAssertArgType>(_status)
837  );
838 #endif
839 
840  this->m_logOut_OutputPort[0].invoke(
841  _id,
842  _logTime,
844  _logBuff
845  );
846  }
847 
848  // Emit the event on the text log port
849 #if FW_ENABLE_TEXT_LOGGING
850  if (this->m_logTextOut_OutputPort[0].isConnected()) {
851 #if FW_OBJECT_NAMES == 1
852  const char* _formatString =
853  "(%s) %s: Frame dropped: The transmitted frame checksum does not match that computed by the receiver";
854 #else
855  const char* _formatString =
856  "%s: Frame dropped: The transmitted frame checksum does not match that computed by the receiver";
857 #endif
858 
859  Fw::TextLogString _logString;
860  _logString.format(
861  _formatString,
862 #if FW_OBJECT_NAMES == 1
863  this->m_objName.toChar(),
864 #endif
865  "InvalidChecksum "
866  );
867 
868  this->m_logTextOut_OutputPort[0].invoke(
869  _id,
870  _logTime,
872  _logString
873  );
874  }
875 #endif
876  }
877 
878  // ----------------------------------------------------------------------
879  // Time
880  // ----------------------------------------------------------------------
881 
883  getTime() const
884  {
885  if (this->m_timeCaller_OutputPort[0].isConnected()) {
886  Fw::Time _time;
887  this->m_timeCaller_OutputPort[0].invoke(_time);
888  return _time;
889  }
890  else {
891  return Fw::Time(TB_NONE, 0, 0);
892  }
893  }
894 
895  // ----------------------------------------------------------------------
896  // Mutex operations for guarded ports
897  //
898  // You can override these operations to provide more sophisticated
899  // synchronization
900  // ----------------------------------------------------------------------
901 
904  {
905  this->m_guardedPortMutex.lock();
906  }
907 
910  {
911  this->m_guardedPortMutex.unLock();
912  }
913 
914  // ----------------------------------------------------------------------
915  // Calls for messages received on typed input ports
916  // ----------------------------------------------------------------------
917 
918  void FprimeDeframerComponentBase ::
919  m_p_dataIn_in(
920  Fw::PassiveComponentBase* callComp,
921  FwIndexType portNum,
922  Fw::Buffer& data,
923  const ComCfg::FrameContext& context
924  )
925  {
926  FW_ASSERT(callComp);
927  FprimeDeframerComponentBase* compPtr = static_cast<FprimeDeframerComponentBase*>(callComp);
928  compPtr->dataIn_handlerBase(
929  portNum,
930  data,
931  context
932  );
933  }
934 
935  void FprimeDeframerComponentBase ::
936  m_p_dataReturnIn_in(
937  Fw::PassiveComponentBase* callComp,
938  FwIndexType portNum,
939  Fw::Buffer& data,
940  const ComCfg::FrameContext& context
941  )
942  {
943  FW_ASSERT(callComp);
944  FprimeDeframerComponentBase* compPtr = static_cast<FprimeDeframerComponentBase*>(callComp);
945  compPtr->dataReturnIn_handlerBase(
946  portNum,
947  data,
948  context
949  );
950  }
951 
952 }
Serialization/Deserialization operation was successful.
bool isConnected_logOut_OutputPort(FwIndexType portNum)
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
Definition: Time.hpp:9
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
I32 FwEnumStoreType
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum)
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:40
An invalid frame was received (checksum mismatch)
An invalid frame was received (too short to be a frame)
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
void addCallPort(InputComDataWithContextPort *callPort)
Register an input port.
void init()
Object initializer.
Definition: ObjBase.cpp:26
U32 FwEventIdType
The type of an event identifier.
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
SerializeStatus
forward declaration for string
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:53
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.
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
const char * toChar() const
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.
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:42
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void setPortNum(FwIndexType portNum)
An invalid frame was received (start word is wrong)
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.
No time base has been established.
Definition: FpConfig.h:30
PlatformIndexType FwIndexType
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:93
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.
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
#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.
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34