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  // Connection status queries for special output ports
553  // ----------------------------------------------------------------------
554 
557  {
558  FW_ASSERT(
559  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
560  static_cast<FwAssertArgType>(portNum)
561  );
562 
563  return this->m_Log_OutputPort[portNum].isConnected();
564  }
565 
566 #if FW_ENABLE_TEXT_LOGGING == 1
567 
568  bool LinuxUartDriverComponentBase ::
569  isConnected_LogText_OutputPort(FwIndexType portNum)
570  {
571  FW_ASSERT(
572  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
573  static_cast<FwAssertArgType>(portNum)
574  );
575 
576  return this->m_LogText_OutputPort[portNum].isConnected();
577  }
578 
579 #endif
580 
583  {
584  FW_ASSERT(
585  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
586  static_cast<FwAssertArgType>(portNum)
587  );
588 
589  return this->m_Time_OutputPort[portNum].isConnected();
590  }
591 
594  {
595  FW_ASSERT(
596  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
597  static_cast<FwAssertArgType>(portNum)
598  );
599 
600  return this->m_Tlm_OutputPort[portNum].isConnected();
601  }
602 
603  // ----------------------------------------------------------------------
604  // Connection status queries for typed output ports
605  // ----------------------------------------------------------------------
606 
609  {
610  FW_ASSERT(
611  (0 <= portNum) && (portNum < this->getNum_allocate_OutputPorts()),
612  static_cast<FwAssertArgType>(portNum)
613  );
614 
615  return this->m_allocate_OutputPort[portNum].isConnected();
616  }
617 
620  {
621  FW_ASSERT(
622  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
623  static_cast<FwAssertArgType>(portNum)
624  );
625 
626  return this->m_deallocate_OutputPort[portNum].isConnected();
627  }
628 
631  {
632  FW_ASSERT(
633  (0 <= portNum) && (portNum < this->getNum_ready_OutputPorts()),
634  static_cast<FwAssertArgType>(portNum)
635  );
636 
637  return this->m_ready_OutputPort[portNum].isConnected();
638  }
639 
642  {
643  FW_ASSERT(
644  (0 <= portNum) && (portNum < this->getNum_recv_OutputPorts()),
645  static_cast<FwAssertArgType>(portNum)
646  );
647 
648  return this->m_recv_OutputPort[portNum].isConnected();
649  }
650 
651  // ----------------------------------------------------------------------
652  // Port handler base-class functions for typed input ports
653  //
654  // Call these functions directly to bypass the corresponding ports
655  // ----------------------------------------------------------------------
656 
659  FwIndexType portNum,
660  Fw::Buffer& fwBuffer
661  )
662  {
663  // Make sure port number is valid
664  FW_ASSERT(
665  (0 <= portNum) && (portNum < this->getNum_recvReturnIn_InputPorts()),
666  static_cast<FwAssertArgType>(portNum)
667  );
668 
669  // Lock guard mutex before calling
670  this->lock();
671 
672  // Call handler function
673  this->recvReturnIn_handler(
674  portNum,
675  fwBuffer
676  );
677 
678  // Unlock guard mutex
679  this->unLock();
680  }
681 
684  FwIndexType portNum,
685  U32 context
686  )
687  {
688  // Make sure port number is valid
689  FW_ASSERT(
690  (0 <= portNum) && (portNum < this->getNum_run_InputPorts()),
691  static_cast<FwAssertArgType>(portNum)
692  );
693 
694  // Call handler function
695  this->run_handler(
696  portNum,
697  context
698  );
699  }
700 
703  FwIndexType portNum,
704  Fw::Buffer& sendBuffer
705  )
706  {
707  // Make sure port number is valid
708  FW_ASSERT(
709  (0 <= portNum) && (portNum < this->getNum_send_InputPorts()),
710  static_cast<FwAssertArgType>(portNum)
711  );
712 
713  Drv::ByteStreamStatus retVal;
714 
715  // Lock guard mutex before calling
716  this->lock();
717 
718  // Call handler function
719  retVal = this->send_handler(
720  portNum,
721  sendBuffer
722  );
723 
724  // Unlock guard mutex
725  this->unLock();
726 
727  return retVal;
728  }
729 
730  // ----------------------------------------------------------------------
731  // Invocation functions for typed output ports
732  // ----------------------------------------------------------------------
733 
736  FwIndexType portNum,
737  FwSizeType size
738  )
739  {
740  FW_ASSERT(
741  (0 <= portNum) && (portNum < this->getNum_allocate_OutputPorts()),
742  static_cast<FwAssertArgType>(portNum)
743  );
744 
745  FW_ASSERT(
746  this->m_allocate_OutputPort[portNum].isConnected(),
747  static_cast<FwAssertArgType>(portNum)
748  );
749  return this->m_allocate_OutputPort[portNum].invoke(
750  size
751  );
752  }
753 
756  FwIndexType portNum,
757  Fw::Buffer& fwBuffer
758  )
759  {
760  FW_ASSERT(
761  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
762  static_cast<FwAssertArgType>(portNum)
763  );
764 
765  FW_ASSERT(
766  this->m_deallocate_OutputPort[portNum].isConnected(),
767  static_cast<FwAssertArgType>(portNum)
768  );
769  this->m_deallocate_OutputPort[portNum].invoke(
770  fwBuffer
771  );
772  }
773 
776  {
777  FW_ASSERT(
778  (0 <= portNum) && (portNum < this->getNum_ready_OutputPorts()),
779  static_cast<FwAssertArgType>(portNum)
780  );
781 
782  FW_ASSERT(
783  this->m_ready_OutputPort[portNum].isConnected(),
784  static_cast<FwAssertArgType>(portNum)
785  );
786  this->m_ready_OutputPort[portNum].invoke();
787  }
788 
791  FwIndexType portNum,
792  Fw::Buffer& buffer,
793  const Drv::ByteStreamStatus& status
794  )
795  {
796  FW_ASSERT(
797  (0 <= portNum) && (portNum < this->getNum_recv_OutputPorts()),
798  static_cast<FwAssertArgType>(portNum)
799  );
800 
801  FW_ASSERT(
802  this->m_recv_OutputPort[portNum].isConnected(),
803  static_cast<FwAssertArgType>(portNum)
804  );
805  this->m_recv_OutputPort[portNum].invoke(
806  buffer,
807  status
808  );
809  }
810 
811  // ----------------------------------------------------------------------
812  // Event logging functions
813  // ----------------------------------------------------------------------
814 
817  const Fw::StringBase& device,
818  I32 error,
819  const Fw::StringBase& name
820  ) const
821  {
822  // Get the time
823  Fw::Time _logTime;
824  if (this->m_Time_OutputPort[0].isConnected()) {
825  this->m_Time_OutputPort[0].invoke(_logTime);
826  }
827 
828  FwEventIdType _id = static_cast<FwEventIdType>(0);
829 
830  _id = this->getIdBase() + EVENTID_OPENERROR;
831 
832  // Emit the event on the log port
833  if (this->m_Log_OutputPort[0].isConnected()) {
834  Fw::LogBuffer _logBuff;
836 
837 #if FW_AMPCS_COMPATIBLE
838  // Serialize the number of arguments
839  _status = _logBuff.serializeFrom(static_cast<U8>(3));
840  FW_ASSERT(
841  _status == Fw::FW_SERIALIZE_OK,
842  static_cast<FwAssertArgType>(_status)
843  );
844 #endif
845 
846  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
847  FW_ASSERT(
848  _status == Fw::FW_SERIALIZE_OK,
849  static_cast<FwAssertArgType>(_status)
850  );
851 
852 #if FW_AMPCS_COMPATIBLE
853  // Serialize the argument size
854  _status = _logBuff.serializeFrom(
855  static_cast<U8>(sizeof(I32))
856  );
857  FW_ASSERT(
858  _status == Fw::FW_SERIALIZE_OK,
859  static_cast<FwAssertArgType>(_status)
860  );
861 #endif
862  _status = _logBuff.serializeFrom(error);
863  FW_ASSERT(
864  _status == Fw::FW_SERIALIZE_OK,
865  static_cast<FwAssertArgType>(_status)
866  );
867 
868  _status = name.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
869  FW_ASSERT(
870  _status == Fw::FW_SERIALIZE_OK,
871  static_cast<FwAssertArgType>(_status)
872  );
873 
874  this->m_Log_OutputPort[0].invoke(
875  _id,
876  _logTime,
878  _logBuff
879  );
880  }
881 
882  // Emit the event on the text log port
883 #if FW_ENABLE_TEXT_LOGGING
884  if (this->m_LogText_OutputPort[0].isConnected()) {
885 #if FW_OBJECT_NAMES == 1
886  const char* _formatString =
887  "(%s) %s: Error opening UART device %s: %" PRIi32 " %s";
888 #else
889  const char* _formatString =
890  "%s: Error opening UART device %s: %" PRIi32 " %s";
891 #endif
892 
893  Fw::TextLogString _logString;
894  _logString.format(
895  _formatString,
896 #if FW_OBJECT_NAMES == 1
897  this->m_objName.toChar(),
898 #endif
899  "OpenError ",
900  device.toChar(),
901  error,
902  name.toChar()
903  );
904 
905  this->m_LogText_OutputPort[0].invoke(
906  _id,
907  _logTime,
909  _logString
910  );
911  }
912 #endif
913  }
914 
917  const Fw::StringBase& device,
918  I32 error
919  ) const
920  {
921  // Get the time
922  Fw::Time _logTime;
923  if (this->m_Time_OutputPort[0].isConnected()) {
924  this->m_Time_OutputPort[0].invoke(_logTime);
925  }
926 
927  FwEventIdType _id = static_cast<FwEventIdType>(0);
928 
929  _id = this->getIdBase() + EVENTID_CONFIGERROR;
930 
931  // Emit the event on the log port
932  if (this->m_Log_OutputPort[0].isConnected()) {
933  Fw::LogBuffer _logBuff;
935 
936 #if FW_AMPCS_COMPATIBLE
937  // Serialize the number of arguments
938  _status = _logBuff.serializeFrom(static_cast<U8>(2));
939  FW_ASSERT(
940  _status == Fw::FW_SERIALIZE_OK,
941  static_cast<FwAssertArgType>(_status)
942  );
943 #endif
944 
945  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
946  FW_ASSERT(
947  _status == Fw::FW_SERIALIZE_OK,
948  static_cast<FwAssertArgType>(_status)
949  );
950 
951 #if FW_AMPCS_COMPATIBLE
952  // Serialize the argument size
953  _status = _logBuff.serializeFrom(
954  static_cast<U8>(sizeof(I32))
955  );
956  FW_ASSERT(
957  _status == Fw::FW_SERIALIZE_OK,
958  static_cast<FwAssertArgType>(_status)
959  );
960 #endif
961  _status = _logBuff.serializeFrom(error);
962  FW_ASSERT(
963  _status == Fw::FW_SERIALIZE_OK,
964  static_cast<FwAssertArgType>(_status)
965  );
966 
967  this->m_Log_OutputPort[0].invoke(
968  _id,
969  _logTime,
971  _logBuff
972  );
973  }
974 
975  // Emit the event on the text log port
976 #if FW_ENABLE_TEXT_LOGGING
977  if (this->m_LogText_OutputPort[0].isConnected()) {
978 #if FW_OBJECT_NAMES == 1
979  const char* _formatString =
980  "(%s) %s: Error configuring UART device %s: %" PRIi32 "";
981 #else
982  const char* _formatString =
983  "%s: Error configuring UART device %s: %" PRIi32 "";
984 #endif
985 
986  Fw::TextLogString _logString;
987  _logString.format(
988  _formatString,
989 #if FW_OBJECT_NAMES == 1
990  this->m_objName.toChar(),
991 #endif
992  "ConfigError ",
993  device.toChar(),
994  error
995  );
996 
997  this->m_LogText_OutputPort[0].invoke(
998  _id,
999  _logTime,
1001  _logString
1002  );
1003  }
1004 #endif
1005  }
1006 
1009  const Fw::StringBase& device,
1010  I32 error
1011  )
1012  {
1013  // Check throttle value
1014  if (this->m_WriteErrorThrottle >= EVENTID_WRITEERROR_THROTTLE) {
1015  return;
1016  }
1017  else {
1018  this->m_WriteErrorThrottle++;
1019  }
1020 
1021  // Get the time
1022  Fw::Time _logTime;
1023  if (this->m_Time_OutputPort[0].isConnected()) {
1024  this->m_Time_OutputPort[0].invoke(_logTime);
1025  }
1026 
1027  FwEventIdType _id = static_cast<FwEventIdType>(0);
1028 
1029  _id = this->getIdBase() + EVENTID_WRITEERROR;
1030 
1031  // Emit the event on the log port
1032  if (this->m_Log_OutputPort[0].isConnected()) {
1033  Fw::LogBuffer _logBuff;
1035 
1036 #if FW_AMPCS_COMPATIBLE
1037  // Serialize the number of arguments
1038  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1039  FW_ASSERT(
1040  _status == Fw::FW_SERIALIZE_OK,
1041  static_cast<FwAssertArgType>(_status)
1042  );
1043 #endif
1044 
1045  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1046  FW_ASSERT(
1047  _status == Fw::FW_SERIALIZE_OK,
1048  static_cast<FwAssertArgType>(_status)
1049  );
1050 
1051 #if FW_AMPCS_COMPATIBLE
1052  // Serialize the argument size
1053  _status = _logBuff.serializeFrom(
1054  static_cast<U8>(sizeof(I32))
1055  );
1056  FW_ASSERT(
1057  _status == Fw::FW_SERIALIZE_OK,
1058  static_cast<FwAssertArgType>(_status)
1059  );
1060 #endif
1061  _status = _logBuff.serializeFrom(error);
1062  FW_ASSERT(
1063  _status == Fw::FW_SERIALIZE_OK,
1064  static_cast<FwAssertArgType>(_status)
1065  );
1066 
1067  this->m_Log_OutputPort[0].invoke(
1068  _id,
1069  _logTime,
1071  _logBuff
1072  );
1073  }
1074 
1075  // Emit the event on the text log port
1076 #if FW_ENABLE_TEXT_LOGGING
1077  if (this->m_LogText_OutputPort[0].isConnected()) {
1078 #if FW_OBJECT_NAMES == 1
1079  const char* _formatString =
1080  "(%s) %s: Error writing UART device %s: %" PRIi32 "";
1081 #else
1082  const char* _formatString =
1083  "%s: Error writing UART device %s: %" PRIi32 "";
1084 #endif
1085 
1086  Fw::TextLogString _logString;
1087  _logString.format(
1088  _formatString,
1089 #if FW_OBJECT_NAMES == 1
1090  this->m_objName.toChar(),
1091 #endif
1092  "WriteError ",
1093  device.toChar(),
1094  error
1095  );
1096 
1097  this->m_LogText_OutputPort[0].invoke(
1098  _id,
1099  _logTime,
1101  _logString
1102  );
1103  }
1104 #endif
1105  }
1106 
1109  const Fw::StringBase& device,
1110  I32 error
1111  )
1112  {
1113  // Check throttle value
1114  if (this->m_ReadErrorThrottle >= EVENTID_READERROR_THROTTLE) {
1115  return;
1116  }
1117  else {
1118  this->m_ReadErrorThrottle++;
1119  }
1120 
1121  // Get the time
1122  Fw::Time _logTime;
1123  if (this->m_Time_OutputPort[0].isConnected()) {
1124  this->m_Time_OutputPort[0].invoke(_logTime);
1125  }
1126 
1127  FwEventIdType _id = static_cast<FwEventIdType>(0);
1128 
1129  _id = this->getIdBase() + EVENTID_READERROR;
1130 
1131  // Emit the event on the log port
1132  if (this->m_Log_OutputPort[0].isConnected()) {
1133  Fw::LogBuffer _logBuff;
1135 
1136 #if FW_AMPCS_COMPATIBLE
1137  // Serialize the number of arguments
1138  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1139  FW_ASSERT(
1140  _status == Fw::FW_SERIALIZE_OK,
1141  static_cast<FwAssertArgType>(_status)
1142  );
1143 #endif
1144 
1145  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1146  FW_ASSERT(
1147  _status == Fw::FW_SERIALIZE_OK,
1148  static_cast<FwAssertArgType>(_status)
1149  );
1150 
1151 #if FW_AMPCS_COMPATIBLE
1152  // Serialize the argument size
1153  _status = _logBuff.serializeFrom(
1154  static_cast<U8>(sizeof(I32))
1155  );
1156  FW_ASSERT(
1157  _status == Fw::FW_SERIALIZE_OK,
1158  static_cast<FwAssertArgType>(_status)
1159  );
1160 #endif
1161  _status = _logBuff.serializeFrom(error);
1162  FW_ASSERT(
1163  _status == Fw::FW_SERIALIZE_OK,
1164  static_cast<FwAssertArgType>(_status)
1165  );
1166 
1167  this->m_Log_OutputPort[0].invoke(
1168  _id,
1169  _logTime,
1171  _logBuff
1172  );
1173  }
1174 
1175  // Emit the event on the text log port
1176 #if FW_ENABLE_TEXT_LOGGING
1177  if (this->m_LogText_OutputPort[0].isConnected()) {
1178 #if FW_OBJECT_NAMES == 1
1179  const char* _formatString =
1180  "(%s) %s: Error reading UART device %s: %" PRIi32 "";
1181 #else
1182  const char* _formatString =
1183  "%s: Error reading UART device %s: %" PRIi32 "";
1184 #endif
1185 
1186  Fw::TextLogString _logString;
1187  _logString.format(
1188  _formatString,
1189 #if FW_OBJECT_NAMES == 1
1190  this->m_objName.toChar(),
1191 #endif
1192  "ReadError ",
1193  device.toChar(),
1194  error
1195  );
1196 
1197  this->m_LogText_OutputPort[0].invoke(
1198  _id,
1199  _logTime,
1201  _logString
1202  );
1203  }
1204 #endif
1205  }
1206 
1209  {
1210  // Get the time
1211  Fw::Time _logTime;
1212  if (this->m_Time_OutputPort[0].isConnected()) {
1213  this->m_Time_OutputPort[0].invoke(_logTime);
1214  }
1215 
1216  FwEventIdType _id = static_cast<FwEventIdType>(0);
1217 
1218  _id = this->getIdBase() + EVENTID_PORTOPENED;
1219 
1220  // Emit the event on the log port
1221  if (this->m_Log_OutputPort[0].isConnected()) {
1222  Fw::LogBuffer _logBuff;
1224 
1225 #if FW_AMPCS_COMPATIBLE
1226  // Serialize the number of arguments
1227  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1228  FW_ASSERT(
1229  _status == Fw::FW_SERIALIZE_OK,
1230  static_cast<FwAssertArgType>(_status)
1231  );
1232 #endif
1233 
1234  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1235  FW_ASSERT(
1236  _status == Fw::FW_SERIALIZE_OK,
1237  static_cast<FwAssertArgType>(_status)
1238  );
1239 
1240  this->m_Log_OutputPort[0].invoke(
1241  _id,
1242  _logTime,
1244  _logBuff
1245  );
1246  }
1247 
1248  // Emit the event on the text log port
1249 #if FW_ENABLE_TEXT_LOGGING
1250  if (this->m_LogText_OutputPort[0].isConnected()) {
1251 #if FW_OBJECT_NAMES == 1
1252  const char* _formatString =
1253  "(%s) %s: UART Device %s configured";
1254 #else
1255  const char* _formatString =
1256  "%s: UART Device %s configured";
1257 #endif
1258 
1259  Fw::TextLogString _logString;
1260  _logString.format(
1261  _formatString,
1262 #if FW_OBJECT_NAMES == 1
1263  this->m_objName.toChar(),
1264 #endif
1265  "PortOpened ",
1266  device.toChar()
1267  );
1268 
1269  this->m_LogText_OutputPort[0].invoke(
1270  _id,
1271  _logTime,
1273  _logString
1274  );
1275  }
1276 #endif
1277  }
1278 
1281  {
1282  // Check throttle value
1283  if (this->m_NoBuffersThrottle >= EVENTID_NOBUFFERS_THROTTLE) {
1284  return;
1285  }
1286  else {
1287  this->m_NoBuffersThrottle++;
1288  }
1289 
1290  // Get the time
1291  Fw::Time _logTime;
1292  if (this->m_Time_OutputPort[0].isConnected()) {
1293  this->m_Time_OutputPort[0].invoke(_logTime);
1294  }
1295 
1296  FwEventIdType _id = static_cast<FwEventIdType>(0);
1297 
1298  _id = this->getIdBase() + EVENTID_NOBUFFERS;
1299 
1300  // Emit the event on the log port
1301  if (this->m_Log_OutputPort[0].isConnected()) {
1302  Fw::LogBuffer _logBuff;
1304 
1305 #if FW_AMPCS_COMPATIBLE
1306  // Serialize the number of arguments
1307  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1308  FW_ASSERT(
1309  _status == Fw::FW_SERIALIZE_OK,
1310  static_cast<FwAssertArgType>(_status)
1311  );
1312 #endif
1313 
1314  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1315  FW_ASSERT(
1316  _status == Fw::FW_SERIALIZE_OK,
1317  static_cast<FwAssertArgType>(_status)
1318  );
1319 
1320  this->m_Log_OutputPort[0].invoke(
1321  _id,
1322  _logTime,
1324  _logBuff
1325  );
1326  }
1327 
1328  // Emit the event on the text log port
1329 #if FW_ENABLE_TEXT_LOGGING
1330  if (this->m_LogText_OutputPort[0].isConnected()) {
1331 #if FW_OBJECT_NAMES == 1
1332  const char* _formatString =
1333  "(%s) %s: UART Device %s ran out of buffers";
1334 #else
1335  const char* _formatString =
1336  "%s: UART Device %s ran out of buffers";
1337 #endif
1338 
1339  Fw::TextLogString _logString;
1340  _logString.format(
1341  _formatString,
1342 #if FW_OBJECT_NAMES == 1
1343  this->m_objName.toChar(),
1344 #endif
1345  "NoBuffers ",
1346  device.toChar()
1347  );
1348 
1349  this->m_LogText_OutputPort[0].invoke(
1350  _id,
1351  _logTime,
1353  _logString
1354  );
1355  }
1356 #endif
1357  }
1358 
1361  const Fw::StringBase& device,
1362  U32 size,
1363  U32 needed
1364  ) const
1365  {
1366  // Get the time
1367  Fw::Time _logTime;
1368  if (this->m_Time_OutputPort[0].isConnected()) {
1369  this->m_Time_OutputPort[0].invoke(_logTime);
1370  }
1371 
1372  FwEventIdType _id = static_cast<FwEventIdType>(0);
1373 
1374  _id = this->getIdBase() + EVENTID_BUFFERTOOSMALL;
1375 
1376  // Emit the event on the log port
1377  if (this->m_Log_OutputPort[0].isConnected()) {
1378  Fw::LogBuffer _logBuff;
1380 
1381 #if FW_AMPCS_COMPATIBLE
1382  // Serialize the number of arguments
1383  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1384  FW_ASSERT(
1385  _status == Fw::FW_SERIALIZE_OK,
1386  static_cast<FwAssertArgType>(_status)
1387  );
1388 #endif
1389 
1390  _status = device.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1391  FW_ASSERT(
1392  _status == Fw::FW_SERIALIZE_OK,
1393  static_cast<FwAssertArgType>(_status)
1394  );
1395 
1396 #if FW_AMPCS_COMPATIBLE
1397  // Serialize the argument size
1398  _status = _logBuff.serializeFrom(
1399  static_cast<U8>(sizeof(U32))
1400  );
1401  FW_ASSERT(
1402  _status == Fw::FW_SERIALIZE_OK,
1403  static_cast<FwAssertArgType>(_status)
1404  );
1405 #endif
1406  _status = _logBuff.serializeFrom(size);
1407  FW_ASSERT(
1408  _status == Fw::FW_SERIALIZE_OK,
1409  static_cast<FwAssertArgType>(_status)
1410  );
1411 
1412 #if FW_AMPCS_COMPATIBLE
1413  // Serialize the argument size
1414  _status = _logBuff.serializeFrom(
1415  static_cast<U8>(sizeof(U32))
1416  );
1417  FW_ASSERT(
1418  _status == Fw::FW_SERIALIZE_OK,
1419  static_cast<FwAssertArgType>(_status)
1420  );
1421 #endif
1422  _status = _logBuff.serializeFrom(needed);
1423  FW_ASSERT(
1424  _status == Fw::FW_SERIALIZE_OK,
1425  static_cast<FwAssertArgType>(_status)
1426  );
1427 
1428  this->m_Log_OutputPort[0].invoke(
1429  _id,
1430  _logTime,
1432  _logBuff
1433  );
1434  }
1435 
1436  // Emit the event on the text log port
1437 #if FW_ENABLE_TEXT_LOGGING
1438  if (this->m_LogText_OutputPort[0].isConnected()) {
1439 #if FW_OBJECT_NAMES == 1
1440  const char* _formatString =
1441  "(%s) %s: UART Device %s target buffer too small. Size: %" PRIu32 " Needs: %" PRIu32 "";
1442 #else
1443  const char* _formatString =
1444  "%s: UART Device %s target buffer too small. Size: %" PRIu32 " Needs: %" PRIu32 "";
1445 #endif
1446 
1447  Fw::TextLogString _logString;
1448  _logString.format(
1449  _formatString,
1450 #if FW_OBJECT_NAMES == 1
1451  this->m_objName.toChar(),
1452 #endif
1453  "BufferTooSmall ",
1454  device.toChar(),
1455  size,
1456  needed
1457  );
1458 
1459  this->m_LogText_OutputPort[0].invoke(
1460  _id,
1461  _logTime,
1463  _logString
1464  );
1465  }
1466 #endif
1467  }
1468 
1469  // ----------------------------------------------------------------------
1470  // Event throttle reset functions
1471  // ----------------------------------------------------------------------
1472 
1475  {
1476  // Reset throttle counter
1477  this->m_WriteErrorThrottle = 0;
1478  }
1479 
1482  {
1483  // Reset throttle counter
1484  this->m_ReadErrorThrottle = 0;
1485  }
1486 
1489  {
1490  // Reset throttle counter
1491  this->m_NoBuffersThrottle = 0;
1492  }
1493 
1494  // ----------------------------------------------------------------------
1495  // Telemetry write functions
1496  // ----------------------------------------------------------------------
1497 
1500  FwSizeType arg,
1501  Fw::Time _tlmTime
1502  ) const
1503  {
1504  if (this->m_Tlm_OutputPort[0].isConnected()) {
1505  if (
1506  this->m_Time_OutputPort[0].isConnected() &&
1507  (_tlmTime == Fw::ZERO_TIME)
1508  ) {
1509  this->m_Time_OutputPort[0].invoke(_tlmTime);
1510  }
1511 
1512  Fw::TlmBuffer _tlmBuff;
1513  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1514  FW_ASSERT(
1515  _stat == Fw::FW_SERIALIZE_OK,
1516  static_cast<FwAssertArgType>(_stat)
1517  );
1518 
1519  FwChanIdType _id;
1520 
1521  _id = this->getIdBase() + CHANNELID_BYTESSENT;
1522 
1523  this->m_Tlm_OutputPort[0].invoke(
1524  _id,
1525  _tlmTime,
1526  _tlmBuff
1527  );
1528  }
1529  }
1530 
1533  FwSizeType arg,
1534  Fw::Time _tlmTime
1535  ) const
1536  {
1537  if (this->m_Tlm_OutputPort[0].isConnected()) {
1538  if (
1539  this->m_Time_OutputPort[0].isConnected() &&
1540  (_tlmTime == Fw::ZERO_TIME)
1541  ) {
1542  this->m_Time_OutputPort[0].invoke(_tlmTime);
1543  }
1544 
1545  Fw::TlmBuffer _tlmBuff;
1546  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1547  FW_ASSERT(
1548  _stat == Fw::FW_SERIALIZE_OK,
1549  static_cast<FwAssertArgType>(_stat)
1550  );
1551 
1552  FwChanIdType _id;
1553 
1554  _id = this->getIdBase() + CHANNELID_BYTESRECV;
1555 
1556  this->m_Tlm_OutputPort[0].invoke(
1557  _id,
1558  _tlmTime,
1559  _tlmBuff
1560  );
1561  }
1562  }
1563 
1564  // ----------------------------------------------------------------------
1565  // Time
1566  // ----------------------------------------------------------------------
1567 
1569  getTime() const
1570  {
1571  if (this->m_Time_OutputPort[0].isConnected()) {
1572  Fw::Time _time;
1573  this->m_Time_OutputPort[0].invoke(_time);
1574  return _time;
1575  }
1576  else {
1577  return Fw::Time(TimeBase::TB_NONE, 0, 0);
1578  }
1579  }
1580 
1581  // ----------------------------------------------------------------------
1582  // Mutex operations for guarded ports
1583  //
1584  // You can override these operations to provide more sophisticated
1585  // synchronization
1586  // ----------------------------------------------------------------------
1587 
1590  {
1591  this->m_guardedPortMutex.lock();
1592  }
1593 
1596  {
1597  this->m_guardedPortMutex.unLock();
1598  }
1599 
1600  // ----------------------------------------------------------------------
1601  // Calls for messages received on typed input ports
1602  // ----------------------------------------------------------------------
1603 
1604  void LinuxUartDriverComponentBase ::
1605  m_p_recvReturnIn_in(
1606  Fw::PassiveComponentBase* callComp,
1607  FwIndexType portNum,
1608  Fw::Buffer& fwBuffer
1609  )
1610  {
1611  FW_ASSERT(callComp);
1612  LinuxUartDriverComponentBase* compPtr = static_cast<LinuxUartDriverComponentBase*>(callComp);
1613  compPtr->recvReturnIn_handlerBase(
1614  portNum,
1615  fwBuffer
1616  );
1617  }
1618 
1619  void LinuxUartDriverComponentBase ::
1620  m_p_run_in(
1621  Fw::PassiveComponentBase* callComp,
1622  FwIndexType portNum,
1623  U32 context
1624  )
1625  {
1626  FW_ASSERT(callComp);
1627  LinuxUartDriverComponentBase* compPtr = static_cast<LinuxUartDriverComponentBase*>(callComp);
1628  compPtr->run_handlerBase(
1629  portNum,
1630  context
1631  );
1632  }
1633 
1634  Drv::ByteStreamStatus LinuxUartDriverComponentBase ::
1635  m_p_send_in(
1636  Fw::PassiveComponentBase* callComp,
1637  FwIndexType portNum,
1638  Fw::Buffer& sendBuffer
1639  )
1640  {
1641  FW_ASSERT(callComp);
1642  LinuxUartDriverComponentBase* compPtr = static_cast<LinuxUartDriverComponentBase*>(callComp);
1643  return compPtr->send_handlerBase(
1644  portNum,
1645  sendBuffer
1646  );
1647  }
1648 
1649 }
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
static constexpr FwIndexType getNum_deallocate_OutputPorts()
bool isConnected_Time_OutputPort(FwIndexType portNum)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
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)
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.
static constexpr FwIndexType getNum_recv_OutputPorts()
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:41
void tlmWrite_BytesRecv(FwSizeType arg, Fw::Time _tlmTime=Fw::Time()) const
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
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)
static constexpr FwIndexType getNum_Log_OutputPorts()
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:26
void init()
Initialization function.
Definition: TimePortAc.cpp:128
static constexpr FwIndexType getNum_ready_OutputPorts()
#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
static constexpr FwIndexType getNum_recvReturnIn_InputPorts()
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
Convert to a C-style char*.
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
static constexpr FwIndexType getNum_run_InputPorts()
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:39
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.
static constexpr FwIndexType getNum_allocate_OutputPorts()
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_Time_OutputPorts()
Fw::Buffer invoke(FwSizeType size) const
Invoke a port interface.
static constexpr FwIndexType getNum_Tlm_OutputPorts()
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.
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.
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.
Implementation of malloc based allocator.
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.
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34
void log_WARNING_HI_ReadError_ThrottleClear()
Reset throttle value for ReadError.
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.
void log_WARNING_HI_ConfigError(const Fw::StringBase &device, I32 error) const
static constexpr FwIndexType getNum_send_InputPorts()