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 run
51  for (
52  FwIndexType port = 0;
53  port < static_cast<FwIndexType>(this->getNum_run_InputPorts());
54  port++
55  ) {
56  this->m_run_InputPort[port].init();
57  this->m_run_InputPort[port].addCallComp(
58  this,
59  m_p_run_in
60  );
61  this->m_run_InputPort[port].setPortNum(port);
62 
63 #if FW_OBJECT_NAMES == 1
64  Fw::ObjectName portName;
65  portName.format(
66  "%s_run_InputPort[%" PRI_FwIndexType "]",
67  this->m_objName.toChar(),
68  port
69  );
70  this->m_run_InputPort[port].setObjName(portName.toChar());
71 #endif
72  }
73 
74  // Connect input port send
75  for (
76  FwIndexType port = 0;
77  port < static_cast<FwIndexType>(this->getNum_send_InputPorts());
78  port++
79  ) {
80  this->m_send_InputPort[port].init();
81  this->m_send_InputPort[port].addCallComp(
82  this,
83  m_p_send_in
84  );
85  this->m_send_InputPort[port].setPortNum(port);
86 
87 #if FW_OBJECT_NAMES == 1
88  Fw::ObjectName portName;
89  portName.format(
90  "%s_send_InputPort[%" PRI_FwIndexType "]",
91  this->m_objName.toChar(),
92  port
93  );
94  this->m_send_InputPort[port].setObjName(portName.toChar());
95 #endif
96  }
97 
98  // Connect output port Log
99  for (
100  FwIndexType port = 0;
101  port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
102  port++
103  ) {
104  this->m_Log_OutputPort[port].init();
105 
106 #if FW_OBJECT_NAMES == 1
107  Fw::ObjectName portName;
108  portName.format(
109  "%s_Log_OutputPort[%" PRI_FwIndexType "]",
110  this->m_objName.toChar(),
111  port
112  );
113  this->m_Log_OutputPort[port].setObjName(portName.toChar());
114 #endif
115  }
116 
117 #if FW_ENABLE_TEXT_LOGGING == 1
118  // Connect output port LogText
119  for (
120  FwIndexType port = 0;
121  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
122  port++
123  ) {
124  this->m_LogText_OutputPort[port].init();
125 
126 #if FW_OBJECT_NAMES == 1
127  Fw::ObjectName portName;
128  portName.format(
129  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
130  this->m_objName.toChar(),
131  port
132  );
133  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
134 #endif
135  }
136 #endif
137 
138  // Connect output port Time
139  for (
140  FwIndexType port = 0;
141  port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
142  port++
143  ) {
144  this->m_Time_OutputPort[port].init();
145 
146 #if FW_OBJECT_NAMES == 1
147  Fw::ObjectName portName;
148  portName.format(
149  "%s_Time_OutputPort[%" PRI_FwIndexType "]",
150  this->m_objName.toChar(),
151  port
152  );
153  this->m_Time_OutputPort[port].setObjName(portName.toChar());
154 #endif
155  }
156 
157  // Connect output port Tlm
158  for (
159  FwIndexType port = 0;
160  port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
161  port++
162  ) {
163  this->m_Tlm_OutputPort[port].init();
164 
165 #if FW_OBJECT_NAMES == 1
166  Fw::ObjectName portName;
167  portName.format(
168  "%s_Tlm_OutputPort[%" PRI_FwIndexType "]",
169  this->m_objName.toChar(),
170  port
171  );
172  this->m_Tlm_OutputPort[port].setObjName(portName.toChar());
173 #endif
174  }
175 
176  // Connect output port allocate
177  for (
178  FwIndexType port = 0;
179  port < static_cast<FwIndexType>(this->getNum_allocate_OutputPorts());
180  port++
181  ) {
182  this->m_allocate_OutputPort[port].init();
183 
184 #if FW_OBJECT_NAMES == 1
185  Fw::ObjectName portName;
186  portName.format(
187  "%s_allocate_OutputPort[%" PRI_FwIndexType "]",
188  this->m_objName.toChar(),
189  port
190  );
191  this->m_allocate_OutputPort[port].setObjName(portName.toChar());
192 #endif
193  }
194 
195  // Connect output port deallocate
196  for (
197  FwIndexType port = 0;
198  port < static_cast<FwIndexType>(this->getNum_deallocate_OutputPorts());
199  port++
200  ) {
201  this->m_deallocate_OutputPort[port].init();
202 
203 #if FW_OBJECT_NAMES == 1
204  Fw::ObjectName portName;
205  portName.format(
206  "%s_deallocate_OutputPort[%" PRI_FwIndexType "]",
207  this->m_objName.toChar(),
208  port
209  );
210  this->m_deallocate_OutputPort[port].setObjName(portName.toChar());
211 #endif
212  }
213 
214  // Connect output port ready
215  for (
216  FwIndexType port = 0;
217  port < static_cast<FwIndexType>(this->getNum_ready_OutputPorts());
218  port++
219  ) {
220  this->m_ready_OutputPort[port].init();
221 
222 #if FW_OBJECT_NAMES == 1
223  Fw::ObjectName portName;
224  portName.format(
225  "%s_ready_OutputPort[%" PRI_FwIndexType "]",
226  this->m_objName.toChar(),
227  port
228  );
229  this->m_ready_OutputPort[port].setObjName(portName.toChar());
230 #endif
231  }
232 
233  // Connect output port recv
234  for (
235  FwIndexType port = 0;
236  port < static_cast<FwIndexType>(this->getNum_recv_OutputPorts());
237  port++
238  ) {
239  this->m_recv_OutputPort[port].init();
240 
241 #if FW_OBJECT_NAMES == 1
242  Fw::ObjectName portName;
243  portName.format(
244  "%s_recv_OutputPort[%" PRI_FwIndexType "]",
245  this->m_objName.toChar(),
246  port
247  );
248  this->m_recv_OutputPort[port].setObjName(portName.toChar());
249 #endif
250  }
251  }
252 
253  // ----------------------------------------------------------------------
254  // Getters for typed input ports
255  // ----------------------------------------------------------------------
256 
259  {
260  FW_ASSERT(
261  (0 <= portNum) && (portNum < this->getNum_recvReturnIn_InputPorts()),
262  static_cast<FwAssertArgType>(portNum)
263  );
264 
265  return &this->m_recvReturnIn_InputPort[portNum];
266  }
267 
270  {
271  FW_ASSERT(
272  (0 <= portNum) && (portNum < this->getNum_run_InputPorts()),
273  static_cast<FwAssertArgType>(portNum)
274  );
275 
276  return &this->m_run_InputPort[portNum];
277  }
278 
281  {
282  FW_ASSERT(
283  (0 <= portNum) && (portNum < this->getNum_send_InputPorts()),
284  static_cast<FwAssertArgType>(portNum)
285  );
286 
287  return &this->m_send_InputPort[portNum];
288  }
289 
290  // ----------------------------------------------------------------------
291  // Connect input ports to special output ports
292  // ----------------------------------------------------------------------
293 
296  FwIndexType portNum,
297  Fw::InputLogPort* port
298  )
299  {
300  FW_ASSERT(
301  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
302  static_cast<FwAssertArgType>(portNum)
303  );
304 
305  this->m_Log_OutputPort[portNum].addCallPort(port);
306  }
307 
308 #if FW_ENABLE_TEXT_LOGGING == 1
309 
310  void LinuxUartDriverComponentBase ::
311  set_LogText_OutputPort(
312  FwIndexType portNum,
314  )
315  {
316  FW_ASSERT(
317  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
318  static_cast<FwAssertArgType>(portNum)
319  );
320 
321  this->m_LogText_OutputPort[portNum].addCallPort(port);
322  }
323 
324 #endif
325 
328  FwIndexType portNum,
329  Fw::InputTimePort* port
330  )
331  {
332  FW_ASSERT(
333  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
334  static_cast<FwAssertArgType>(portNum)
335  );
336 
337  this->m_Time_OutputPort[portNum].addCallPort(port);
338  }
339 
342  FwIndexType portNum,
343  Fw::InputTlmPort* port
344  )
345  {
346  FW_ASSERT(
347  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
348  static_cast<FwAssertArgType>(portNum)
349  );
350 
351  this->m_Tlm_OutputPort[portNum].addCallPort(port);
352  }
353 
354  // ----------------------------------------------------------------------
355  // Connect typed input ports to typed output ports
356  // ----------------------------------------------------------------------
357 
360  FwIndexType portNum,
362  )
363  {
364  FW_ASSERT(
365  (0 <= portNum) && (portNum < this->getNum_allocate_OutputPorts()),
366  static_cast<FwAssertArgType>(portNum)
367  );
368 
369  this->m_allocate_OutputPort[portNum].addCallPort(port);
370  }
371 
374  FwIndexType portNum,
376  )
377  {
378  FW_ASSERT(
379  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
380  static_cast<FwAssertArgType>(portNum)
381  );
382 
383  this->m_deallocate_OutputPort[portNum].addCallPort(port);
384  }
385 
388  FwIndexType portNum,
390  )
391  {
392  FW_ASSERT(
393  (0 <= portNum) && (portNum < this->getNum_ready_OutputPorts()),
394  static_cast<FwAssertArgType>(portNum)
395  );
396 
397  this->m_ready_OutputPort[portNum].addCallPort(port);
398  }
399 
402  FwIndexType portNum,
404  )
405  {
406  FW_ASSERT(
407  (0 <= portNum) && (portNum < this->getNum_recv_OutputPorts()),
408  static_cast<FwAssertArgType>(portNum)
409  );
410 
411  this->m_recv_OutputPort[portNum].addCallPort(port);
412  }
413 
414 #if FW_PORT_SERIALIZATION
415 
416  // ----------------------------------------------------------------------
417  // Connect serial input ports to special output ports
418  // ----------------------------------------------------------------------
419 
422  FwIndexType portNum,
423  Fw::InputSerializePort* port
424  )
425  {
426  FW_ASSERT(
427  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
428  static_cast<FwAssertArgType>(portNum)
429  );
430 
431  this->m_Log_OutputPort[portNum].registerSerialPort(port);
432  }
433 
434 #if FW_ENABLE_TEXT_LOGGING == 1
435 
436  void LinuxUartDriverComponentBase ::
437  set_LogText_OutputPort(
438  FwIndexType portNum,
439  Fw::InputSerializePort* port
440  )
441  {
442  FW_ASSERT(
443  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
444  static_cast<FwAssertArgType>(portNum)
445  );
446 
447  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
448  }
449 
450 #endif
451 
454  FwIndexType portNum,
455  Fw::InputSerializePort* port
456  )
457  {
458  FW_ASSERT(
459  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
460  static_cast<FwAssertArgType>(portNum)
461  );
462 
463  this->m_Time_OutputPort[portNum].registerSerialPort(port);
464  }
465 
468  FwIndexType portNum,
469  Fw::InputSerializePort* port
470  )
471  {
472  FW_ASSERT(
473  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
474  static_cast<FwAssertArgType>(portNum)
475  );
476 
477  this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
478  }
479 
480 #endif
481 
482 #if FW_PORT_SERIALIZATION
483 
484  // ----------------------------------------------------------------------
485  // Connect serial input ports to typed output ports
486  // ----------------------------------------------------------------------
487 
490  FwIndexType portNum,
491  Fw::InputSerializePort* port
492  )
493  {
494  FW_ASSERT(
495  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
496  static_cast<FwAssertArgType>(portNum)
497  );
498 
499  this->m_deallocate_OutputPort[portNum].registerSerialPort(port);
500  }
501 
504  FwIndexType portNum,
505  Fw::InputSerializePort* port
506  )
507  {
508  FW_ASSERT(
509  (0 <= portNum) && (portNum < this->getNum_ready_OutputPorts()),
510  static_cast<FwAssertArgType>(portNum)
511  );
512 
513  this->m_ready_OutputPort[portNum].registerSerialPort(port);
514  }
515 
518  FwIndexType portNum,
519  Fw::InputSerializePort* port
520  )
521  {
522  FW_ASSERT(
523  (0 <= portNum) && (portNum < this->getNum_recv_OutputPorts()),
524  static_cast<FwAssertArgType>(portNum)
525  );
526 
527  this->m_recv_OutputPort[portNum].registerSerialPort(port);
528  }
529 
530 #endif
531 
532  // ----------------------------------------------------------------------
533  // Component construction and destruction
534  // ----------------------------------------------------------------------
535 
537  LinuxUartDriverComponentBase(const char* compName) :
538  Fw::PassiveComponentBase(compName)
539  {
540  this->m_WriteErrorThrottle = 0;
541  this->m_ReadErrorThrottle = 0;
542  this->m_NoBuffersThrottle = 0;
543  }
544 
547  {
548 
549  }
550 
551  // ----------------------------------------------------------------------
552  // Getters for numbers of typed input ports
553  // ----------------------------------------------------------------------
554 
557  {
558  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_recvReturnIn_InputPort));
559  }
560 
563  {
564  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_run_InputPort));
565  }
566 
569  {
570  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_send_InputPort));
571  }
572 
573  // ----------------------------------------------------------------------
574  // Getters for numbers of special output ports
575  // ----------------------------------------------------------------------
576 
579  {
580  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Log_OutputPort));
581  }
582 
583 #if FW_ENABLE_TEXT_LOGGING == 1
584 
585  FwIndexType LinuxUartDriverComponentBase ::
586  getNum_LogText_OutputPorts() const
587  {
588  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
589  }
590 
591 #endif
592 
595  {
596  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Time_OutputPort));
597  }
598 
601  {
602  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Tlm_OutputPort));
603  }
604 
605  // ----------------------------------------------------------------------
606  // Getters for numbers of typed output ports
607  // ----------------------------------------------------------------------
608 
611  {
612  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_allocate_OutputPort));
613  }
614 
617  {
618  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_deallocate_OutputPort));
619  }
620 
623  {
624  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_ready_OutputPort));
625  }
626 
629  {
630  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_recv_OutputPort));
631  }
632 
633  // ----------------------------------------------------------------------
634  // Connection status queries for special output ports
635  // ----------------------------------------------------------------------
636 
639  {
640  FW_ASSERT(
641  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
642  static_cast<FwAssertArgType>(portNum)
643  );
644 
645  return this->m_Log_OutputPort[portNum].isConnected();
646  }
647 
648 #if FW_ENABLE_TEXT_LOGGING == 1
649 
650  bool LinuxUartDriverComponentBase ::
651  isConnected_LogText_OutputPort(FwIndexType portNum)
652  {
653  FW_ASSERT(
654  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
655  static_cast<FwAssertArgType>(portNum)
656  );
657 
658  return this->m_LogText_OutputPort[portNum].isConnected();
659  }
660 
661 #endif
662 
665  {
666  FW_ASSERT(
667  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
668  static_cast<FwAssertArgType>(portNum)
669  );
670 
671  return this->m_Time_OutputPort[portNum].isConnected();
672  }
673 
676  {
677  FW_ASSERT(
678  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
679  static_cast<FwAssertArgType>(portNum)
680  );
681 
682  return this->m_Tlm_OutputPort[portNum].isConnected();
683  }
684 
685  // ----------------------------------------------------------------------
686  // Connection status queries for typed output ports
687  // ----------------------------------------------------------------------
688 
691  {
692  FW_ASSERT(
693  (0 <= portNum) && (portNum < this->getNum_allocate_OutputPorts()),
694  static_cast<FwAssertArgType>(portNum)
695  );
696 
697  return this->m_allocate_OutputPort[portNum].isConnected();
698  }
699 
702  {
703  FW_ASSERT(
704  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
705  static_cast<FwAssertArgType>(portNum)
706  );
707 
708  return this->m_deallocate_OutputPort[portNum].isConnected();
709  }
710 
713  {
714  FW_ASSERT(
715  (0 <= portNum) && (portNum < this->getNum_ready_OutputPorts()),
716  static_cast<FwAssertArgType>(portNum)
717  );
718 
719  return this->m_ready_OutputPort[portNum].isConnected();
720  }
721 
724  {
725  FW_ASSERT(
726  (0 <= portNum) && (portNum < this->getNum_recv_OutputPorts()),
727  static_cast<FwAssertArgType>(portNum)
728  );
729 
730  return this->m_recv_OutputPort[portNum].isConnected();
731  }
732 
733  // ----------------------------------------------------------------------
734  // Port handler base-class functions for typed input ports
735  //
736  // Call these functions directly to bypass the corresponding ports
737  // ----------------------------------------------------------------------
738 
741  FwIndexType portNum,
742  Fw::Buffer& fwBuffer
743  )
744  {
745  // Make sure port number is valid
746  FW_ASSERT(
747  (0 <= portNum) && (portNum < this->getNum_recvReturnIn_InputPorts()),
748  static_cast<FwAssertArgType>(portNum)
749  );
750 
751  // Lock guard mutex before calling
752  this->lock();
753 
754  // Call handler function
755  this->recvReturnIn_handler(
756  portNum,
757  fwBuffer
758  );
759 
760  // Unlock guard mutex
761  this->unLock();
762  }
763 
766  FwIndexType portNum,
767  U32 context
768  )
769  {
770  // Make sure port number is valid
771  FW_ASSERT(
772  (0 <= portNum) && (portNum < this->getNum_run_InputPorts()),
773  static_cast<FwAssertArgType>(portNum)
774  );
775 
776  // Call handler function
777  this->run_handler(
778  portNum,
779  context
780  );
781  }
782 
785  FwIndexType portNum,
786  Fw::Buffer& sendBuffer
787  )
788  {
789  // Make sure port number is valid
790  FW_ASSERT(
791  (0 <= portNum) && (portNum < this->getNum_send_InputPorts()),
792  static_cast<FwAssertArgType>(portNum)
793  );
794 
795  Drv::ByteStreamStatus retVal;
796 
797  // Lock guard mutex before calling
798  this->lock();
799 
800  // Call handler function
801  retVal = this->send_handler(
802  portNum,
803  sendBuffer
804  );
805 
806  // Unlock guard mutex
807  this->unLock();
808 
809  return retVal;
810  }
811 
812  // ----------------------------------------------------------------------
813  // Invocation functions for typed output ports
814  // ----------------------------------------------------------------------
815 
818  FwIndexType portNum,
819  FwSizeType 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 
893  // ----------------------------------------------------------------------
894  // Event logging functions
895  // ----------------------------------------------------------------------
896 
899  const Fw::StringBase& device,
900  I32 error,
901  const Fw::StringBase& name
902  ) const
903  {
904  // Get the time
905  Fw::Time _logTime;
906  if (this->m_Time_OutputPort[0].isConnected()) {
907  this->m_Time_OutputPort[0].invoke(_logTime);
908  }
909 
910  FwEventIdType _id = static_cast<FwEventIdType>(0);
911 
912  _id = this->getIdBase() + EVENTID_OPENERROR;
913 
914  // Emit the event on the log port
915  if (this->m_Log_OutputPort[0].isConnected()) {
916  Fw::LogBuffer _logBuff;
918 
919 #if FW_AMPCS_COMPATIBLE
920  // Serialize the number of arguments
921  _status = _logBuff.serializeFrom(static_cast<U8>(3));
922  FW_ASSERT(
923  _status == Fw::FW_SERIALIZE_OK,
924  static_cast<FwAssertArgType>(_status)
925  );
926 #endif
927 
928  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
929  FW_ASSERT(
930  _status == Fw::FW_SERIALIZE_OK,
931  static_cast<FwAssertArgType>(_status)
932  );
933 
934 #if FW_AMPCS_COMPATIBLE
935  // Serialize the argument size
936  _status = _logBuff.serializeFrom(
937  static_cast<U8>(sizeof(I32))
938  );
939  FW_ASSERT(
940  _status == Fw::FW_SERIALIZE_OK,
941  static_cast<FwAssertArgType>(_status)
942  );
943 #endif
944  _status = _logBuff.serializeFrom(error);
945  FW_ASSERT(
946  _status == Fw::FW_SERIALIZE_OK,
947  static_cast<FwAssertArgType>(_status)
948  );
949 
950  _status = name.serializeTo(_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  this->m_Log_OutputPort[0].invoke(
957  _id,
958  _logTime,
960  _logBuff
961  );
962  }
963 
964  // Emit the event on the text log port
965 #if FW_ENABLE_TEXT_LOGGING
966  if (this->m_LogText_OutputPort[0].isConnected()) {
967 #if FW_OBJECT_NAMES == 1
968  const char* _formatString =
969  "(%s) %s: Error opening UART device %s: %" PRIi32 " %s";
970 #else
971  const char* _formatString =
972  "%s: Error opening UART device %s: %" PRIi32 " %s";
973 #endif
974 
975  Fw::TextLogString _logString;
976  _logString.format(
977  _formatString,
978 #if FW_OBJECT_NAMES == 1
979  this->m_objName.toChar(),
980 #endif
981  "OpenError ",
982  device.toChar(),
983  error,
984  name.toChar()
985  );
986 
987  this->m_LogText_OutputPort[0].invoke(
988  _id,
989  _logTime,
991  _logString
992  );
993  }
994 #endif
995  }
996 
999  const Fw::StringBase& device,
1000  I32 error
1001  ) const
1002  {
1003  // Get the time
1004  Fw::Time _logTime;
1005  if (this->m_Time_OutputPort[0].isConnected()) {
1006  this->m_Time_OutputPort[0].invoke(_logTime);
1007  }
1008 
1009  FwEventIdType _id = static_cast<FwEventIdType>(0);
1010 
1011  _id = this->getIdBase() + EVENTID_CONFIGERROR;
1012 
1013  // Emit the event on the log port
1014  if (this->m_Log_OutputPort[0].isConnected()) {
1015  Fw::LogBuffer _logBuff;
1017 
1018 #if FW_AMPCS_COMPATIBLE
1019  // Serialize the number of arguments
1020  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1021  FW_ASSERT(
1022  _status == Fw::FW_SERIALIZE_OK,
1023  static_cast<FwAssertArgType>(_status)
1024  );
1025 #endif
1026 
1027  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1028  FW_ASSERT(
1029  _status == Fw::FW_SERIALIZE_OK,
1030  static_cast<FwAssertArgType>(_status)
1031  );
1032 
1033 #if FW_AMPCS_COMPATIBLE
1034  // Serialize the argument size
1035  _status = _logBuff.serializeFrom(
1036  static_cast<U8>(sizeof(I32))
1037  );
1038  FW_ASSERT(
1039  _status == Fw::FW_SERIALIZE_OK,
1040  static_cast<FwAssertArgType>(_status)
1041  );
1042 #endif
1043  _status = _logBuff.serializeFrom(error);
1044  FW_ASSERT(
1045  _status == Fw::FW_SERIALIZE_OK,
1046  static_cast<FwAssertArgType>(_status)
1047  );
1048 
1049  this->m_Log_OutputPort[0].invoke(
1050  _id,
1051  _logTime,
1053  _logBuff
1054  );
1055  }
1056 
1057  // Emit the event on the text log port
1058 #if FW_ENABLE_TEXT_LOGGING
1059  if (this->m_LogText_OutputPort[0].isConnected()) {
1060 #if FW_OBJECT_NAMES == 1
1061  const char* _formatString =
1062  "(%s) %s: Error configuring UART device %s: %" PRIi32 "";
1063 #else
1064  const char* _formatString =
1065  "%s: Error configuring UART device %s: %" PRIi32 "";
1066 #endif
1067 
1068  Fw::TextLogString _logString;
1069  _logString.format(
1070  _formatString,
1071 #if FW_OBJECT_NAMES == 1
1072  this->m_objName.toChar(),
1073 #endif
1074  "ConfigError ",
1075  device.toChar(),
1076  error
1077  );
1078 
1079  this->m_LogText_OutputPort[0].invoke(
1080  _id,
1081  _logTime,
1083  _logString
1084  );
1085  }
1086 #endif
1087  }
1088 
1091  const Fw::StringBase& device,
1092  I32 error
1093  )
1094  {
1095  // Check throttle value
1096  if (this->m_WriteErrorThrottle >= EVENTID_WRITEERROR_THROTTLE) {
1097  return;
1098  }
1099  else {
1100  (void) this->m_WriteErrorThrottle.fetch_add(1);
1101  }
1102 
1103  // Get the time
1104  Fw::Time _logTime;
1105  if (this->m_Time_OutputPort[0].isConnected()) {
1106  this->m_Time_OutputPort[0].invoke(_logTime);
1107  }
1108 
1109  FwEventIdType _id = static_cast<FwEventIdType>(0);
1110 
1111  _id = this->getIdBase() + EVENTID_WRITEERROR;
1112 
1113  // Emit the event on the log port
1114  if (this->m_Log_OutputPort[0].isConnected()) {
1115  Fw::LogBuffer _logBuff;
1117 
1118 #if FW_AMPCS_COMPATIBLE
1119  // Serialize the number of arguments
1120  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1121  FW_ASSERT(
1122  _status == Fw::FW_SERIALIZE_OK,
1123  static_cast<FwAssertArgType>(_status)
1124  );
1125 #endif
1126 
1127  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1128  FW_ASSERT(
1129  _status == Fw::FW_SERIALIZE_OK,
1130  static_cast<FwAssertArgType>(_status)
1131  );
1132 
1133 #if FW_AMPCS_COMPATIBLE
1134  // Serialize the argument size
1135  _status = _logBuff.serializeFrom(
1136  static_cast<U8>(sizeof(I32))
1137  );
1138  FW_ASSERT(
1139  _status == Fw::FW_SERIALIZE_OK,
1140  static_cast<FwAssertArgType>(_status)
1141  );
1142 #endif
1143  _status = _logBuff.serializeFrom(error);
1144  FW_ASSERT(
1145  _status == Fw::FW_SERIALIZE_OK,
1146  static_cast<FwAssertArgType>(_status)
1147  );
1148 
1149  this->m_Log_OutputPort[0].invoke(
1150  _id,
1151  _logTime,
1153  _logBuff
1154  );
1155  }
1156 
1157  // Emit the event on the text log port
1158 #if FW_ENABLE_TEXT_LOGGING
1159  if (this->m_LogText_OutputPort[0].isConnected()) {
1160 #if FW_OBJECT_NAMES == 1
1161  const char* _formatString =
1162  "(%s) %s: Error writing UART device %s: %" PRIi32 "";
1163 #else
1164  const char* _formatString =
1165  "%s: Error writing UART device %s: %" PRIi32 "";
1166 #endif
1167 
1168  Fw::TextLogString _logString;
1169  _logString.format(
1170  _formatString,
1171 #if FW_OBJECT_NAMES == 1
1172  this->m_objName.toChar(),
1173 #endif
1174  "WriteError ",
1175  device.toChar(),
1176  error
1177  );
1178 
1179  this->m_LogText_OutputPort[0].invoke(
1180  _id,
1181  _logTime,
1183  _logString
1184  );
1185  }
1186 #endif
1187  }
1188 
1191  const Fw::StringBase& device,
1192  I32 error
1193  )
1194  {
1195  // Check throttle value
1196  if (this->m_ReadErrorThrottle >= EVENTID_READERROR_THROTTLE) {
1197  return;
1198  }
1199  else {
1200  (void) this->m_ReadErrorThrottle.fetch_add(1);
1201  }
1202 
1203  // Get the time
1204  Fw::Time _logTime;
1205  if (this->m_Time_OutputPort[0].isConnected()) {
1206  this->m_Time_OutputPort[0].invoke(_logTime);
1207  }
1208 
1209  FwEventIdType _id = static_cast<FwEventIdType>(0);
1210 
1211  _id = this->getIdBase() + EVENTID_READERROR;
1212 
1213  // Emit the event on the log port
1214  if (this->m_Log_OutputPort[0].isConnected()) {
1215  Fw::LogBuffer _logBuff;
1217 
1218 #if FW_AMPCS_COMPATIBLE
1219  // Serialize the number of arguments
1220  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1221  FW_ASSERT(
1222  _status == Fw::FW_SERIALIZE_OK,
1223  static_cast<FwAssertArgType>(_status)
1224  );
1225 #endif
1226 
1227  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1228  FW_ASSERT(
1229  _status == Fw::FW_SERIALIZE_OK,
1230  static_cast<FwAssertArgType>(_status)
1231  );
1232 
1233 #if FW_AMPCS_COMPATIBLE
1234  // Serialize the argument size
1235  _status = _logBuff.serializeFrom(
1236  static_cast<U8>(sizeof(I32))
1237  );
1238  FW_ASSERT(
1239  _status == Fw::FW_SERIALIZE_OK,
1240  static_cast<FwAssertArgType>(_status)
1241  );
1242 #endif
1243  _status = _logBuff.serializeFrom(error);
1244  FW_ASSERT(
1245  _status == Fw::FW_SERIALIZE_OK,
1246  static_cast<FwAssertArgType>(_status)
1247  );
1248 
1249  this->m_Log_OutputPort[0].invoke(
1250  _id,
1251  _logTime,
1253  _logBuff
1254  );
1255  }
1256 
1257  // Emit the event on the text log port
1258 #if FW_ENABLE_TEXT_LOGGING
1259  if (this->m_LogText_OutputPort[0].isConnected()) {
1260 #if FW_OBJECT_NAMES == 1
1261  const char* _formatString =
1262  "(%s) %s: Error reading UART device %s: %" PRIi32 "";
1263 #else
1264  const char* _formatString =
1265  "%s: Error reading UART device %s: %" PRIi32 "";
1266 #endif
1267 
1268  Fw::TextLogString _logString;
1269  _logString.format(
1270  _formatString,
1271 #if FW_OBJECT_NAMES == 1
1272  this->m_objName.toChar(),
1273 #endif
1274  "ReadError ",
1275  device.toChar(),
1276  error
1277  );
1278 
1279  this->m_LogText_OutputPort[0].invoke(
1280  _id,
1281  _logTime,
1283  _logString
1284  );
1285  }
1286 #endif
1287  }
1288 
1291  {
1292  // Get the time
1293  Fw::Time _logTime;
1294  if (this->m_Time_OutputPort[0].isConnected()) {
1295  this->m_Time_OutputPort[0].invoke(_logTime);
1296  }
1297 
1298  FwEventIdType _id = static_cast<FwEventIdType>(0);
1299 
1300  _id = this->getIdBase() + EVENTID_PORTOPENED;
1301 
1302  // Emit the event on the log port
1303  if (this->m_Log_OutputPort[0].isConnected()) {
1304  Fw::LogBuffer _logBuff;
1306 
1307 #if FW_AMPCS_COMPATIBLE
1308  // Serialize the number of arguments
1309  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1310  FW_ASSERT(
1311  _status == Fw::FW_SERIALIZE_OK,
1312  static_cast<FwAssertArgType>(_status)
1313  );
1314 #endif
1315 
1316  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1317  FW_ASSERT(
1318  _status == Fw::FW_SERIALIZE_OK,
1319  static_cast<FwAssertArgType>(_status)
1320  );
1321 
1322  this->m_Log_OutputPort[0].invoke(
1323  _id,
1324  _logTime,
1326  _logBuff
1327  );
1328  }
1329 
1330  // Emit the event on the text log port
1331 #if FW_ENABLE_TEXT_LOGGING
1332  if (this->m_LogText_OutputPort[0].isConnected()) {
1333 #if FW_OBJECT_NAMES == 1
1334  const char* _formatString =
1335  "(%s) %s: UART Device %s configured";
1336 #else
1337  const char* _formatString =
1338  "%s: UART Device %s configured";
1339 #endif
1340 
1341  Fw::TextLogString _logString;
1342  _logString.format(
1343  _formatString,
1344 #if FW_OBJECT_NAMES == 1
1345  this->m_objName.toChar(),
1346 #endif
1347  "PortOpened ",
1348  device.toChar()
1349  );
1350 
1351  this->m_LogText_OutputPort[0].invoke(
1352  _id,
1353  _logTime,
1355  _logString
1356  );
1357  }
1358 #endif
1359  }
1360 
1363  {
1364  // Check throttle value
1365  if (this->m_NoBuffersThrottle >= EVENTID_NOBUFFERS_THROTTLE) {
1366  return;
1367  }
1368  else {
1369  (void) this->m_NoBuffersThrottle.fetch_add(1);
1370  }
1371 
1372  // Get the time
1373  Fw::Time _logTime;
1374  if (this->m_Time_OutputPort[0].isConnected()) {
1375  this->m_Time_OutputPort[0].invoke(_logTime);
1376  }
1377 
1378  FwEventIdType _id = static_cast<FwEventIdType>(0);
1379 
1380  _id = this->getIdBase() + EVENTID_NOBUFFERS;
1381 
1382  // Emit the event on the log port
1383  if (this->m_Log_OutputPort[0].isConnected()) {
1384  Fw::LogBuffer _logBuff;
1386 
1387 #if FW_AMPCS_COMPATIBLE
1388  // Serialize the number of arguments
1389  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1390  FW_ASSERT(
1391  _status == Fw::FW_SERIALIZE_OK,
1392  static_cast<FwAssertArgType>(_status)
1393  );
1394 #endif
1395 
1396  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1397  FW_ASSERT(
1398  _status == Fw::FW_SERIALIZE_OK,
1399  static_cast<FwAssertArgType>(_status)
1400  );
1401 
1402  this->m_Log_OutputPort[0].invoke(
1403  _id,
1404  _logTime,
1406  _logBuff
1407  );
1408  }
1409 
1410  // Emit the event on the text log port
1411 #if FW_ENABLE_TEXT_LOGGING
1412  if (this->m_LogText_OutputPort[0].isConnected()) {
1413 #if FW_OBJECT_NAMES == 1
1414  const char* _formatString =
1415  "(%s) %s: UART Device %s ran out of buffers";
1416 #else
1417  const char* _formatString =
1418  "%s: UART Device %s ran out of buffers";
1419 #endif
1420 
1421  Fw::TextLogString _logString;
1422  _logString.format(
1423  _formatString,
1424 #if FW_OBJECT_NAMES == 1
1425  this->m_objName.toChar(),
1426 #endif
1427  "NoBuffers ",
1428  device.toChar()
1429  );
1430 
1431  this->m_LogText_OutputPort[0].invoke(
1432  _id,
1433  _logTime,
1435  _logString
1436  );
1437  }
1438 #endif
1439  }
1440 
1443  const Fw::StringBase& device,
1444  U32 size,
1445  U32 needed
1446  ) const
1447  {
1448  // Get the time
1449  Fw::Time _logTime;
1450  if (this->m_Time_OutputPort[0].isConnected()) {
1451  this->m_Time_OutputPort[0].invoke(_logTime);
1452  }
1453 
1454  FwEventIdType _id = static_cast<FwEventIdType>(0);
1455 
1456  _id = this->getIdBase() + EVENTID_BUFFERTOOSMALL;
1457 
1458  // Emit the event on the log port
1459  if (this->m_Log_OutputPort[0].isConnected()) {
1460  Fw::LogBuffer _logBuff;
1462 
1463 #if FW_AMPCS_COMPATIBLE
1464  // Serialize the number of arguments
1465  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1466  FW_ASSERT(
1467  _status == Fw::FW_SERIALIZE_OK,
1468  static_cast<FwAssertArgType>(_status)
1469  );
1470 #endif
1471 
1472  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1473  FW_ASSERT(
1474  _status == Fw::FW_SERIALIZE_OK,
1475  static_cast<FwAssertArgType>(_status)
1476  );
1477 
1478 #if FW_AMPCS_COMPATIBLE
1479  // Serialize the argument size
1480  _status = _logBuff.serializeFrom(
1481  static_cast<U8>(sizeof(U32))
1482  );
1483  FW_ASSERT(
1484  _status == Fw::FW_SERIALIZE_OK,
1485  static_cast<FwAssertArgType>(_status)
1486  );
1487 #endif
1488  _status = _logBuff.serializeFrom(size);
1489  FW_ASSERT(
1490  _status == Fw::FW_SERIALIZE_OK,
1491  static_cast<FwAssertArgType>(_status)
1492  );
1493 
1494 #if FW_AMPCS_COMPATIBLE
1495  // Serialize the argument size
1496  _status = _logBuff.serializeFrom(
1497  static_cast<U8>(sizeof(U32))
1498  );
1499  FW_ASSERT(
1500  _status == Fw::FW_SERIALIZE_OK,
1501  static_cast<FwAssertArgType>(_status)
1502  );
1503 #endif
1504  _status = _logBuff.serializeFrom(needed);
1505  FW_ASSERT(
1506  _status == Fw::FW_SERIALIZE_OK,
1507  static_cast<FwAssertArgType>(_status)
1508  );
1509 
1510  this->m_Log_OutputPort[0].invoke(
1511  _id,
1512  _logTime,
1514  _logBuff
1515  );
1516  }
1517 
1518  // Emit the event on the text log port
1519 #if FW_ENABLE_TEXT_LOGGING
1520  if (this->m_LogText_OutputPort[0].isConnected()) {
1521 #if FW_OBJECT_NAMES == 1
1522  const char* _formatString =
1523  "(%s) %s: UART Device %s target buffer too small. Size: %" PRIu32 " Needs: %" PRIu32 "";
1524 #else
1525  const char* _formatString =
1526  "%s: UART Device %s target buffer too small. Size: %" PRIu32 " Needs: %" PRIu32 "";
1527 #endif
1528 
1529  Fw::TextLogString _logString;
1530  _logString.format(
1531  _formatString,
1532 #if FW_OBJECT_NAMES == 1
1533  this->m_objName.toChar(),
1534 #endif
1535  "BufferTooSmall ",
1536  device.toChar(),
1537  size,
1538  needed
1539  );
1540 
1541  this->m_LogText_OutputPort[0].invoke(
1542  _id,
1543  _logTime,
1545  _logString
1546  );
1547  }
1548 #endif
1549  }
1550 
1551  // ----------------------------------------------------------------------
1552  // Event throttle reset functions
1553  // ----------------------------------------------------------------------
1554 
1557  {
1558  // Reset throttle counter
1559  this->m_WriteErrorThrottle = 0;
1560  }
1561 
1564  {
1565  // Reset throttle counter
1566  this->m_ReadErrorThrottle = 0;
1567  }
1568 
1571  {
1572  // Reset throttle counter
1573  this->m_NoBuffersThrottle = 0;
1574  }
1575 
1576  // ----------------------------------------------------------------------
1577  // Telemetry write functions
1578  // ----------------------------------------------------------------------
1579 
1582  FwSizeType arg,
1583  Fw::Time _tlmTime
1584  ) const
1585  {
1586  if (this->m_Tlm_OutputPort[0].isConnected()) {
1587  if (
1588  this->m_Time_OutputPort[0].isConnected() &&
1589  (_tlmTime == Fw::ZERO_TIME)
1590  ) {
1591  this->m_Time_OutputPort[0].invoke(_tlmTime);
1592  }
1593 
1594  Fw::TlmBuffer _tlmBuff;
1595  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1596  FW_ASSERT(
1597  _stat == Fw::FW_SERIALIZE_OK,
1598  static_cast<FwAssertArgType>(_stat)
1599  );
1600 
1601  FwChanIdType _id;
1602 
1603  _id = this->getIdBase() + CHANNELID_BYTESSENT;
1604 
1605  this->m_Tlm_OutputPort[0].invoke(
1606  _id,
1607  _tlmTime,
1608  _tlmBuff
1609  );
1610  }
1611  }
1612 
1615  FwSizeType arg,
1616  Fw::Time _tlmTime
1617  ) const
1618  {
1619  if (this->m_Tlm_OutputPort[0].isConnected()) {
1620  if (
1621  this->m_Time_OutputPort[0].isConnected() &&
1622  (_tlmTime == Fw::ZERO_TIME)
1623  ) {
1624  this->m_Time_OutputPort[0].invoke(_tlmTime);
1625  }
1626 
1627  Fw::TlmBuffer _tlmBuff;
1628  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1629  FW_ASSERT(
1630  _stat == Fw::FW_SERIALIZE_OK,
1631  static_cast<FwAssertArgType>(_stat)
1632  );
1633 
1634  FwChanIdType _id;
1635 
1636  _id = this->getIdBase() + CHANNELID_BYTESRECV;
1637 
1638  this->m_Tlm_OutputPort[0].invoke(
1639  _id,
1640  _tlmTime,
1641  _tlmBuff
1642  );
1643  }
1644  }
1645 
1646  // ----------------------------------------------------------------------
1647  // Time
1648  // ----------------------------------------------------------------------
1649 
1651  getTime() const
1652  {
1653  if (this->m_Time_OutputPort[0].isConnected()) {
1654  Fw::Time _time;
1655  this->m_Time_OutputPort[0].invoke(_time);
1656  return _time;
1657  }
1658  else {
1659  return Fw::Time(TimeBase::TB_NONE, 0, 0);
1660  }
1661  }
1662 
1663  // ----------------------------------------------------------------------
1664  // Mutex operations for guarded ports
1665  //
1666  // You can override these operations to provide more sophisticated
1667  // synchronization
1668  // ----------------------------------------------------------------------
1669 
1672  {
1673  this->m_guardedPortMutex.lock();
1674  }
1675 
1678  {
1679  this->m_guardedPortMutex.unLock();
1680  }
1681 
1682  // ----------------------------------------------------------------------
1683  // Calls for messages received on typed input ports
1684  // ----------------------------------------------------------------------
1685 
1686  void LinuxUartDriverComponentBase ::
1687  m_p_recvReturnIn_in(
1688  Fw::PassiveComponentBase* callComp,
1689  FwIndexType portNum,
1690  Fw::Buffer& fwBuffer
1691  )
1692  {
1693  FW_ASSERT(callComp);
1694  LinuxUartDriverComponentBase* compPtr = static_cast<LinuxUartDriverComponentBase*>(callComp);
1695  compPtr->recvReturnIn_handlerBase(
1696  portNum,
1697  fwBuffer
1698  );
1699  }
1700 
1701  void LinuxUartDriverComponentBase ::
1702  m_p_run_in(
1703  Fw::PassiveComponentBase* callComp,
1704  FwIndexType portNum,
1705  U32 context
1706  )
1707  {
1708  FW_ASSERT(callComp);
1709  LinuxUartDriverComponentBase* compPtr = static_cast<LinuxUartDriverComponentBase*>(callComp);
1710  compPtr->run_handlerBase(
1711  portNum,
1712  context
1713  );
1714  }
1715 
1716  Drv::ByteStreamStatus LinuxUartDriverComponentBase ::
1717  m_p_send_in(
1718  Fw::PassiveComponentBase* callComp,
1719  FwIndexType portNum,
1720  Fw::Buffer& sendBuffer
1721  )
1722  {
1723  FW_ASSERT(callComp);
1724  LinuxUartDriverComponentBase* compPtr = static_cast<LinuxUartDriverComponentBase*>(callComp);
1725  return compPtr->send_handlerBase(
1726  portNum,
1727  sendBuffer
1728  );
1729  }
1730 
1731 }
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.
void log_WARNING_HI_BufferTooSmall(const Fw::StringBase &device, U32 size, U32 needed) const
bool isConnected_Time_OutputPort(FwIndexType portNum)
void recvReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port recvReturnIn.
PlatformSizeType FwSizeType
Drv::ByteStreamStatus send_handlerBase(FwIndexType portNum, Fw::Buffer &sendBuffer)
Handler base-class function for input port send.
I32 FwEnumStoreType
bool isConnected_allocate_OutputPort(FwIndexType portNum)
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Definition: FpConfig.h:207
Drv::InputByteStreamSendPort * get_send_InputPort(FwIndexType portNum)
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void init()
Initialization function.
Definition: SchedPortAc.cpp:56
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
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:41
void tlmWrite_BytesRecv(FwSizeType arg, Fw::Time _tlmTime=Fw::Time()) const
const Time ZERO_TIME
Definition: Time.cpp:5
LinuxUartDriverComponentBase(const char *compName="")
Construct LinuxUartDriverComponentBase object.
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
Auto-generated base for LinuxUartDriver component.
No time base has been established (Required)
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_ready_OutputPort(FwIndexType portNum, Drv::InputByteStreamReadyPort *port)
Connect port to ready[portNum].
void init()
Object initializer.
Definition: ObjBase.cpp:24
void log_WARNING_HI_ReadError(const Fw::StringBase &device, I32 error)
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)
FwIdType FwEventIdType
The type of an event identifier.
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:41
void init()
Initialization function.
Definition: TimePortAc.cpp:128
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:92
void invoke(Fw::Buffer &buffer, const Drv::ByteStreamStatus &status) const
Invoke a port interface.
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
FwIdType FwChanIdType
The type of a telemetry channel identifier.
void log_WARNING_HI_OpenError(const Fw::StringBase &device, I32 error, const Fw::StringBase &name) const
virtual Drv::ByteStreamStatus send_handler(FwIndexType portNum, Fw::Buffer &sendBuffer)=0
Handler for input port send.
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:38
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)
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
Fw::Buffer invoke(FwSizeType size) const
Invoke a port interface.
SerializeStatus serializeTo(SerializeBufferBase &buffer) const override
serialize contents to buffer
Definition: StringBase.cpp:142
bool isConnected_recv_OutputPort(FwIndexType portNum)
virtual void run_handler(FwIndexType portNum, U32 context)=0
Handler for input port run.
Important informational events.
Svc::InputSchedPort * get_run_InputPort(FwIndexType portNum)
void init()
Initialization function.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:62
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
void run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port run.
void init()
Initialization function.
void set_deallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to deallocate[portNum].
PlatformIndexType FwIndexType
void invoke() const
Invoke a port interface.
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:90
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void ready_out(FwIndexType portNum)
Invoke output port ready.
void init()
Initialization function.
void init()
Initialization function.
SerializeStatus serializeFrom(U8 val)
serialize 8-bit unsigned int
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)
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 tlmWrite_BytesSent(FwSizeType arg, Fw::Time _tlmTime=Fw::Time()) const
void init()
Initialization function.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Fw::Buffer allocate_out(FwIndexType portNum, FwSizeType size)
Invoke output port allocate.
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 log_WARNING_HI_ConfigError(const Fw::StringBase &device, I32 error) const