F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
LinuxUartDriverComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title LinuxUartDriverComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for LinuxUartDriver component base class
5 // ======================================================================
6 
8 #include "Fw/Types/Assert.hpp"
10 #if FW_ENABLE_TEXT_LOGGING
11 #include "Fw/Types/String.hpp"
12 #endif
13 
14 namespace Drv {
15 
16  // ----------------------------------------------------------------------
17  // Component initialization
18  // ----------------------------------------------------------------------
19 
22  {
23  // Initialize base class
25 
26  // Connect input port recvReturnIn
27  for (
28  FwIndexType port = 0;
29  port < static_cast<FwIndexType>(this->getNum_recvReturnIn_InputPorts());
30  port++
31  ) {
32  this->m_recvReturnIn_InputPort[port].init();
33  this->m_recvReturnIn_InputPort[port].addCallComp(
34  this,
35  m_p_recvReturnIn_in
36  );
37  this->m_recvReturnIn_InputPort[port].setPortNum(port);
38 
39 #if FW_OBJECT_NAMES == 1
40  Fw::ObjectName portName;
41  portName.format(
42  "%s_recvReturnIn_InputPort[%" PRI_FwIndexType "]",
43  this->m_objName.toChar(),
44  port
45  );
46  this->m_recvReturnIn_InputPort[port].setObjName(portName.toChar());
47 #endif
48  }
49 
50  // Connect input port send
51  for (
52  FwIndexType port = 0;
53  port < static_cast<FwIndexType>(this->getNum_send_InputPorts());
54  port++
55  ) {
56  this->m_send_InputPort[port].init();
57  this->m_send_InputPort[port].addCallComp(
58  this,
59  m_p_send_in
60  );
61  this->m_send_InputPort[port].setPortNum(port);
62 
63 #if FW_OBJECT_NAMES == 1
64  Fw::ObjectName portName;
65  portName.format(
66  "%s_send_InputPort[%" PRI_FwIndexType "]",
67  this->m_objName.toChar(),
68  port
69  );
70  this->m_send_InputPort[port].setObjName(portName.toChar());
71 #endif
72  }
73 
74  // Connect output port Log
75  for (
76  FwIndexType port = 0;
77  port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
78  port++
79  ) {
80  this->m_Log_OutputPort[port].init();
81 
82 #if FW_OBJECT_NAMES == 1
83  Fw::ObjectName portName;
84  portName.format(
85  "%s_Log_OutputPort[%" PRI_FwIndexType "]",
86  this->m_objName.toChar(),
87  port
88  );
89  this->m_Log_OutputPort[port].setObjName(portName.toChar());
90 #endif
91  }
92 
93 #if FW_ENABLE_TEXT_LOGGING == 1
94  // Connect output port LogText
95  for (
96  FwIndexType port = 0;
97  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
98  port++
99  ) {
100  this->m_LogText_OutputPort[port].init();
101 
102 #if FW_OBJECT_NAMES == 1
103  Fw::ObjectName portName;
104  portName.format(
105  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
106  this->m_objName.toChar(),
107  port
108  );
109  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
110 #endif
111  }
112 #endif
113 
114  // Connect output port Time
115  for (
116  FwIndexType port = 0;
117  port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
118  port++
119  ) {
120  this->m_Time_OutputPort[port].init();
121 
122 #if FW_OBJECT_NAMES == 1
123  Fw::ObjectName portName;
124  portName.format(
125  "%s_Time_OutputPort[%" PRI_FwIndexType "]",
126  this->m_objName.toChar(),
127  port
128  );
129  this->m_Time_OutputPort[port].setObjName(portName.toChar());
130 #endif
131  }
132 
133  // Connect output port Tlm
134  for (
135  FwIndexType port = 0;
136  port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
137  port++
138  ) {
139  this->m_Tlm_OutputPort[port].init();
140 
141 #if FW_OBJECT_NAMES == 1
142  Fw::ObjectName portName;
143  portName.format(
144  "%s_Tlm_OutputPort[%" PRI_FwIndexType "]",
145  this->m_objName.toChar(),
146  port
147  );
148  this->m_Tlm_OutputPort[port].setObjName(portName.toChar());
149 #endif
150  }
151 
152  // Connect output port allocate
153  for (
154  FwIndexType port = 0;
155  port < static_cast<FwIndexType>(this->getNum_allocate_OutputPorts());
156  port++
157  ) {
158  this->m_allocate_OutputPort[port].init();
159 
160 #if FW_OBJECT_NAMES == 1
161  Fw::ObjectName portName;
162  portName.format(
163  "%s_allocate_OutputPort[%" PRI_FwIndexType "]",
164  this->m_objName.toChar(),
165  port
166  );
167  this->m_allocate_OutputPort[port].setObjName(portName.toChar());
168 #endif
169  }
170 
171  // Connect output port deallocate
172  for (
173  FwIndexType port = 0;
174  port < static_cast<FwIndexType>(this->getNum_deallocate_OutputPorts());
175  port++
176  ) {
177  this->m_deallocate_OutputPort[port].init();
178 
179 #if FW_OBJECT_NAMES == 1
180  Fw::ObjectName portName;
181  portName.format(
182  "%s_deallocate_OutputPort[%" PRI_FwIndexType "]",
183  this->m_objName.toChar(),
184  port
185  );
186  this->m_deallocate_OutputPort[port].setObjName(portName.toChar());
187 #endif
188  }
189 
190  // Connect output port ready
191  for (
192  FwIndexType port = 0;
193  port < static_cast<FwIndexType>(this->getNum_ready_OutputPorts());
194  port++
195  ) {
196  this->m_ready_OutputPort[port].init();
197 
198 #if FW_OBJECT_NAMES == 1
199  Fw::ObjectName portName;
200  portName.format(
201  "%s_ready_OutputPort[%" PRI_FwIndexType "]",
202  this->m_objName.toChar(),
203  port
204  );
205  this->m_ready_OutputPort[port].setObjName(portName.toChar());
206 #endif
207  }
208 
209  // Connect output port recv
210  for (
211  FwIndexType port = 0;
212  port < static_cast<FwIndexType>(this->getNum_recv_OutputPorts());
213  port++
214  ) {
215  this->m_recv_OutputPort[port].init();
216 
217 #if FW_OBJECT_NAMES == 1
218  Fw::ObjectName portName;
219  portName.format(
220  "%s_recv_OutputPort[%" PRI_FwIndexType "]",
221  this->m_objName.toChar(),
222  port
223  );
224  this->m_recv_OutputPort[port].setObjName(portName.toChar());
225 #endif
226  }
227 
228  // Connect output port sendReturnOut
229  for (
230  FwIndexType port = 0;
231  port < static_cast<FwIndexType>(this->getNum_sendReturnOut_OutputPorts());
232  port++
233  ) {
234  this->m_sendReturnOut_OutputPort[port].init();
235 
236 #if FW_OBJECT_NAMES == 1
237  Fw::ObjectName portName;
238  portName.format(
239  "%s_sendReturnOut_OutputPort[%" PRI_FwIndexType "]",
240  this->m_objName.toChar(),
241  port
242  );
243  this->m_sendReturnOut_OutputPort[port].setObjName(portName.toChar());
244 #endif
245  }
246  }
247 
248  // ----------------------------------------------------------------------
249  // Getters for typed input ports
250  // ----------------------------------------------------------------------
251 
254  {
255  FW_ASSERT(
256  (0 <= portNum) && (portNum < this->getNum_recvReturnIn_InputPorts()),
257  static_cast<FwAssertArgType>(portNum)
258  );
259 
260  return &this->m_recvReturnIn_InputPort[portNum];
261  }
262 
265  {
266  FW_ASSERT(
267  (0 <= portNum) && (portNum < this->getNum_send_InputPorts()),
268  static_cast<FwAssertArgType>(portNum)
269  );
270 
271  return &this->m_send_InputPort[portNum];
272  }
273 
274  // ----------------------------------------------------------------------
275  // Connect input ports to special output ports
276  // ----------------------------------------------------------------------
277 
280  FwIndexType portNum,
281  Fw::InputLogPort* port
282  )
283  {
284  FW_ASSERT(
285  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
286  static_cast<FwAssertArgType>(portNum)
287  );
288 
289  this->m_Log_OutputPort[portNum].addCallPort(port);
290  }
291 
292 #if FW_ENABLE_TEXT_LOGGING == 1
293 
294  void LinuxUartDriverComponentBase ::
295  set_LogText_OutputPort(
296  FwIndexType portNum,
298  )
299  {
300  FW_ASSERT(
301  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
302  static_cast<FwAssertArgType>(portNum)
303  );
304 
305  this->m_LogText_OutputPort[portNum].addCallPort(port);
306  }
307 
308 #endif
309 
312  FwIndexType portNum,
313  Fw::InputTimePort* port
314  )
315  {
316  FW_ASSERT(
317  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
318  static_cast<FwAssertArgType>(portNum)
319  );
320 
321  this->m_Time_OutputPort[portNum].addCallPort(port);
322  }
323 
326  FwIndexType portNum,
327  Fw::InputTlmPort* port
328  )
329  {
330  FW_ASSERT(
331  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
332  static_cast<FwAssertArgType>(portNum)
333  );
334 
335  this->m_Tlm_OutputPort[portNum].addCallPort(port);
336  }
337 
338  // ----------------------------------------------------------------------
339  // Connect typed input ports to typed output ports
340  // ----------------------------------------------------------------------
341 
344  FwIndexType portNum,
346  )
347  {
348  FW_ASSERT(
349  (0 <= portNum) && (portNum < this->getNum_allocate_OutputPorts()),
350  static_cast<FwAssertArgType>(portNum)
351  );
352 
353  this->m_allocate_OutputPort[portNum].addCallPort(port);
354  }
355 
358  FwIndexType portNum,
360  )
361  {
362  FW_ASSERT(
363  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
364  static_cast<FwAssertArgType>(portNum)
365  );
366 
367  this->m_deallocate_OutputPort[portNum].addCallPort(port);
368  }
369 
372  FwIndexType portNum,
374  )
375  {
376  FW_ASSERT(
377  (0 <= portNum) && (portNum < this->getNum_ready_OutputPorts()),
378  static_cast<FwAssertArgType>(portNum)
379  );
380 
381  this->m_ready_OutputPort[portNum].addCallPort(port);
382  }
383 
386  FwIndexType portNum,
388  )
389  {
390  FW_ASSERT(
391  (0 <= portNum) && (portNum < this->getNum_recv_OutputPorts()),
392  static_cast<FwAssertArgType>(portNum)
393  );
394 
395  this->m_recv_OutputPort[portNum].addCallPort(port);
396  }
397 
400  FwIndexType portNum,
402  )
403  {
404  FW_ASSERT(
405  (0 <= portNum) && (portNum < this->getNum_sendReturnOut_OutputPorts()),
406  static_cast<FwAssertArgType>(portNum)
407  );
408 
409  this->m_sendReturnOut_OutputPort[portNum].addCallPort(port);
410  }
411 
412 #if FW_PORT_SERIALIZATION
413 
414  // ----------------------------------------------------------------------
415  // Connect serial input ports to special output ports
416  // ----------------------------------------------------------------------
417 
420  FwIndexType portNum,
421  Fw::InputSerializePort* port
422  )
423  {
424  FW_ASSERT(
425  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
426  static_cast<FwAssertArgType>(portNum)
427  );
428 
429  this->m_Log_OutputPort[portNum].registerSerialPort(port);
430  }
431 
432 #if FW_ENABLE_TEXT_LOGGING == 1
433 
434  void LinuxUartDriverComponentBase ::
435  set_LogText_OutputPort(
436  FwIndexType portNum,
437  Fw::InputSerializePort* port
438  )
439  {
440  FW_ASSERT(
441  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
442  static_cast<FwAssertArgType>(portNum)
443  );
444 
445  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
446  }
447 
448 #endif
449 
452  FwIndexType portNum,
453  Fw::InputSerializePort* port
454  )
455  {
456  FW_ASSERT(
457  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
458  static_cast<FwAssertArgType>(portNum)
459  );
460 
461  this->m_Time_OutputPort[portNum].registerSerialPort(port);
462  }
463 
466  FwIndexType portNum,
467  Fw::InputSerializePort* port
468  )
469  {
470  FW_ASSERT(
471  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
472  static_cast<FwAssertArgType>(portNum)
473  );
474 
475  this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
476  }
477 
478 #endif
479 
480 #if FW_PORT_SERIALIZATION
481 
482  // ----------------------------------------------------------------------
483  // Connect serial input ports to typed output ports
484  // ----------------------------------------------------------------------
485 
488  FwIndexType portNum,
489  Fw::InputSerializePort* port
490  )
491  {
492  FW_ASSERT(
493  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
494  static_cast<FwAssertArgType>(portNum)
495  );
496 
497  this->m_deallocate_OutputPort[portNum].registerSerialPort(port);
498  }
499 
502  FwIndexType portNum,
503  Fw::InputSerializePort* port
504  )
505  {
506  FW_ASSERT(
507  (0 <= portNum) && (portNum < this->getNum_ready_OutputPorts()),
508  static_cast<FwAssertArgType>(portNum)
509  );
510 
511  this->m_ready_OutputPort[portNum].registerSerialPort(port);
512  }
513 
516  FwIndexType portNum,
517  Fw::InputSerializePort* port
518  )
519  {
520  FW_ASSERT(
521  (0 <= portNum) && (portNum < this->getNum_recv_OutputPorts()),
522  static_cast<FwAssertArgType>(portNum)
523  );
524 
525  this->m_recv_OutputPort[portNum].registerSerialPort(port);
526  }
527 
530  FwIndexType portNum,
531  Fw::InputSerializePort* port
532  )
533  {
534  FW_ASSERT(
535  (0 <= portNum) && (portNum < this->getNum_sendReturnOut_OutputPorts()),
536  static_cast<FwAssertArgType>(portNum)
537  );
538 
539  this->m_sendReturnOut_OutputPort[portNum].registerSerialPort(port);
540  }
541 
542 #endif
543 
544  // ----------------------------------------------------------------------
545  // Component construction and destruction
546  // ----------------------------------------------------------------------
547 
549  LinuxUartDriverComponentBase(const char* compName) :
550  Fw::PassiveComponentBase(compName)
551  {
552  this->m_WriteErrorThrottle = 0;
553  this->m_ReadErrorThrottle = 0;
554  this->m_NoBuffersThrottle = 0;
555  }
556 
559  {
560 
561  }
562 
563  // ----------------------------------------------------------------------
564  // Getters for numbers of typed input ports
565  // ----------------------------------------------------------------------
566 
569  {
570  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_recvReturnIn_InputPort));
571  }
572 
575  {
576  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_send_InputPort));
577  }
578 
579  // ----------------------------------------------------------------------
580  // Getters for numbers of special output ports
581  // ----------------------------------------------------------------------
582 
585  {
586  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Log_OutputPort));
587  }
588 
589 #if FW_ENABLE_TEXT_LOGGING == 1
590 
591  FwIndexType LinuxUartDriverComponentBase ::
592  getNum_LogText_OutputPorts() const
593  {
594  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
595  }
596 
597 #endif
598 
601  {
602  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Time_OutputPort));
603  }
604 
607  {
608  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Tlm_OutputPort));
609  }
610 
611  // ----------------------------------------------------------------------
612  // Getters for numbers of typed output ports
613  // ----------------------------------------------------------------------
614 
617  {
618  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_allocate_OutputPort));
619  }
620 
623  {
624  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_deallocate_OutputPort));
625  }
626 
629  {
630  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_ready_OutputPort));
631  }
632 
635  {
636  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_recv_OutputPort));
637  }
638 
641  {
642  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_sendReturnOut_OutputPort));
643  }
644 
645  // ----------------------------------------------------------------------
646  // Connection status queries for special output ports
647  // ----------------------------------------------------------------------
648 
651  {
652  FW_ASSERT(
653  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
654  static_cast<FwAssertArgType>(portNum)
655  );
656 
657  return this->m_Log_OutputPort[portNum].isConnected();
658  }
659 
660 #if FW_ENABLE_TEXT_LOGGING == 1
661 
662  bool LinuxUartDriverComponentBase ::
663  isConnected_LogText_OutputPort(FwIndexType portNum)
664  {
665  FW_ASSERT(
666  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
667  static_cast<FwAssertArgType>(portNum)
668  );
669 
670  return this->m_LogText_OutputPort[portNum].isConnected();
671  }
672 
673 #endif
674 
677  {
678  FW_ASSERT(
679  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
680  static_cast<FwAssertArgType>(portNum)
681  );
682 
683  return this->m_Time_OutputPort[portNum].isConnected();
684  }
685 
688  {
689  FW_ASSERT(
690  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
691  static_cast<FwAssertArgType>(portNum)
692  );
693 
694  return this->m_Tlm_OutputPort[portNum].isConnected();
695  }
696 
697  // ----------------------------------------------------------------------
698  // Connection status queries for typed output ports
699  // ----------------------------------------------------------------------
700 
703  {
704  FW_ASSERT(
705  (0 <= portNum) && (portNum < this->getNum_allocate_OutputPorts()),
706  static_cast<FwAssertArgType>(portNum)
707  );
708 
709  return this->m_allocate_OutputPort[portNum].isConnected();
710  }
711 
714  {
715  FW_ASSERT(
716  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
717  static_cast<FwAssertArgType>(portNum)
718  );
719 
720  return this->m_deallocate_OutputPort[portNum].isConnected();
721  }
722 
725  {
726  FW_ASSERT(
727  (0 <= portNum) && (portNum < this->getNum_ready_OutputPorts()),
728  static_cast<FwAssertArgType>(portNum)
729  );
730 
731  return this->m_ready_OutputPort[portNum].isConnected();
732  }
733 
736  {
737  FW_ASSERT(
738  (0 <= portNum) && (portNum < this->getNum_recv_OutputPorts()),
739  static_cast<FwAssertArgType>(portNum)
740  );
741 
742  return this->m_recv_OutputPort[portNum].isConnected();
743  }
744 
747  {
748  FW_ASSERT(
749  (0 <= portNum) && (portNum < this->getNum_sendReturnOut_OutputPorts()),
750  static_cast<FwAssertArgType>(portNum)
751  );
752 
753  return this->m_sendReturnOut_OutputPort[portNum].isConnected();
754  }
755 
756  // ----------------------------------------------------------------------
757  // Port handler base-class functions for typed input ports
758  //
759  // Call these functions directly to bypass the corresponding ports
760  // ----------------------------------------------------------------------
761 
764  FwIndexType portNum,
765  Fw::Buffer& fwBuffer
766  )
767  {
768  // Make sure port number is valid
769  FW_ASSERT(
770  (0 <= portNum) && (portNum < this->getNum_recvReturnIn_InputPorts()),
771  static_cast<FwAssertArgType>(portNum)
772  );
773 
774  // Lock guard mutex before calling
775  this->lock();
776 
777  // Call handler function
778  this->recvReturnIn_handler(
779  portNum,
780  fwBuffer
781  );
782 
783  // Unlock guard mutex
784  this->unLock();
785  }
786 
789  FwIndexType portNum,
790  Fw::Buffer& fwBuffer
791  )
792  {
793  // Make sure port number is valid
794  FW_ASSERT(
795  (0 <= portNum) && (portNum < this->getNum_send_InputPorts()),
796  static_cast<FwAssertArgType>(portNum)
797  );
798 
799  // Lock guard mutex before calling
800  this->lock();
801 
802  // Call handler function
803  this->send_handler(
804  portNum,
805  fwBuffer
806  );
807 
808  // Unlock guard mutex
809  this->unLock();
810  }
811 
812  // ----------------------------------------------------------------------
813  // Invocation functions for typed output ports
814  // ----------------------------------------------------------------------
815 
818  FwIndexType portNum,
819  U32 size
820  )
821  {
822  FW_ASSERT(
823  (0 <= portNum) && (portNum < this->getNum_allocate_OutputPorts()),
824  static_cast<FwAssertArgType>(portNum)
825  );
826 
827  FW_ASSERT(
828  this->m_allocate_OutputPort[portNum].isConnected(),
829  static_cast<FwAssertArgType>(portNum)
830  );
831  return this->m_allocate_OutputPort[portNum].invoke(
832  size
833  );
834  }
835 
838  FwIndexType portNum,
839  Fw::Buffer& fwBuffer
840  )
841  {
842  FW_ASSERT(
843  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
844  static_cast<FwAssertArgType>(portNum)
845  );
846 
847  FW_ASSERT(
848  this->m_deallocate_OutputPort[portNum].isConnected(),
849  static_cast<FwAssertArgType>(portNum)
850  );
851  this->m_deallocate_OutputPort[portNum].invoke(
852  fwBuffer
853  );
854  }
855 
858  {
859  FW_ASSERT(
860  (0 <= portNum) && (portNum < this->getNum_ready_OutputPorts()),
861  static_cast<FwAssertArgType>(portNum)
862  );
863 
864  FW_ASSERT(
865  this->m_ready_OutputPort[portNum].isConnected(),
866  static_cast<FwAssertArgType>(portNum)
867  );
868  this->m_ready_OutputPort[portNum].invoke();
869  }
870 
873  FwIndexType portNum,
874  Fw::Buffer& buffer,
875  const Drv::ByteStreamStatus& status
876  )
877  {
878  FW_ASSERT(
879  (0 <= portNum) && (portNum < this->getNum_recv_OutputPorts()),
880  static_cast<FwAssertArgType>(portNum)
881  );
882 
883  FW_ASSERT(
884  this->m_recv_OutputPort[portNum].isConnected(),
885  static_cast<FwAssertArgType>(portNum)
886  );
887  this->m_recv_OutputPort[portNum].invoke(
888  buffer,
889  status
890  );
891  }
892 
895  FwIndexType portNum,
896  Fw::Buffer& buffer,
897  const Drv::ByteStreamStatus& status
898  )
899  {
900  FW_ASSERT(
901  (0 <= portNum) && (portNum < this->getNum_sendReturnOut_OutputPorts()),
902  static_cast<FwAssertArgType>(portNum)
903  );
904 
905  FW_ASSERT(
906  this->m_sendReturnOut_OutputPort[portNum].isConnected(),
907  static_cast<FwAssertArgType>(portNum)
908  );
909  this->m_sendReturnOut_OutputPort[portNum].invoke(
910  buffer,
911  status
912  );
913  }
914 
915  // ----------------------------------------------------------------------
916  // Event logging functions
917  // ----------------------------------------------------------------------
918 
921  const Fw::StringBase& device,
922  I32 error,
923  const Fw::StringBase& name
924  ) const
925  {
926  // Get the time
927  Fw::Time _logTime;
928  if (this->m_Time_OutputPort[0].isConnected()) {
929  this->m_Time_OutputPort[0].invoke(_logTime);
930  }
931 
932  FwEventIdType _id = static_cast<FwEventIdType>(0);
933 
934  _id = this->getIdBase() + EVENTID_OPENERROR;
935 
936  // Emit the event on the log port
937  if (this->m_Log_OutputPort[0].isConnected()) {
938  Fw::LogBuffer _logBuff;
940 
941 #if FW_AMPCS_COMPATIBLE
942  // Serialize the number of arguments
943  _status = _logBuff.serialize(static_cast<U8>(3));
944  FW_ASSERT(
945  _status == Fw::FW_SERIALIZE_OK,
946  static_cast<FwAssertArgType>(_status)
947  );
948 #endif
949 
950  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
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(I32))
960  );
961  FW_ASSERT(
962  _status == Fw::FW_SERIALIZE_OK,
963  static_cast<FwAssertArgType>(_status)
964  );
965 #endif
966  _status = _logBuff.serialize(error);
967  FW_ASSERT(
968  _status == Fw::FW_SERIALIZE_OK,
969  static_cast<FwAssertArgType>(_status)
970  );
971 
972  _status = name.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
973  FW_ASSERT(
974  _status == Fw::FW_SERIALIZE_OK,
975  static_cast<FwAssertArgType>(_status)
976  );
977 
978  this->m_Log_OutputPort[0].invoke(
979  _id,
980  _logTime,
982  _logBuff
983  );
984  }
985 
986  // Emit the event on the text log port
987 #if FW_ENABLE_TEXT_LOGGING
988  if (this->m_LogText_OutputPort[0].isConnected()) {
989 #if FW_OBJECT_NAMES == 1
990  const char* _formatString =
991  "(%s) %s: Error opening UART device %s: %" PRIi32 " %s";
992 #else
993  const char* _formatString =
994  "%s: Error opening UART device %s: %" PRIi32 " %s";
995 #endif
996 
997  Fw::TextLogString _logString;
998  _logString.format(
999  _formatString,
1000 #if FW_OBJECT_NAMES == 1
1001  this->m_objName.toChar(),
1002 #endif
1003  "OpenError ",
1004  device.toChar(),
1005  error,
1006  name.toChar()
1007  );
1008 
1009  this->m_LogText_OutputPort[0].invoke(
1010  _id,
1011  _logTime,
1013  _logString
1014  );
1015  }
1016 #endif
1017  }
1018 
1021  const Fw::StringBase& device,
1022  I32 error
1023  ) const
1024  {
1025  // Get the time
1026  Fw::Time _logTime;
1027  if (this->m_Time_OutputPort[0].isConnected()) {
1028  this->m_Time_OutputPort[0].invoke(_logTime);
1029  }
1030 
1031  FwEventIdType _id = static_cast<FwEventIdType>(0);
1032 
1033  _id = this->getIdBase() + EVENTID_CONFIGERROR;
1034 
1035  // Emit the event on the log port
1036  if (this->m_Log_OutputPort[0].isConnected()) {
1037  Fw::LogBuffer _logBuff;
1039 
1040 #if FW_AMPCS_COMPATIBLE
1041  // Serialize the number of arguments
1042  _status = _logBuff.serialize(static_cast<U8>(2));
1043  FW_ASSERT(
1044  _status == Fw::FW_SERIALIZE_OK,
1045  static_cast<FwAssertArgType>(_status)
1046  );
1047 #endif
1048 
1049  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1050  FW_ASSERT(
1051  _status == Fw::FW_SERIALIZE_OK,
1052  static_cast<FwAssertArgType>(_status)
1053  );
1054 
1055 #if FW_AMPCS_COMPATIBLE
1056  // Serialize the argument size
1057  _status = _logBuff.serialize(
1058  static_cast<U8>(sizeof(I32))
1059  );
1060  FW_ASSERT(
1061  _status == Fw::FW_SERIALIZE_OK,
1062  static_cast<FwAssertArgType>(_status)
1063  );
1064 #endif
1065  _status = _logBuff.serialize(error);
1066  FW_ASSERT(
1067  _status == Fw::FW_SERIALIZE_OK,
1068  static_cast<FwAssertArgType>(_status)
1069  );
1070 
1071  this->m_Log_OutputPort[0].invoke(
1072  _id,
1073  _logTime,
1075  _logBuff
1076  );
1077  }
1078 
1079  // Emit the event on the text log port
1080 #if FW_ENABLE_TEXT_LOGGING
1081  if (this->m_LogText_OutputPort[0].isConnected()) {
1082 #if FW_OBJECT_NAMES == 1
1083  const char* _formatString =
1084  "(%s) %s: Error configuring UART device %s: %" PRIi32 "";
1085 #else
1086  const char* _formatString =
1087  "%s: Error configuring UART device %s: %" PRIi32 "";
1088 #endif
1089 
1090  Fw::TextLogString _logString;
1091  _logString.format(
1092  _formatString,
1093 #if FW_OBJECT_NAMES == 1
1094  this->m_objName.toChar(),
1095 #endif
1096  "ConfigError ",
1097  device.toChar(),
1098  error
1099  );
1100 
1101  this->m_LogText_OutputPort[0].invoke(
1102  _id,
1103  _logTime,
1105  _logString
1106  );
1107  }
1108 #endif
1109  }
1110 
1113  const Fw::StringBase& device,
1114  I32 error
1115  )
1116  {
1117  // Check throttle value
1118  if (this->m_WriteErrorThrottle >= EVENTID_WRITEERROR_THROTTLE) {
1119  return;
1120  }
1121  else {
1122  (void) this->m_WriteErrorThrottle.fetch_add(1);
1123  }
1124 
1125  // Get the time
1126  Fw::Time _logTime;
1127  if (this->m_Time_OutputPort[0].isConnected()) {
1128  this->m_Time_OutputPort[0].invoke(_logTime);
1129  }
1130 
1131  FwEventIdType _id = static_cast<FwEventIdType>(0);
1132 
1133  _id = this->getIdBase() + EVENTID_WRITEERROR;
1134 
1135  // Emit the event on the log port
1136  if (this->m_Log_OutputPort[0].isConnected()) {
1137  Fw::LogBuffer _logBuff;
1139 
1140 #if FW_AMPCS_COMPATIBLE
1141  // Serialize the number of arguments
1142  _status = _logBuff.serialize(static_cast<U8>(2));
1143  FW_ASSERT(
1144  _status == Fw::FW_SERIALIZE_OK,
1145  static_cast<FwAssertArgType>(_status)
1146  );
1147 #endif
1148 
1149  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1150  FW_ASSERT(
1151  _status == Fw::FW_SERIALIZE_OK,
1152  static_cast<FwAssertArgType>(_status)
1153  );
1154 
1155 #if FW_AMPCS_COMPATIBLE
1156  // Serialize the argument size
1157  _status = _logBuff.serialize(
1158  static_cast<U8>(sizeof(I32))
1159  );
1160  FW_ASSERT(
1161  _status == Fw::FW_SERIALIZE_OK,
1162  static_cast<FwAssertArgType>(_status)
1163  );
1164 #endif
1165  _status = _logBuff.serialize(error);
1166  FW_ASSERT(
1167  _status == Fw::FW_SERIALIZE_OK,
1168  static_cast<FwAssertArgType>(_status)
1169  );
1170 
1171  this->m_Log_OutputPort[0].invoke(
1172  _id,
1173  _logTime,
1175  _logBuff
1176  );
1177  }
1178 
1179  // Emit the event on the text log port
1180 #if FW_ENABLE_TEXT_LOGGING
1181  if (this->m_LogText_OutputPort[0].isConnected()) {
1182 #if FW_OBJECT_NAMES == 1
1183  const char* _formatString =
1184  "(%s) %s: Error writing UART device %s: %" PRIi32 "";
1185 #else
1186  const char* _formatString =
1187  "%s: Error writing UART device %s: %" PRIi32 "";
1188 #endif
1189 
1190  Fw::TextLogString _logString;
1191  _logString.format(
1192  _formatString,
1193 #if FW_OBJECT_NAMES == 1
1194  this->m_objName.toChar(),
1195 #endif
1196  "WriteError ",
1197  device.toChar(),
1198  error
1199  );
1200 
1201  this->m_LogText_OutputPort[0].invoke(
1202  _id,
1203  _logTime,
1205  _logString
1206  );
1207  }
1208 #endif
1209  }
1210 
1213  const Fw::StringBase& device,
1214  I32 error
1215  )
1216  {
1217  // Check throttle value
1218  if (this->m_ReadErrorThrottle >= EVENTID_READERROR_THROTTLE) {
1219  return;
1220  }
1221  else {
1222  (void) this->m_ReadErrorThrottle.fetch_add(1);
1223  }
1224 
1225  // Get the time
1226  Fw::Time _logTime;
1227  if (this->m_Time_OutputPort[0].isConnected()) {
1228  this->m_Time_OutputPort[0].invoke(_logTime);
1229  }
1230 
1231  FwEventIdType _id = static_cast<FwEventIdType>(0);
1232 
1233  _id = this->getIdBase() + EVENTID_READERROR;
1234 
1235  // Emit the event on the log port
1236  if (this->m_Log_OutputPort[0].isConnected()) {
1237  Fw::LogBuffer _logBuff;
1239 
1240 #if FW_AMPCS_COMPATIBLE
1241  // Serialize the number of arguments
1242  _status = _logBuff.serialize(static_cast<U8>(2));
1243  FW_ASSERT(
1244  _status == Fw::FW_SERIALIZE_OK,
1245  static_cast<FwAssertArgType>(_status)
1246  );
1247 #endif
1248 
1249  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1250  FW_ASSERT(
1251  _status == Fw::FW_SERIALIZE_OK,
1252  static_cast<FwAssertArgType>(_status)
1253  );
1254 
1255 #if FW_AMPCS_COMPATIBLE
1256  // Serialize the argument size
1257  _status = _logBuff.serialize(
1258  static_cast<U8>(sizeof(I32))
1259  );
1260  FW_ASSERT(
1261  _status == Fw::FW_SERIALIZE_OK,
1262  static_cast<FwAssertArgType>(_status)
1263  );
1264 #endif
1265  _status = _logBuff.serialize(error);
1266  FW_ASSERT(
1267  _status == Fw::FW_SERIALIZE_OK,
1268  static_cast<FwAssertArgType>(_status)
1269  );
1270 
1271  this->m_Log_OutputPort[0].invoke(
1272  _id,
1273  _logTime,
1275  _logBuff
1276  );
1277  }
1278 
1279  // Emit the event on the text log port
1280 #if FW_ENABLE_TEXT_LOGGING
1281  if (this->m_LogText_OutputPort[0].isConnected()) {
1282 #if FW_OBJECT_NAMES == 1
1283  const char* _formatString =
1284  "(%s) %s: Error reading UART device %s: %" PRIi32 "";
1285 #else
1286  const char* _formatString =
1287  "%s: Error reading UART device %s: %" PRIi32 "";
1288 #endif
1289 
1290  Fw::TextLogString _logString;
1291  _logString.format(
1292  _formatString,
1293 #if FW_OBJECT_NAMES == 1
1294  this->m_objName.toChar(),
1295 #endif
1296  "ReadError ",
1297  device.toChar(),
1298  error
1299  );
1300 
1301  this->m_LogText_OutputPort[0].invoke(
1302  _id,
1303  _logTime,
1305  _logString
1306  );
1307  }
1308 #endif
1309  }
1310 
1313  {
1314  // Get the time
1315  Fw::Time _logTime;
1316  if (this->m_Time_OutputPort[0].isConnected()) {
1317  this->m_Time_OutputPort[0].invoke(_logTime);
1318  }
1319 
1320  FwEventIdType _id = static_cast<FwEventIdType>(0);
1321 
1322  _id = this->getIdBase() + EVENTID_PORTOPENED;
1323 
1324  // Emit the event on the log port
1325  if (this->m_Log_OutputPort[0].isConnected()) {
1326  Fw::LogBuffer _logBuff;
1328 
1329 #if FW_AMPCS_COMPATIBLE
1330  // Serialize the number of arguments
1331  _status = _logBuff.serialize(static_cast<U8>(1));
1332  FW_ASSERT(
1333  _status == Fw::FW_SERIALIZE_OK,
1334  static_cast<FwAssertArgType>(_status)
1335  );
1336 #endif
1337 
1338  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1339  FW_ASSERT(
1340  _status == Fw::FW_SERIALIZE_OK,
1341  static_cast<FwAssertArgType>(_status)
1342  );
1343 
1344  this->m_Log_OutputPort[0].invoke(
1345  _id,
1346  _logTime,
1348  _logBuff
1349  );
1350  }
1351 
1352  // Emit the event on the text log port
1353 #if FW_ENABLE_TEXT_LOGGING
1354  if (this->m_LogText_OutputPort[0].isConnected()) {
1355 #if FW_OBJECT_NAMES == 1
1356  const char* _formatString =
1357  "(%s) %s: UART Device %s configured";
1358 #else
1359  const char* _formatString =
1360  "%s: UART Device %s configured";
1361 #endif
1362 
1363  Fw::TextLogString _logString;
1364  _logString.format(
1365  _formatString,
1366 #if FW_OBJECT_NAMES == 1
1367  this->m_objName.toChar(),
1368 #endif
1369  "PortOpened ",
1370  device.toChar()
1371  );
1372 
1373  this->m_LogText_OutputPort[0].invoke(
1374  _id,
1375  _logTime,
1377  _logString
1378  );
1379  }
1380 #endif
1381  }
1382 
1385  {
1386  // Check throttle value
1387  if (this->m_NoBuffersThrottle >= EVENTID_NOBUFFERS_THROTTLE) {
1388  return;
1389  }
1390  else {
1391  (void) this->m_NoBuffersThrottle.fetch_add(1);
1392  }
1393 
1394  // Get the time
1395  Fw::Time _logTime;
1396  if (this->m_Time_OutputPort[0].isConnected()) {
1397  this->m_Time_OutputPort[0].invoke(_logTime);
1398  }
1399 
1400  FwEventIdType _id = static_cast<FwEventIdType>(0);
1401 
1402  _id = this->getIdBase() + EVENTID_NOBUFFERS;
1403 
1404  // Emit the event on the log port
1405  if (this->m_Log_OutputPort[0].isConnected()) {
1406  Fw::LogBuffer _logBuff;
1408 
1409 #if FW_AMPCS_COMPATIBLE
1410  // Serialize the number of arguments
1411  _status = _logBuff.serialize(static_cast<U8>(1));
1412  FW_ASSERT(
1413  _status == Fw::FW_SERIALIZE_OK,
1414  static_cast<FwAssertArgType>(_status)
1415  );
1416 #endif
1417 
1418  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1419  FW_ASSERT(
1420  _status == Fw::FW_SERIALIZE_OK,
1421  static_cast<FwAssertArgType>(_status)
1422  );
1423 
1424  this->m_Log_OutputPort[0].invoke(
1425  _id,
1426  _logTime,
1428  _logBuff
1429  );
1430  }
1431 
1432  // Emit the event on the text log port
1433 #if FW_ENABLE_TEXT_LOGGING
1434  if (this->m_LogText_OutputPort[0].isConnected()) {
1435 #if FW_OBJECT_NAMES == 1
1436  const char* _formatString =
1437  "(%s) %s: UART Device %s ran out of buffers";
1438 #else
1439  const char* _formatString =
1440  "%s: UART Device %s ran out of buffers";
1441 #endif
1442 
1443  Fw::TextLogString _logString;
1444  _logString.format(
1445  _formatString,
1446 #if FW_OBJECT_NAMES == 1
1447  this->m_objName.toChar(),
1448 #endif
1449  "NoBuffers ",
1450  device.toChar()
1451  );
1452 
1453  this->m_LogText_OutputPort[0].invoke(
1454  _id,
1455  _logTime,
1457  _logString
1458  );
1459  }
1460 #endif
1461  }
1462 
1465  const Fw::StringBase& device,
1466  U32 size,
1467  U32 needed
1468  ) const
1469  {
1470  // Get the time
1471  Fw::Time _logTime;
1472  if (this->m_Time_OutputPort[0].isConnected()) {
1473  this->m_Time_OutputPort[0].invoke(_logTime);
1474  }
1475 
1476  FwEventIdType _id = static_cast<FwEventIdType>(0);
1477 
1478  _id = this->getIdBase() + EVENTID_BUFFERTOOSMALL;
1479 
1480  // Emit the event on the log port
1481  if (this->m_Log_OutputPort[0].isConnected()) {
1482  Fw::LogBuffer _logBuff;
1484 
1485 #if FW_AMPCS_COMPATIBLE
1486  // Serialize the number of arguments
1487  _status = _logBuff.serialize(static_cast<U8>(3));
1488  FW_ASSERT(
1489  _status == Fw::FW_SERIALIZE_OK,
1490  static_cast<FwAssertArgType>(_status)
1491  );
1492 #endif
1493 
1494  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1495  FW_ASSERT(
1496  _status == Fw::FW_SERIALIZE_OK,
1497  static_cast<FwAssertArgType>(_status)
1498  );
1499 
1500 #if FW_AMPCS_COMPATIBLE
1501  // Serialize the argument size
1502  _status = _logBuff.serialize(
1503  static_cast<U8>(sizeof(U32))
1504  );
1505  FW_ASSERT(
1506  _status == Fw::FW_SERIALIZE_OK,
1507  static_cast<FwAssertArgType>(_status)
1508  );
1509 #endif
1510  _status = _logBuff.serialize(size);
1511  FW_ASSERT(
1512  _status == Fw::FW_SERIALIZE_OK,
1513  static_cast<FwAssertArgType>(_status)
1514  );
1515 
1516 #if FW_AMPCS_COMPATIBLE
1517  // Serialize the argument size
1518  _status = _logBuff.serialize(
1519  static_cast<U8>(sizeof(U32))
1520  );
1521  FW_ASSERT(
1522  _status == Fw::FW_SERIALIZE_OK,
1523  static_cast<FwAssertArgType>(_status)
1524  );
1525 #endif
1526  _status = _logBuff.serialize(needed);
1527  FW_ASSERT(
1528  _status == Fw::FW_SERIALIZE_OK,
1529  static_cast<FwAssertArgType>(_status)
1530  );
1531 
1532  this->m_Log_OutputPort[0].invoke(
1533  _id,
1534  _logTime,
1536  _logBuff
1537  );
1538  }
1539 
1540  // Emit the event on the text log port
1541 #if FW_ENABLE_TEXT_LOGGING
1542  if (this->m_LogText_OutputPort[0].isConnected()) {
1543 #if FW_OBJECT_NAMES == 1
1544  const char* _formatString =
1545  "(%s) %s: UART Device %s target buffer too small. Size: %" PRIu32 " Needs: %" PRIu32 "";
1546 #else
1547  const char* _formatString =
1548  "%s: UART Device %s target buffer too small. Size: %" PRIu32 " Needs: %" PRIu32 "";
1549 #endif
1550 
1551  Fw::TextLogString _logString;
1552  _logString.format(
1553  _formatString,
1554 #if FW_OBJECT_NAMES == 1
1555  this->m_objName.toChar(),
1556 #endif
1557  "BufferTooSmall ",
1558  device.toChar(),
1559  size,
1560  needed
1561  );
1562 
1563  this->m_LogText_OutputPort[0].invoke(
1564  _id,
1565  _logTime,
1567  _logString
1568  );
1569  }
1570 #endif
1571  }
1572 
1573  // ----------------------------------------------------------------------
1574  // Event throttle reset functions
1575  // ----------------------------------------------------------------------
1576 
1579  {
1580  // Reset throttle counter
1581  this->m_WriteErrorThrottle = 0;
1582  }
1583 
1586  {
1587  // Reset throttle counter
1588  this->m_ReadErrorThrottle = 0;
1589  }
1590 
1593  {
1594  // Reset throttle counter
1595  this->m_NoBuffersThrottle = 0;
1596  }
1597 
1598  // ----------------------------------------------------------------------
1599  // Telemetry write functions
1600  // ----------------------------------------------------------------------
1601 
1604  U32 arg,
1605  Fw::Time _tlmTime
1606  ) const
1607  {
1608  if (this->m_Tlm_OutputPort[0].isConnected()) {
1609  if (
1610  this->m_Time_OutputPort[0].isConnected() &&
1611  (_tlmTime == Fw::ZERO_TIME)
1612  ) {
1613  this->m_Time_OutputPort[0].invoke(_tlmTime);
1614  }
1615 
1616  Fw::TlmBuffer _tlmBuff;
1617  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1618  FW_ASSERT(
1619  _stat == Fw::FW_SERIALIZE_OK,
1620  static_cast<FwAssertArgType>(_stat)
1621  );
1622 
1623  FwChanIdType _id;
1624 
1625  _id = this->getIdBase() + CHANNELID_BYTESSENT;
1626 
1627  this->m_Tlm_OutputPort[0].invoke(
1628  _id,
1629  _tlmTime,
1630  _tlmBuff
1631  );
1632  }
1633  }
1634 
1637  U32 arg,
1638  Fw::Time _tlmTime
1639  ) const
1640  {
1641  if (this->m_Tlm_OutputPort[0].isConnected()) {
1642  if (
1643  this->m_Time_OutputPort[0].isConnected() &&
1644  (_tlmTime == Fw::ZERO_TIME)
1645  ) {
1646  this->m_Time_OutputPort[0].invoke(_tlmTime);
1647  }
1648 
1649  Fw::TlmBuffer _tlmBuff;
1650  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1651  FW_ASSERT(
1652  _stat == Fw::FW_SERIALIZE_OK,
1653  static_cast<FwAssertArgType>(_stat)
1654  );
1655 
1656  FwChanIdType _id;
1657 
1658  _id = this->getIdBase() + CHANNELID_BYTESRECV;
1659 
1660  this->m_Tlm_OutputPort[0].invoke(
1661  _id,
1662  _tlmTime,
1663  _tlmBuff
1664  );
1665  }
1666  }
1667 
1668  // ----------------------------------------------------------------------
1669  // Time
1670  // ----------------------------------------------------------------------
1671 
1673  getTime() const
1674  {
1675  if (this->m_Time_OutputPort[0].isConnected()) {
1676  Fw::Time _time;
1677  this->m_Time_OutputPort[0].invoke(_time);
1678  return _time;
1679  }
1680  else {
1681  return Fw::Time(TB_NONE, 0, 0);
1682  }
1683  }
1684 
1685  // ----------------------------------------------------------------------
1686  // Mutex operations for guarded ports
1687  //
1688  // You can override these operations to provide more sophisticated
1689  // synchronization
1690  // ----------------------------------------------------------------------
1691 
1694  {
1695  this->m_guardedPortMutex.lock();
1696  }
1697 
1700  {
1701  this->m_guardedPortMutex.unLock();
1702  }
1703 
1704  // ----------------------------------------------------------------------
1705  // Calls for messages received on typed input ports
1706  // ----------------------------------------------------------------------
1707 
1708  void LinuxUartDriverComponentBase ::
1709  m_p_recvReturnIn_in(
1710  Fw::PassiveComponentBase* callComp,
1711  FwIndexType portNum,
1712  Fw::Buffer& fwBuffer
1713  )
1714  {
1715  FW_ASSERT(callComp);
1716  LinuxUartDriverComponentBase* compPtr = static_cast<LinuxUartDriverComponentBase*>(callComp);
1717  compPtr->recvReturnIn_handlerBase(
1718  portNum,
1719  fwBuffer
1720  );
1721  }
1722 
1723  void LinuxUartDriverComponentBase ::
1724  m_p_send_in(
1725  Fw::PassiveComponentBase* callComp,
1726  FwIndexType portNum,
1727  Fw::Buffer& fwBuffer
1728  )
1729  {
1730  FW_ASSERT(callComp);
1731  LinuxUartDriverComponentBase* compPtr = static_cast<LinuxUartDriverComponentBase*>(callComp);
1732  compPtr->send_handlerBase(
1733  portNum,
1734  fwBuffer
1735  );
1736  }
1737 
1738 }
virtual void lock()
Lock the guarded mutex.
Serialization/Deserialization operation was successful.
virtual void unLock()
Unlock the guarded mutex.
bool isConnected_deallocate_OutputPort(FwIndexType portNum)
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
void addCallPort(InputByteStreamReadyPort *callPort)
Register an input port.
Definition: Time.hpp:9
void log_WARNING_HI_BufferTooSmall(const Fw::StringBase &device, U32 size, U32 needed) const
bool isConnected_Time_OutputPort(FwIndexType portNum)
void sendReturnOut_out(FwIndexType portNum, Fw::Buffer &buffer, const Drv::ByteStreamStatus &status)
Invoke output port sendReturnOut.
void recvReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port recvReturnIn.
I32 FwEnumStoreType
bool isConnected_allocate_OutputPort(FwIndexType portNum)
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Definition: FpConfig.h:219
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
bool isConnected_sendReturnOut_OutputPort(FwIndexType portNum)
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Fw::Buffer invoke(U32 size) const
Invoke a port interface.
virtual void recvReturnIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port recvReturnIn.
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:40
U32 FwChanIdType
The type of a telemetry channel identifier.
const Time ZERO_TIME
Definition: Time.cpp:5
Fw::Buffer allocate_out(FwIndexType portNum, U32 size)
Invoke output port allocate.
LinuxUartDriverComponentBase(const char *compName="")
Construct LinuxUartDriverComponentBase object.
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
Auto-generated base for LinuxUartDriver component.
void log_WARNING_HI_WriteError(const Fw::StringBase &device, I32 error)
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
void set_sendReturnOut_OutputPort(FwIndexType portNum, Drv::InputByteStreamDataPort *port)
Connect port to sendReturnOut[portNum].
virtual void send_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port send.
void set_ready_OutputPort(FwIndexType portNum, Drv::InputByteStreamReadyPort *port)
Connect port to ready[portNum].
void init()
Object initializer.
Definition: ObjBase.cpp:26
void log_WARNING_HI_ReadError(const Fw::StringBase &device, I32 error)
U32 FwEventIdType
The type of an event identifier.
SerializeStatus
forward declaration for string
void addCallPort(InputBufferGetPort *callPort)
Register an input port.
void addCallPort(InputByteStreamDataPort *callPort)
Register an input port.
void deallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port deallocate.
Fw::InputBufferSendPort * get_recvReturnIn_InputPort(FwIndexType portNum)
Status returned by the send call.
#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
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:95
void invoke(Fw::Buffer &buffer, const Drv::ByteStreamStatus &status) const
Invoke a port interface.
void tlmWrite_BytesRecv(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void invoke(Fw::Buffer &fwBuffer) const
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void recv_out(FwIndexType portNum, Fw::Buffer &buffer, const Drv::ByteStreamStatus &status)
Invoke output port recv.
void log_WARNING_HI_WriteError_ThrottleClear()
Reset throttle value for WriteError.
const char * toChar() const
Definition: ObjectName.hpp:50
void log_WARNING_HI_OpenError(const Fw::StringBase &device, I32 error, const Fw::StringBase &name) const
A serious but recoverable event.
bool isConnected_Log_OutputPort(FwIndexType portNum)
void log_ACTIVITY_HI_PortOpened(const Fw::StringBase &device) const
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected() const
Definition: PortBase.cpp:42
void set_allocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to allocate[portNum].
#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 log_WARNING_HI_NoBuffers(const Fw::StringBase &device)
void setPortNum(FwIndexType portNum)
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
void tlmWrite_BytesSent(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
bool isConnected_recv_OutputPort(FwIndexType portNum)
Important informational events.
void init()
Initialization function.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
void init()
Initialization function.
void set_deallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to deallocate[portNum].
No time base has been established.
Definition: FpConfig.h:30
PlatformIndexType FwIndexType
void invoke() const
Invoke a port interface.
#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
Fw::InputBufferSendPort * get_send_InputPort(FwIndexType portNum)
void ready_out(FwIndexType portNum)
Invoke output port ready.
void init()
Initialization function.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
virtual ~LinuxUartDriverComponentBase()
Destroy LinuxUartDriverComponentBase object.
bool isConnected_ready_OutputPort(FwIndexType portNum)
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
Definition: StringBase.cpp:142
void log_WARNING_HI_NoBuffers_ThrottleClear()
Reset throttle value for NoBuffers.
void set_recv_OutputPort(FwIndexType portNum, Drv::InputByteStreamDataPort *port)
Connect port to recv[portNum].
void init()
Initialization function.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
virtual const CHAR * toChar() const =0
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34
void log_WARNING_HI_ReadError_ThrottleClear()
Reset throttle value for ReadError.
void send_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port send.
void log_WARNING_HI_ConfigError(const Fw::StringBase &device, I32 error) const