F´ Flight Software - C/C++ Documentation  devel
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 
21  init(FwEnumStoreType instance)
22  {
23  // Initialize base class
25 
26  // Connect input port send
27  for (
28  FwIndexType port = 0;
29  port < static_cast<FwIndexType>(this->getNum_send_InputPorts());
30  port++
31  ) {
32  this->m_send_InputPort[port].init();
33  this->m_send_InputPort[port].addCallComp(
34  this,
35  m_p_send_in
36  );
37  this->m_send_InputPort[port].setPortNum(port);
38 
39 #if FW_OBJECT_NAMES == 1
40  Fw::ObjectName portName;
41  portName.format(
42  "%s_send_InputPort[%" PRI_PlatformIntType "]",
43  this->m_objName.toChar(),
44  port
45  );
46  this->m_send_InputPort[port].setObjName(portName.toChar());
47 #endif
48  }
49 
50  // Connect output port Log
51  for (
52  FwIndexType port = 0;
53  port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
54  port++
55  ) {
56  this->m_Log_OutputPort[port].init();
57 
58 #if FW_OBJECT_NAMES == 1
59  Fw::ObjectName portName;
60  portName.format(
61  "%s_Log_OutputPort[%" PRI_PlatformIntType "]",
62  this->m_objName.toChar(),
63  port
64  );
65  this->m_Log_OutputPort[port].setObjName(portName.toChar());
66 #endif
67  }
68 
69 #if FW_ENABLE_TEXT_LOGGING == 1
70  // Connect output port LogText
71  for (
72  FwIndexType port = 0;
73  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
74  port++
75  ) {
76  this->m_LogText_OutputPort[port].init();
77 
78 #if FW_OBJECT_NAMES == 1
79  Fw::ObjectName portName;
80  portName.format(
81  "%s_LogText_OutputPort[%" PRI_PlatformIntType "]",
82  this->m_objName.toChar(),
83  port
84  );
85  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
86 #endif
87  }
88 #endif
89 
90  // Connect output port Time
91  for (
92  FwIndexType port = 0;
93  port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
94  port++
95  ) {
96  this->m_Time_OutputPort[port].init();
97 
98 #if FW_OBJECT_NAMES == 1
99  Fw::ObjectName portName;
100  portName.format(
101  "%s_Time_OutputPort[%" PRI_PlatformIntType "]",
102  this->m_objName.toChar(),
103  port
104  );
105  this->m_Time_OutputPort[port].setObjName(portName.toChar());
106 #endif
107  }
108 
109  // Connect output port Tlm
110  for (
111  FwIndexType port = 0;
112  port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
113  port++
114  ) {
115  this->m_Tlm_OutputPort[port].init();
116 
117 #if FW_OBJECT_NAMES == 1
118  Fw::ObjectName portName;
119  portName.format(
120  "%s_Tlm_OutputPort[%" PRI_PlatformIntType "]",
121  this->m_objName.toChar(),
122  port
123  );
124  this->m_Tlm_OutputPort[port].setObjName(portName.toChar());
125 #endif
126  }
127 
128  // Connect output port allocate
129  for (
130  FwIndexType port = 0;
131  port < static_cast<FwIndexType>(this->getNum_allocate_OutputPorts());
132  port++
133  ) {
134  this->m_allocate_OutputPort[port].init();
135 
136 #if FW_OBJECT_NAMES == 1
137  Fw::ObjectName portName;
138  portName.format(
139  "%s_allocate_OutputPort[%" PRI_PlatformIntType "]",
140  this->m_objName.toChar(),
141  port
142  );
143  this->m_allocate_OutputPort[port].setObjName(portName.toChar());
144 #endif
145  }
146 
147  // Connect output port deallocate
148  for (
149  FwIndexType port = 0;
150  port < static_cast<FwIndexType>(this->getNum_deallocate_OutputPorts());
151  port++
152  ) {
153  this->m_deallocate_OutputPort[port].init();
154 
155 #if FW_OBJECT_NAMES == 1
156  Fw::ObjectName portName;
157  portName.format(
158  "%s_deallocate_OutputPort[%" PRI_PlatformIntType "]",
159  this->m_objName.toChar(),
160  port
161  );
162  this->m_deallocate_OutputPort[port].setObjName(portName.toChar());
163 #endif
164  }
165 
166  // Connect output port ready
167  for (
168  FwIndexType port = 0;
169  port < static_cast<FwIndexType>(this->getNum_ready_OutputPorts());
170  port++
171  ) {
172  this->m_ready_OutputPort[port].init();
173 
174 #if FW_OBJECT_NAMES == 1
175  Fw::ObjectName portName;
176  portName.format(
177  "%s_ready_OutputPort[%" PRI_PlatformIntType "]",
178  this->m_objName.toChar(),
179  port
180  );
181  this->m_ready_OutputPort[port].setObjName(portName.toChar());
182 #endif
183  }
184 
185  // Connect output port recv
186  for (
187  FwIndexType port = 0;
188  port < static_cast<FwIndexType>(this->getNum_recv_OutputPorts());
189  port++
190  ) {
191  this->m_recv_OutputPort[port].init();
192 
193 #if FW_OBJECT_NAMES == 1
194  Fw::ObjectName portName;
195  portName.format(
196  "%s_recv_OutputPort[%" PRI_PlatformIntType "]",
197  this->m_objName.toChar(),
198  port
199  );
200  this->m_recv_OutputPort[port].setObjName(portName.toChar());
201 #endif
202  }
203  }
204 
205  // ----------------------------------------------------------------------
206  // Getters for typed input ports
207  // ----------------------------------------------------------------------
208 
211  {
212  FW_ASSERT(
213  portNum < this->getNum_send_InputPorts(),
214  static_cast<FwAssertArgType>(portNum)
215  );
216 
217  return &this->m_send_InputPort[portNum];
218  }
219 
220  // ----------------------------------------------------------------------
221  // Connect input ports to special output ports
222  // ----------------------------------------------------------------------
223 
226  FwIndexType portNum,
227  Fw::InputLogPort* port
228  )
229  {
230  FW_ASSERT(
231  portNum < this->getNum_Log_OutputPorts(),
232  static_cast<FwAssertArgType>(portNum)
233  );
234 
235  this->m_Log_OutputPort[portNum].addCallPort(port);
236  }
237 
238 #if FW_ENABLE_TEXT_LOGGING == 1
239 
240  void LinuxUartDriverComponentBase ::
241  set_LogText_OutputPort(
242  FwIndexType portNum,
244  )
245  {
246  FW_ASSERT(
247  portNum < this->getNum_LogText_OutputPorts(),
248  static_cast<FwAssertArgType>(portNum)
249  );
250 
251  this->m_LogText_OutputPort[portNum].addCallPort(port);
252  }
253 
254 #endif
255 
258  FwIndexType portNum,
259  Fw::InputTimePort* port
260  )
261  {
262  FW_ASSERT(
263  portNum < this->getNum_Time_OutputPorts(),
264  static_cast<FwAssertArgType>(portNum)
265  );
266 
267  this->m_Time_OutputPort[portNum].addCallPort(port);
268  }
269 
272  FwIndexType portNum,
273  Fw::InputTlmPort* port
274  )
275  {
276  FW_ASSERT(
277  portNum < this->getNum_Tlm_OutputPorts(),
278  static_cast<FwAssertArgType>(portNum)
279  );
280 
281  this->m_Tlm_OutputPort[portNum].addCallPort(port);
282  }
283 
284  // ----------------------------------------------------------------------
285  // Connect typed input ports to typed output ports
286  // ----------------------------------------------------------------------
287 
290  FwIndexType portNum,
292  )
293  {
294  FW_ASSERT(
295  portNum < this->getNum_allocate_OutputPorts(),
296  static_cast<FwAssertArgType>(portNum)
297  );
298 
299  this->m_allocate_OutputPort[portNum].addCallPort(port);
300  }
301 
304  FwIndexType portNum,
306  )
307  {
308  FW_ASSERT(
309  portNum < this->getNum_deallocate_OutputPorts(),
310  static_cast<FwAssertArgType>(portNum)
311  );
312 
313  this->m_deallocate_OutputPort[portNum].addCallPort(port);
314  }
315 
318  FwIndexType portNum,
320  )
321  {
322  FW_ASSERT(
323  portNum < this->getNum_ready_OutputPorts(),
324  static_cast<FwAssertArgType>(portNum)
325  );
326 
327  this->m_ready_OutputPort[portNum].addCallPort(port);
328  }
329 
332  FwIndexType portNum,
334  )
335  {
336  FW_ASSERT(
337  portNum < this->getNum_recv_OutputPorts(),
338  static_cast<FwAssertArgType>(portNum)
339  );
340 
341  this->m_recv_OutputPort[portNum].addCallPort(port);
342  }
343 
344 #if FW_PORT_SERIALIZATION
345 
346  // ----------------------------------------------------------------------
347  // Connect serial input ports to special output ports
348  // ----------------------------------------------------------------------
349 
352  FwIndexType portNum,
353  Fw::InputSerializePort* port
354  )
355  {
356  FW_ASSERT(
357  portNum < this->getNum_Log_OutputPorts(),
358  static_cast<FwAssertArgType>(portNum)
359  );
360 
361  this->m_Log_OutputPort[portNum].registerSerialPort(port);
362  }
363 
364 #if FW_ENABLE_TEXT_LOGGING == 1
365 
366  void LinuxUartDriverComponentBase ::
367  set_LogText_OutputPort(
368  FwIndexType portNum,
369  Fw::InputSerializePort* port
370  )
371  {
372  FW_ASSERT(
373  portNum < this->getNum_LogText_OutputPorts(),
374  static_cast<FwAssertArgType>(portNum)
375  );
376 
377  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
378  }
379 
380 #endif
381 
384  FwIndexType portNum,
385  Fw::InputSerializePort* port
386  )
387  {
388  FW_ASSERT(
389  portNum < this->getNum_Time_OutputPorts(),
390  static_cast<FwAssertArgType>(portNum)
391  );
392 
393  this->m_Time_OutputPort[portNum].registerSerialPort(port);
394  }
395 
398  FwIndexType portNum,
399  Fw::InputSerializePort* port
400  )
401  {
402  FW_ASSERT(
403  portNum < this->getNum_Tlm_OutputPorts(),
404  static_cast<FwAssertArgType>(portNum)
405  );
406 
407  this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
408  }
409 
410 #endif
411 
412 #if FW_PORT_SERIALIZATION
413 
414  // ----------------------------------------------------------------------
415  // Connect serial input ports to typed output ports
416  // ----------------------------------------------------------------------
417 
420  FwIndexType portNum,
421  Fw::InputSerializePort* port
422  )
423  {
424  FW_ASSERT(
425  portNum < this->getNum_deallocate_OutputPorts(),
426  static_cast<FwAssertArgType>(portNum)
427  );
428 
429  this->m_deallocate_OutputPort[portNum].registerSerialPort(port);
430  }
431 
434  FwIndexType portNum,
435  Fw::InputSerializePort* port
436  )
437  {
438  FW_ASSERT(
439  portNum < this->getNum_ready_OutputPorts(),
440  static_cast<FwAssertArgType>(portNum)
441  );
442 
443  this->m_ready_OutputPort[portNum].registerSerialPort(port);
444  }
445 
448  FwIndexType portNum,
449  Fw::InputSerializePort* port
450  )
451  {
452  FW_ASSERT(
453  portNum < this->getNum_recv_OutputPorts(),
454  static_cast<FwAssertArgType>(portNum)
455  );
456 
457  this->m_recv_OutputPort[portNum].registerSerialPort(port);
458  }
459 
460 #endif
461 
462  // ----------------------------------------------------------------------
463  // Component construction and destruction
464  // ----------------------------------------------------------------------
465 
467  LinuxUartDriverComponentBase(const char* compName) :
468  Fw::PassiveComponentBase(compName)
469  {
470  this->m_WriteErrorThrottle = 0;
471  this->m_ReadErrorThrottle = 0;
472  this->m_NoBuffersThrottle = 0;
473  }
474 
477  {
478 
479  }
480 
481  // ----------------------------------------------------------------------
482  // Getters for numbers of typed input ports
483  // ----------------------------------------------------------------------
484 
487  {
488  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_send_InputPort));
489  }
490 
491  // ----------------------------------------------------------------------
492  // Getters for numbers of special output ports
493  // ----------------------------------------------------------------------
494 
497  {
498  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Log_OutputPort));
499  }
500 
501 #if FW_ENABLE_TEXT_LOGGING == 1
502 
503  FwIndexType LinuxUartDriverComponentBase ::
504  getNum_LogText_OutputPorts() const
505  {
506  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
507  }
508 
509 #endif
510 
513  {
514  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Time_OutputPort));
515  }
516 
519  {
520  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Tlm_OutputPort));
521  }
522 
523  // ----------------------------------------------------------------------
524  // Getters for numbers of typed output ports
525  // ----------------------------------------------------------------------
526 
529  {
530  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_allocate_OutputPort));
531  }
532 
535  {
536  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_deallocate_OutputPort));
537  }
538 
541  {
542  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_ready_OutputPort));
543  }
544 
547  {
548  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_recv_OutputPort));
549  }
550 
551  // ----------------------------------------------------------------------
552  // Connection status queries for special output ports
553  // ----------------------------------------------------------------------
554 
557  {
558  FW_ASSERT(
559  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  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  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  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  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  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  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  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& sendBuffer
661  )
662  {
663  // Make sure port number is valid
664  FW_ASSERT(
665  portNum < this->getNum_send_InputPorts(),
666  static_cast<FwAssertArgType>(portNum)
667  );
668 
669  Drv::SendStatus retVal;
670 
671  // Lock guard mutex before calling
672  this->lock();
673 
674  // Call handler function
675  retVal = this->send_handler(
676  portNum,
677  sendBuffer
678  );
679 
680  // Unlock guard mutex
681  this->unLock();
682 
683  return retVal;
684  }
685 
686  // ----------------------------------------------------------------------
687  // Invocation functions for typed output ports
688  // ----------------------------------------------------------------------
689 
692  FwIndexType portNum,
693  U32 size
694  )
695  {
696  FW_ASSERT(
697  portNum < this->getNum_allocate_OutputPorts(),
698  static_cast<FwAssertArgType>(portNum)
699  );
700  return this->m_allocate_OutputPort[portNum].invoke(
701  size
702  );
703  }
704 
707  FwIndexType portNum,
708  Fw::Buffer& fwBuffer
709  )
710  {
711  FW_ASSERT(
712  portNum < this->getNum_deallocate_OutputPorts(),
713  static_cast<FwAssertArgType>(portNum)
714  );
715  this->m_deallocate_OutputPort[portNum].invoke(
716  fwBuffer
717  );
718  }
719 
721  ready_out(FwIndexType portNum)
722  {
723  FW_ASSERT(
724  portNum < this->getNum_ready_OutputPorts(),
725  static_cast<FwAssertArgType>(portNum)
726  );
727  this->m_ready_OutputPort[portNum].invoke();
728  }
729 
731  recv_out(
732  FwIndexType portNum,
733  Fw::Buffer& recvBuffer,
734  const Drv::RecvStatus& recvStatus
735  )
736  {
737  FW_ASSERT(
738  portNum < this->getNum_recv_OutputPorts(),
739  static_cast<FwAssertArgType>(portNum)
740  );
741  this->m_recv_OutputPort[portNum].invoke(
742  recvBuffer,
743  recvStatus
744  );
745  }
746 
747  // ----------------------------------------------------------------------
748  // Event logging functions
749  // ----------------------------------------------------------------------
750 
753  const Fw::StringBase& device,
754  I32 error,
755  const Fw::StringBase& name
756  )
757  {
758  // Get the time
759  Fw::Time _logTime;
760  if (this->m_Time_OutputPort[0].isConnected()) {
761  this->m_Time_OutputPort[0].invoke(_logTime);
762  }
763 
764  FwEventIdType _id = static_cast<FwEventIdType>(0);
765 
766  _id = this->getIdBase() + EVENTID_OPENERROR;
767 
768  // Emit the event on the log port
769  if (this->m_Log_OutputPort[0].isConnected()) {
770  Fw::LogBuffer _logBuff;
772 
773 #if FW_AMPCS_COMPATIBLE
774  // Serialize the number of arguments
775  _status = _logBuff.serialize(static_cast<U8>(3));
776  FW_ASSERT(
777  _status == Fw::FW_SERIALIZE_OK,
778  static_cast<FwAssertArgType>(_status)
779  );
780 #endif
781 
782  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
783  FW_ASSERT(
784  _status == Fw::FW_SERIALIZE_OK,
785  static_cast<FwAssertArgType>(_status)
786  );
787 
788 #if FW_AMPCS_COMPATIBLE
789  // Serialize the argument size
790  _status = _logBuff.serialize(
791  static_cast<U8>(sizeof(I32))
792  );
793  FW_ASSERT(
794  _status == Fw::FW_SERIALIZE_OK,
795  static_cast<FwAssertArgType>(_status)
796  );
797 #endif
798  _status = _logBuff.serialize(error);
799  FW_ASSERT(
800  _status == Fw::FW_SERIALIZE_OK,
801  static_cast<FwAssertArgType>(_status)
802  );
803 
804  _status = name.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
805  FW_ASSERT(
806  _status == Fw::FW_SERIALIZE_OK,
807  static_cast<FwAssertArgType>(_status)
808  );
809 
810  this->m_Log_OutputPort[0].invoke(
811  _id,
812  _logTime,
814  _logBuff
815  );
816  }
817 
818  // Emit the event on the text log port
819 #if FW_ENABLE_TEXT_LOGGING
820  if (this->m_LogText_OutputPort[0].isConnected()) {
821 #if FW_OBJECT_NAMES == 1
822  const char* _formatString =
823  "(%s) %s: Error opening UART device %s: %" PRIi32 " %s";
824 #else
825  const char* _formatString =
826  "%s: Error opening UART device %s: %" PRIi32 " %s";
827 #endif
828 
829  Fw::TextLogString _logString;
830  _logString.format(
831  _formatString,
832 #if FW_OBJECT_NAMES == 1
833  this->m_objName.toChar(),
834 #endif
835  "OpenError ",
836  device.toChar(),
837  error,
838  name.toChar()
839  );
840 
841  this->m_LogText_OutputPort[0].invoke(
842  _id,
843  _logTime,
845  _logString
846  );
847  }
848 #endif
849  }
850 
853  const Fw::StringBase& device,
854  I32 error
855  )
856  {
857  // Get the time
858  Fw::Time _logTime;
859  if (this->m_Time_OutputPort[0].isConnected()) {
860  this->m_Time_OutputPort[0].invoke(_logTime);
861  }
862 
863  FwEventIdType _id = static_cast<FwEventIdType>(0);
864 
865  _id = this->getIdBase() + EVENTID_CONFIGERROR;
866 
867  // Emit the event on the log port
868  if (this->m_Log_OutputPort[0].isConnected()) {
869  Fw::LogBuffer _logBuff;
871 
872 #if FW_AMPCS_COMPATIBLE
873  // Serialize the number of arguments
874  _status = _logBuff.serialize(static_cast<U8>(2));
875  FW_ASSERT(
876  _status == Fw::FW_SERIALIZE_OK,
877  static_cast<FwAssertArgType>(_status)
878  );
879 #endif
880 
881  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
882  FW_ASSERT(
883  _status == Fw::FW_SERIALIZE_OK,
884  static_cast<FwAssertArgType>(_status)
885  );
886 
887 #if FW_AMPCS_COMPATIBLE
888  // Serialize the argument size
889  _status = _logBuff.serialize(
890  static_cast<U8>(sizeof(I32))
891  );
892  FW_ASSERT(
893  _status == Fw::FW_SERIALIZE_OK,
894  static_cast<FwAssertArgType>(_status)
895  );
896 #endif
897  _status = _logBuff.serialize(error);
898  FW_ASSERT(
899  _status == Fw::FW_SERIALIZE_OK,
900  static_cast<FwAssertArgType>(_status)
901  );
902 
903  this->m_Log_OutputPort[0].invoke(
904  _id,
905  _logTime,
907  _logBuff
908  );
909  }
910 
911  // Emit the event on the text log port
912 #if FW_ENABLE_TEXT_LOGGING
913  if (this->m_LogText_OutputPort[0].isConnected()) {
914 #if FW_OBJECT_NAMES == 1
915  const char* _formatString =
916  "(%s) %s: Error configuring UART device %s: %" PRIi32 "";
917 #else
918  const char* _formatString =
919  "%s: Error configuring UART device %s: %" PRIi32 "";
920 #endif
921 
922  Fw::TextLogString _logString;
923  _logString.format(
924  _formatString,
925 #if FW_OBJECT_NAMES == 1
926  this->m_objName.toChar(),
927 #endif
928  "ConfigError ",
929  device.toChar(),
930  error
931  );
932 
933  this->m_LogText_OutputPort[0].invoke(
934  _id,
935  _logTime,
937  _logString
938  );
939  }
940 #endif
941  }
942 
945  const Fw::StringBase& device,
946  I32 error
947  )
948  {
949  // Check throttle value
950  if (this->m_WriteErrorThrottle >= EVENTID_WRITEERROR_THROTTLE) {
951  return;
952  }
953  else {
954  this->m_WriteErrorThrottle++;
955  }
956 
957  // Get the time
958  Fw::Time _logTime;
959  if (this->m_Time_OutputPort[0].isConnected()) {
960  this->m_Time_OutputPort[0].invoke(_logTime);
961  }
962 
963  FwEventIdType _id = static_cast<FwEventIdType>(0);
964 
965  _id = this->getIdBase() + EVENTID_WRITEERROR;
966 
967  // Emit the event on the log port
968  if (this->m_Log_OutputPort[0].isConnected()) {
969  Fw::LogBuffer _logBuff;
971 
972 #if FW_AMPCS_COMPATIBLE
973  // Serialize the number of arguments
974  _status = _logBuff.serialize(static_cast<U8>(2));
975  FW_ASSERT(
976  _status == Fw::FW_SERIALIZE_OK,
977  static_cast<FwAssertArgType>(_status)
978  );
979 #endif
980 
981  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
982  FW_ASSERT(
983  _status == Fw::FW_SERIALIZE_OK,
984  static_cast<FwAssertArgType>(_status)
985  );
986 
987 #if FW_AMPCS_COMPATIBLE
988  // Serialize the argument size
989  _status = _logBuff.serialize(
990  static_cast<U8>(sizeof(I32))
991  );
992  FW_ASSERT(
993  _status == Fw::FW_SERIALIZE_OK,
994  static_cast<FwAssertArgType>(_status)
995  );
996 #endif
997  _status = _logBuff.serialize(error);
998  FW_ASSERT(
999  _status == Fw::FW_SERIALIZE_OK,
1000  static_cast<FwAssertArgType>(_status)
1001  );
1002 
1003  this->m_Log_OutputPort[0].invoke(
1004  _id,
1005  _logTime,
1007  _logBuff
1008  );
1009  }
1010 
1011  // Emit the event on the text log port
1012 #if FW_ENABLE_TEXT_LOGGING
1013  if (this->m_LogText_OutputPort[0].isConnected()) {
1014 #if FW_OBJECT_NAMES == 1
1015  const char* _formatString =
1016  "(%s) %s: Error writing UART device %s: %" PRIi32 "";
1017 #else
1018  const char* _formatString =
1019  "%s: Error writing UART device %s: %" PRIi32 "";
1020 #endif
1021 
1022  Fw::TextLogString _logString;
1023  _logString.format(
1024  _formatString,
1025 #if FW_OBJECT_NAMES == 1
1026  this->m_objName.toChar(),
1027 #endif
1028  "WriteError ",
1029  device.toChar(),
1030  error
1031  );
1032 
1033  this->m_LogText_OutputPort[0].invoke(
1034  _id,
1035  _logTime,
1037  _logString
1038  );
1039  }
1040 #endif
1041  }
1042 
1045  const Fw::StringBase& device,
1046  I32 error
1047  )
1048  {
1049  // Check throttle value
1050  if (this->m_ReadErrorThrottle >= EVENTID_READERROR_THROTTLE) {
1051  return;
1052  }
1053  else {
1054  this->m_ReadErrorThrottle++;
1055  }
1056 
1057  // Get the time
1058  Fw::Time _logTime;
1059  if (this->m_Time_OutputPort[0].isConnected()) {
1060  this->m_Time_OutputPort[0].invoke(_logTime);
1061  }
1062 
1063  FwEventIdType _id = static_cast<FwEventIdType>(0);
1064 
1065  _id = this->getIdBase() + EVENTID_READERROR;
1066 
1067  // Emit the event on the log port
1068  if (this->m_Log_OutputPort[0].isConnected()) {
1069  Fw::LogBuffer _logBuff;
1071 
1072 #if FW_AMPCS_COMPATIBLE
1073  // Serialize the number of arguments
1074  _status = _logBuff.serialize(static_cast<U8>(2));
1075  FW_ASSERT(
1076  _status == Fw::FW_SERIALIZE_OK,
1077  static_cast<FwAssertArgType>(_status)
1078  );
1079 #endif
1080 
1081  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1082  FW_ASSERT(
1083  _status == Fw::FW_SERIALIZE_OK,
1084  static_cast<FwAssertArgType>(_status)
1085  );
1086 
1087 #if FW_AMPCS_COMPATIBLE
1088  // Serialize the argument size
1089  _status = _logBuff.serialize(
1090  static_cast<U8>(sizeof(I32))
1091  );
1092  FW_ASSERT(
1093  _status == Fw::FW_SERIALIZE_OK,
1094  static_cast<FwAssertArgType>(_status)
1095  );
1096 #endif
1097  _status = _logBuff.serialize(error);
1098  FW_ASSERT(
1099  _status == Fw::FW_SERIALIZE_OK,
1100  static_cast<FwAssertArgType>(_status)
1101  );
1102 
1103  this->m_Log_OutputPort[0].invoke(
1104  _id,
1105  _logTime,
1107  _logBuff
1108  );
1109  }
1110 
1111  // Emit the event on the text log port
1112 #if FW_ENABLE_TEXT_LOGGING
1113  if (this->m_LogText_OutputPort[0].isConnected()) {
1114 #if FW_OBJECT_NAMES == 1
1115  const char* _formatString =
1116  "(%s) %s: Error reading UART device %s: %" PRIi32 "";
1117 #else
1118  const char* _formatString =
1119  "%s: Error reading UART device %s: %" PRIi32 "";
1120 #endif
1121 
1122  Fw::TextLogString _logString;
1123  _logString.format(
1124  _formatString,
1125 #if FW_OBJECT_NAMES == 1
1126  this->m_objName.toChar(),
1127 #endif
1128  "ReadError ",
1129  device.toChar(),
1130  error
1131  );
1132 
1133  this->m_LogText_OutputPort[0].invoke(
1134  _id,
1135  _logTime,
1137  _logString
1138  );
1139  }
1140 #endif
1141  }
1142 
1145  {
1146  // Get the time
1147  Fw::Time _logTime;
1148  if (this->m_Time_OutputPort[0].isConnected()) {
1149  this->m_Time_OutputPort[0].invoke(_logTime);
1150  }
1151 
1152  FwEventIdType _id = static_cast<FwEventIdType>(0);
1153 
1154  _id = this->getIdBase() + EVENTID_PORTOPENED;
1155 
1156  // Emit the event on the log port
1157  if (this->m_Log_OutputPort[0].isConnected()) {
1158  Fw::LogBuffer _logBuff;
1160 
1161 #if FW_AMPCS_COMPATIBLE
1162  // Serialize the number of arguments
1163  _status = _logBuff.serialize(static_cast<U8>(1));
1164  FW_ASSERT(
1165  _status == Fw::FW_SERIALIZE_OK,
1166  static_cast<FwAssertArgType>(_status)
1167  );
1168 #endif
1169 
1170  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1171  FW_ASSERT(
1172  _status == Fw::FW_SERIALIZE_OK,
1173  static_cast<FwAssertArgType>(_status)
1174  );
1175 
1176  this->m_Log_OutputPort[0].invoke(
1177  _id,
1178  _logTime,
1180  _logBuff
1181  );
1182  }
1183 
1184  // Emit the event on the text log port
1185 #if FW_ENABLE_TEXT_LOGGING
1186  if (this->m_LogText_OutputPort[0].isConnected()) {
1187 #if FW_OBJECT_NAMES == 1
1188  const char* _formatString =
1189  "(%s) %s: UART Device %s configured";
1190 #else
1191  const char* _formatString =
1192  "%s: UART Device %s configured";
1193 #endif
1194 
1195  Fw::TextLogString _logString;
1196  _logString.format(
1197  _formatString,
1198 #if FW_OBJECT_NAMES == 1
1199  this->m_objName.toChar(),
1200 #endif
1201  "PortOpened ",
1202  device.toChar()
1203  );
1204 
1205  this->m_LogText_OutputPort[0].invoke(
1206  _id,
1207  _logTime,
1209  _logString
1210  );
1211  }
1212 #endif
1213  }
1214 
1217  {
1218  // Check throttle value
1219  if (this->m_NoBuffersThrottle >= EVENTID_NOBUFFERS_THROTTLE) {
1220  return;
1221  }
1222  else {
1223  this->m_NoBuffersThrottle++;
1224  }
1225 
1226  // Get the time
1227  Fw::Time _logTime;
1228  if (this->m_Time_OutputPort[0].isConnected()) {
1229  this->m_Time_OutputPort[0].invoke(_logTime);
1230  }
1231 
1232  FwEventIdType _id = static_cast<FwEventIdType>(0);
1233 
1234  _id = this->getIdBase() + EVENTID_NOBUFFERS;
1235 
1236  // Emit the event on the log port
1237  if (this->m_Log_OutputPort[0].isConnected()) {
1238  Fw::LogBuffer _logBuff;
1240 
1241 #if FW_AMPCS_COMPATIBLE
1242  // Serialize the number of arguments
1243  _status = _logBuff.serialize(static_cast<U8>(1));
1244  FW_ASSERT(
1245  _status == Fw::FW_SERIALIZE_OK,
1246  static_cast<FwAssertArgType>(_status)
1247  );
1248 #endif
1249 
1250  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1251  FW_ASSERT(
1252  _status == Fw::FW_SERIALIZE_OK,
1253  static_cast<FwAssertArgType>(_status)
1254  );
1255 
1256  this->m_Log_OutputPort[0].invoke(
1257  _id,
1258  _logTime,
1260  _logBuff
1261  );
1262  }
1263 
1264  // Emit the event on the text log port
1265 #if FW_ENABLE_TEXT_LOGGING
1266  if (this->m_LogText_OutputPort[0].isConnected()) {
1267 #if FW_OBJECT_NAMES == 1
1268  const char* _formatString =
1269  "(%s) %s: UART Device %s ran out of buffers";
1270 #else
1271  const char* _formatString =
1272  "%s: UART Device %s ran out of buffers";
1273 #endif
1274 
1275  Fw::TextLogString _logString;
1276  _logString.format(
1277  _formatString,
1278 #if FW_OBJECT_NAMES == 1
1279  this->m_objName.toChar(),
1280 #endif
1281  "NoBuffers ",
1282  device.toChar()
1283  );
1284 
1285  this->m_LogText_OutputPort[0].invoke(
1286  _id,
1287  _logTime,
1289  _logString
1290  );
1291  }
1292 #endif
1293  }
1294 
1297  const Fw::StringBase& device,
1298  U32 size,
1299  U32 needed
1300  )
1301  {
1302  // Get the time
1303  Fw::Time _logTime;
1304  if (this->m_Time_OutputPort[0].isConnected()) {
1305  this->m_Time_OutputPort[0].invoke(_logTime);
1306  }
1307 
1308  FwEventIdType _id = static_cast<FwEventIdType>(0);
1309 
1310  _id = this->getIdBase() + EVENTID_BUFFERTOOSMALL;
1311 
1312  // Emit the event on the log port
1313  if (this->m_Log_OutputPort[0].isConnected()) {
1314  Fw::LogBuffer _logBuff;
1316 
1317 #if FW_AMPCS_COMPATIBLE
1318  // Serialize the number of arguments
1319  _status = _logBuff.serialize(static_cast<U8>(3));
1320  FW_ASSERT(
1321  _status == Fw::FW_SERIALIZE_OK,
1322  static_cast<FwAssertArgType>(_status)
1323  );
1324 #endif
1325 
1326  _status = device.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1327  FW_ASSERT(
1328  _status == Fw::FW_SERIALIZE_OK,
1329  static_cast<FwAssertArgType>(_status)
1330  );
1331 
1332 #if FW_AMPCS_COMPATIBLE
1333  // Serialize the argument size
1334  _status = _logBuff.serialize(
1335  static_cast<U8>(sizeof(U32))
1336  );
1337  FW_ASSERT(
1338  _status == Fw::FW_SERIALIZE_OK,
1339  static_cast<FwAssertArgType>(_status)
1340  );
1341 #endif
1342  _status = _logBuff.serialize(size);
1343  FW_ASSERT(
1344  _status == Fw::FW_SERIALIZE_OK,
1345  static_cast<FwAssertArgType>(_status)
1346  );
1347 
1348 #if FW_AMPCS_COMPATIBLE
1349  // Serialize the argument size
1350  _status = _logBuff.serialize(
1351  static_cast<U8>(sizeof(U32))
1352  );
1353  FW_ASSERT(
1354  _status == Fw::FW_SERIALIZE_OK,
1355  static_cast<FwAssertArgType>(_status)
1356  );
1357 #endif
1358  _status = _logBuff.serialize(needed);
1359  FW_ASSERT(
1360  _status == Fw::FW_SERIALIZE_OK,
1361  static_cast<FwAssertArgType>(_status)
1362  );
1363 
1364  this->m_Log_OutputPort[0].invoke(
1365  _id,
1366  _logTime,
1368  _logBuff
1369  );
1370  }
1371 
1372  // Emit the event on the text log port
1373 #if FW_ENABLE_TEXT_LOGGING
1374  if (this->m_LogText_OutputPort[0].isConnected()) {
1375 #if FW_OBJECT_NAMES == 1
1376  const char* _formatString =
1377  "(%s) %s: UART Device %s target buffer too small. Size: %" PRIu32 " Needs: %" PRIu32 "";
1378 #else
1379  const char* _formatString =
1380  "%s: UART Device %s target buffer too small. Size: %" PRIu32 " Needs: %" PRIu32 "";
1381 #endif
1382 
1383  Fw::TextLogString _logString;
1384  _logString.format(
1385  _formatString,
1386 #if FW_OBJECT_NAMES == 1
1387  this->m_objName.toChar(),
1388 #endif
1389  "BufferTooSmall ",
1390  device.toChar(),
1391  size,
1392  needed
1393  );
1394 
1395  this->m_LogText_OutputPort[0].invoke(
1396  _id,
1397  _logTime,
1399  _logString
1400  );
1401  }
1402 #endif
1403  }
1404 
1405  // ----------------------------------------------------------------------
1406  // Event throttle reset functions
1407  // ----------------------------------------------------------------------
1408 
1411  {
1412  // Reset throttle counter
1413  this->m_WriteErrorThrottle = 0;
1414  }
1415 
1418  {
1419  // Reset throttle counter
1420  this->m_ReadErrorThrottle = 0;
1421  }
1422 
1425  {
1426  // Reset throttle counter
1427  this->m_NoBuffersThrottle = 0;
1428  }
1429 
1430  // ----------------------------------------------------------------------
1431  // Telemetry write functions
1432  // ----------------------------------------------------------------------
1433 
1436  U32 arg,
1437  Fw::Time _tlmTime
1438  )
1439  {
1440  if (this->m_Tlm_OutputPort[0].isConnected()) {
1441  if (
1442  this->m_Time_OutputPort[0].isConnected() &&
1443  (_tlmTime == Fw::ZERO_TIME)
1444  ) {
1445  this->m_Time_OutputPort[0].invoke(_tlmTime);
1446  }
1447 
1448  Fw::TlmBuffer _tlmBuff;
1449  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1450  FW_ASSERT(
1451  _stat == Fw::FW_SERIALIZE_OK,
1452  static_cast<FwAssertArgType>(_stat)
1453  );
1454 
1455  FwChanIdType _id;
1456 
1457  _id = this->getIdBase() + CHANNELID_BYTESSENT;
1458 
1459  this->m_Tlm_OutputPort[0].invoke(
1460  _id,
1461  _tlmTime,
1462  _tlmBuff
1463  );
1464  }
1465  }
1466 
1469  U32 arg,
1470  Fw::Time _tlmTime
1471  )
1472  {
1473  if (this->m_Tlm_OutputPort[0].isConnected()) {
1474  if (
1475  this->m_Time_OutputPort[0].isConnected() &&
1476  (_tlmTime == Fw::ZERO_TIME)
1477  ) {
1478  this->m_Time_OutputPort[0].invoke(_tlmTime);
1479  }
1480 
1481  Fw::TlmBuffer _tlmBuff;
1482  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1483  FW_ASSERT(
1484  _stat == Fw::FW_SERIALIZE_OK,
1485  static_cast<FwAssertArgType>(_stat)
1486  );
1487 
1488  FwChanIdType _id;
1489 
1490  _id = this->getIdBase() + CHANNELID_BYTESRECV;
1491 
1492  this->m_Tlm_OutputPort[0].invoke(
1493  _id,
1494  _tlmTime,
1495  _tlmBuff
1496  );
1497  }
1498  }
1499 
1500  // ----------------------------------------------------------------------
1501  // Time
1502  // ----------------------------------------------------------------------
1503 
1505  getTime()
1506  {
1507  if (this->m_Time_OutputPort[0].isConnected()) {
1508  Fw::Time _time;
1509  this->m_Time_OutputPort[0].invoke(_time);
1510  return _time;
1511  }
1512  else {
1513  return Fw::Time(TB_NONE, 0, 0);
1514  }
1515  }
1516 
1517  // ----------------------------------------------------------------------
1518  // Mutex operations for guarded ports
1519  //
1520  // You can override these operations to provide more sophisticated
1521  // synchronization
1522  // ----------------------------------------------------------------------
1523 
1525  lock()
1526  {
1527  this->m_guardedPortMutex.lock();
1528  }
1529 
1531  unLock()
1532  {
1533  this->m_guardedPortMutex.unLock();
1534  }
1535 
1536  // ----------------------------------------------------------------------
1537  // Calls for messages received on typed input ports
1538  // ----------------------------------------------------------------------
1539 
1540  Drv::SendStatus LinuxUartDriverComponentBase ::
1541  m_p_send_in(
1542  Fw::PassiveComponentBase* callComp,
1543  FwIndexType portNum,
1544  Fw::Buffer& sendBuffer
1545  )
1546  {
1547  FW_ASSERT(callComp);
1548  LinuxUartDriverComponentBase* compPtr = static_cast<LinuxUartDriverComponentBase*>(callComp);
1549  return compPtr->send_handlerBase(
1550  portNum,
1551  sendBuffer
1552  );
1553  }
1554 
1555 }
#define FW_ASSERT(...)
Definition: Assert.hpp:14
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:68
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:26
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:66
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
Definition: FpConfig.h:57
I32 FwEnumStoreType
Definition: FpConfig.h:51
PlatformAssertArgType FwAssertArgType
Definition: FpConfig.h:34
U32 FwChanIdType
Definition: FpConfig.h:82
U32 FwEventIdType
Definition: FpConfig.h:86
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Definition: FpConfig.h:300
PlatformIndexType FwIndexType
Definition: FpConfig.h:20
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
Definition: FpConfig.h:135
void init()
Initialization function.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Auto-generated base for LinuxUartDriver component.
void deallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port deallocate.
void log_WARNING_HI_WriteError_ThrottleClear()
Reset throttle value for WriteError.
@ EVENTID_WRITEERROR_THROTTLE
Throttle reset count for WriteError.
@ EVENTID_READERROR_THROTTLE
Throttle reset count for ReadError.
@ EVENTID_NOBUFFERS_THROTTLE
Throttle reset count for NoBuffers.
LinuxUartDriverComponentBase(const char *compName="")
Construct LinuxUartDriverComponentBase object.
void log_WARNING_HI_OpenError(const Fw::StringBase &device, I32 error, const Fw::StringBase &name)
bool isConnected_Time_OutputPort(FwIndexType portNum)
void log_WARNING_HI_BufferTooSmall(const Fw::StringBase &device, U32 size, U32 needed)
@ CHANNELID_BYTESRECV
Channel ID for BytesRecv.
@ CHANNELID_BYTESSENT
Channel ID for BytesSent.
Drv::InputByteStreamSendPort * get_send_InputPort(FwIndexType portNum)
bool isConnected_deallocate_OutputPort(FwIndexType portNum)
void log_WARNING_HI_NoBuffers_ThrottleClear()
Reset throttle value for NoBuffers.
@ EVENTID_BUFFERTOOSMALL
UART ran out of buffers.
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
void ready_out(FwIndexType portNum)
Invoke output port ready.
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void tlmWrite_BytesSent(U32 arg, Fw::Time _tlmTime=Fw::Time())
Drv::SendStatus send_handlerBase(FwIndexType portNum, Fw::Buffer &sendBuffer)
Handler base-class function for input port send.
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void log_WARNING_HI_ReadError_ThrottleClear()
Reset throttle value for ReadError.
void log_WARNING_HI_WriteError(const Fw::StringBase &device, I32 error)
void recv_out(FwIndexType portNum, Fw::Buffer &recvBuffer, const Drv::RecvStatus &recvStatus)
Invoke output port recv.
bool isConnected_Log_OutputPort(FwIndexType portNum)
void log_WARNING_HI_ConfigError(const Fw::StringBase &device, I32 error)
void tlmWrite_BytesRecv(U32 arg, Fw::Time _tlmTime=Fw::Time())
void log_WARNING_HI_NoBuffers(const Fw::StringBase &device)
void log_ACTIVITY_HI_PortOpened(const Fw::StringBase &device)
bool isConnected_recv_OutputPort(FwIndexType portNum)
bool isConnected_allocate_OutputPort(FwIndexType portNum)
bool isConnected_ready_OutputPort(FwIndexType portNum)
virtual Drv::SendStatus send_handler(FwIndexType portNum, Fw::Buffer &sendBuffer)=0
Handler for input port send.
void set_allocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to allocate[portNum].
Fw::Buffer allocate_out(FwIndexType portNum, U32 size)
Invoke output port allocate.
void set_recv_OutputPort(FwIndexType portNum, Drv::InputByteStreamRecvPort *port)
Connect port to recv[portNum].
virtual ~LinuxUartDriverComponentBase()
Destroy LinuxUartDriverComponentBase object.
void set_ready_OutputPort(FwIndexType portNum, Drv::InputByteStreamReadyPort *port)
Connect port to ready[portNum].
void set_deallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to deallocate[portNum].
virtual void lock()
Lock the guarded mutex.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
virtual void unLock()
Unlock the guarded mutex.
void log_WARNING_HI_ReadError(const Fw::StringBase &device, I32 error)
void invoke()
Invoke a port interface.
void addCallPort(InputByteStreamReadyPort *callPort)
Register an input port.
void init()
Initialization function.
void init()
Initialization function.
void addCallPort(InputByteStreamRecvPort *callPort)
Register an input port.
void invoke(Fw::Buffer &recvBuffer, const Drv::RecvStatus &recvStatus)
Invoke a port interface.
Status associated with the received data.
Status returned by the send call.
void setPortNum(NATIVE_INT_TYPE portNum)
@ WARNING_HI
A serious but recoverable event.
@ ACTIVITY_HI
Important informational events.
void init()
Object initializer.
Definition: ObjBase.cpp:27
const char * toChar() const
Definition: ObjectName.hpp:50
void init()
Initialization function.
void addCallPort(InputBufferGetPort *callPort)
Register an input port.
Fw::Buffer invoke(U32 size)
Invoke a port interface.
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void invoke(Fw::Buffer &fwBuffer)
Invoke a port interface.
void init()
Initialization function.
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
Definition: LogPortAc.cpp:170
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
void invoke(Fw::Time &time)
Invoke a port interface.
Definition: TimePortAc.cpp:147
void init()
Initialization function.
Definition: TimePortAc.cpp:128
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected()
Definition: PortBase.cpp:41
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
virtual const CHAR * toChar() const =0
void format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:56
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
Definition: StringBase.cpp:137
Definition: Time.hpp:9
void unLock()
unlock the mutex
Definition: Mutex.cpp:13
void lock()
lock the mutex
Definition: Mutex.cpp:12
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
const Time ZERO_TIME
Definition: Time.cpp:5