10#if FW_ENABLE_TEXT_LOGGING
20 void LinuxUartDriverComponentBase ::
29 port < static_cast<FwIndexType>(this->getNum_send_InputPorts());
32 this->m_send_InputPort[port].init();
33 this->m_send_InputPort[port].addCallComp(
37 this->m_send_InputPort[port].setPortNum(port);
39#if FW_OBJECT_NAMES == 1
43 this->m_objName.toChar(),
46 this->m_send_InputPort[port].setObjName(portName.
toChar());
53 port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
56 this->m_Log_OutputPort[port].init();
58#if FW_OBJECT_NAMES == 1
62 this->m_objName.toChar(),
65 this->m_Log_OutputPort[port].setObjName(portName.
toChar());
69#if FW_ENABLE_TEXT_LOGGING == 1
73 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
76 this->m_LogText_OutputPort[port].init();
78#if FW_OBJECT_NAMES == 1
82 this->m_objName.toChar(),
85 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
93 port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
96 this->m_Time_OutputPort[port].init();
98#if FW_OBJECT_NAMES == 1
102 this->m_objName.toChar(),
105 this->m_Time_OutputPort[port].setObjName(portName.
toChar());
112 port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
115 this->m_Tlm_OutputPort[port].init();
117#if FW_OBJECT_NAMES == 1
121 this->m_objName.toChar(),
124 this->m_Tlm_OutputPort[port].setObjName(portName.
toChar());
131 port < static_cast<FwIndexType>(this->getNum_allocate_OutputPorts());
134 this->m_allocate_OutputPort[port].init();
136#if FW_OBJECT_NAMES == 1
140 this->m_objName.toChar(),
143 this->m_allocate_OutputPort[port].setObjName(portName.
toChar());
150 port < static_cast<FwIndexType>(this->getNum_deallocate_OutputPorts());
153 this->m_deallocate_OutputPort[port].init();
155#if FW_OBJECT_NAMES == 1
159 this->m_objName.toChar(),
162 this->m_deallocate_OutputPort[port].setObjName(portName.
toChar());
169 port < static_cast<FwIndexType>(this->getNum_ready_OutputPorts());
172 this->m_ready_OutputPort[port].init();
174#if FW_OBJECT_NAMES == 1
178 this->m_objName.toChar(),
181 this->m_ready_OutputPort[port].setObjName(portName.
toChar());
188 port < static_cast<FwIndexType>(this->getNum_recv_OutputPorts());
191 this->m_recv_OutputPort[port].init();
193#if FW_OBJECT_NAMES == 1
197 this->m_objName.toChar(),
200 this->m_recv_OutputPort[port].setObjName(portName.
toChar());
213 portNum < this->getNum_send_InputPorts(),
217 return &this->m_send_InputPort[portNum];
224 void LinuxUartDriverComponentBase ::
231 portNum < this->getNum_Log_OutputPorts(),
235 this->m_Log_OutputPort[portNum].addCallPort(port);
238#if FW_ENABLE_TEXT_LOGGING == 1
240 void LinuxUartDriverComponentBase ::
241 set_LogText_OutputPort(
247 portNum < this->getNum_LogText_OutputPorts(),
251 this->m_LogText_OutputPort[portNum].addCallPort(port);
256 void LinuxUartDriverComponentBase ::
263 portNum < this->getNum_Time_OutputPorts(),
267 this->m_Time_OutputPort[portNum].addCallPort(port);
270 void LinuxUartDriverComponentBase ::
277 portNum < this->getNum_Tlm_OutputPorts(),
281 this->m_Tlm_OutputPort[portNum].addCallPort(port);
288 void LinuxUartDriverComponentBase ::
289 set_allocate_OutputPort(
295 portNum < this->getNum_allocate_OutputPorts(),
299 this->m_allocate_OutputPort[portNum].addCallPort(port);
302 void LinuxUartDriverComponentBase ::
303 set_deallocate_OutputPort(
309 portNum < this->getNum_deallocate_OutputPorts(),
313 this->m_deallocate_OutputPort[portNum].addCallPort(port);
316 void LinuxUartDriverComponentBase ::
317 set_ready_OutputPort(
323 portNum < this->getNum_ready_OutputPorts(),
327 this->m_ready_OutputPort[portNum].addCallPort(port);
330 void LinuxUartDriverComponentBase ::
337 portNum < this->getNum_recv_OutputPorts(),
341 this->m_recv_OutputPort[portNum].addCallPort(port);
344#if FW_PORT_SERIALIZATION
350 void LinuxUartDriverComponentBase ::
353 Fw::InputSerializePort* port
357 portNum < this->getNum_Log_OutputPorts(),
361 this->m_Log_OutputPort[portNum].registerSerialPort(port);
364#if FW_ENABLE_TEXT_LOGGING == 1
366 void LinuxUartDriverComponentBase ::
367 set_LogText_OutputPort(
369 Fw::InputSerializePort* port
373 portNum < this->getNum_LogText_OutputPorts(),
377 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
382 void LinuxUartDriverComponentBase ::
385 Fw::InputSerializePort* port
389 portNum < this->getNum_Time_OutputPorts(),
393 this->m_Time_OutputPort[portNum].registerSerialPort(port);
396 void LinuxUartDriverComponentBase ::
399 Fw::InputSerializePort* port
403 portNum < this->getNum_Tlm_OutputPorts(),
407 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
412#if FW_PORT_SERIALIZATION
418 void LinuxUartDriverComponentBase ::
419 set_deallocate_OutputPort(
421 Fw::InputSerializePort* port
425 portNum < this->getNum_deallocate_OutputPorts(),
429 this->m_deallocate_OutputPort[portNum].registerSerialPort(port);
432 void LinuxUartDriverComponentBase ::
433 set_ready_OutputPort(
435 Fw::InputSerializePort* port
439 portNum < this->getNum_ready_OutputPorts(),
443 this->m_ready_OutputPort[portNum].registerSerialPort(port);
446 void LinuxUartDriverComponentBase ::
449 Fw::InputSerializePort* port
453 portNum < this->getNum_recv_OutputPorts(),
457 this->m_recv_OutputPort[portNum].registerSerialPort(port);
466 LinuxUartDriverComponentBase ::
467 LinuxUartDriverComponentBase(
const char* compName) :
468 Fw::PassiveComponentBase(compName)
470 this->m_WriteErrorThrottle = 0;
471 this->m_ReadErrorThrottle = 0;
472 this->m_NoBuffersThrottle = 0;
475 LinuxUartDriverComponentBase ::
476 ~LinuxUartDriverComponentBase()
486 getNum_send_InputPorts()
const
496 getNum_Log_OutputPorts()
const
501#if FW_ENABLE_TEXT_LOGGING == 1
504 getNum_LogText_OutputPorts()
const
512 getNum_Time_OutputPorts()
const
518 getNum_Tlm_OutputPorts()
const
528 getNum_allocate_OutputPorts()
const
534 getNum_deallocate_OutputPorts()
const
540 getNum_ready_OutputPorts()
const
546 getNum_recv_OutputPorts()
const
555 bool LinuxUartDriverComponentBase ::
559 portNum < this->getNum_Log_OutputPorts(),
563 return this->m_Log_OutputPort[portNum].isConnected();
566#if FW_ENABLE_TEXT_LOGGING == 1
568 bool LinuxUartDriverComponentBase ::
569 isConnected_LogText_OutputPort(
FwIndexType portNum)
572 portNum < this->getNum_LogText_OutputPorts(),
576 return this->m_LogText_OutputPort[portNum].isConnected();
581 bool LinuxUartDriverComponentBase ::
585 portNum < this->getNum_Time_OutputPorts(),
589 return this->m_Time_OutputPort[portNum].isConnected();
592 bool LinuxUartDriverComponentBase ::
596 portNum < this->getNum_Tlm_OutputPorts(),
600 return this->m_Tlm_OutputPort[portNum].isConnected();
607 bool LinuxUartDriverComponentBase ::
608 isConnected_allocate_OutputPort(
FwIndexType portNum)
611 portNum < this->getNum_allocate_OutputPorts(),
615 return this->m_allocate_OutputPort[portNum].isConnected();
618 bool LinuxUartDriverComponentBase ::
619 isConnected_deallocate_OutputPort(
FwIndexType portNum)
622 portNum < this->getNum_deallocate_OutputPorts(),
626 return this->m_deallocate_OutputPort[portNum].isConnected();
629 bool LinuxUartDriverComponentBase ::
633 portNum < this->getNum_ready_OutputPorts(),
637 return this->m_ready_OutputPort[portNum].isConnected();
640 bool LinuxUartDriverComponentBase ::
644 portNum < this->getNum_recv_OutputPorts(),
648 return this->m_recv_OutputPort[portNum].isConnected();
665 portNum < this->getNum_send_InputPorts(),
675 retVal = this->send_handler(
697 portNum < this->getNum_allocate_OutputPorts(),
700 return this->m_allocate_OutputPort[portNum].invoke(
705 void LinuxUartDriverComponentBase ::
712 portNum < this->getNum_deallocate_OutputPorts(),
715 this->m_deallocate_OutputPort[portNum].invoke(
720 void LinuxUartDriverComponentBase ::
724 portNum < this->getNum_ready_OutputPorts(),
727 this->m_ready_OutputPort[portNum].invoke();
730 void LinuxUartDriverComponentBase ::
738 portNum < this->getNum_recv_OutputPorts(),
741 this->m_recv_OutputPort[portNum].invoke(
751 void LinuxUartDriverComponentBase ::
752 log_WARNING_HI_OpenError(
760 if (this->m_Time_OutputPort[0].isConnected()) {
761 this->m_Time_OutputPort[0].invoke(_logTime);
766 _id = this->getIdBase() + EVENTID_OPENERROR;
769 if (this->m_Log_OutputPort[0].isConnected()) {
773#if FW_AMPCS_COMPATIBLE
788#if FW_AMPCS_COMPATIBLE
791 static_cast<U8>(
sizeof(I32))
810 this->m_Log_OutputPort[0].invoke(
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";
825 const char* _formatString =
826 "%s: Error opening UART device %s: %" PRIi32
" %s";
833 this->m_objName.toChar(),
841 this->m_LogText_OutputPort[0].invoke(
851 void LinuxUartDriverComponentBase ::
852 log_WARNING_HI_ConfigError(
859 if (this->m_Time_OutputPort[0].isConnected()) {
860 this->m_Time_OutputPort[0].invoke(_logTime);
865 _id = this->getIdBase() + EVENTID_CONFIGERROR;
868 if (this->m_Log_OutputPort[0].isConnected()) {
872#if FW_AMPCS_COMPATIBLE
887#if FW_AMPCS_COMPATIBLE
890 static_cast<U8>(
sizeof(I32))
903 this->m_Log_OutputPort[0].invoke(
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
"";
918 const char* _formatString =
919 "%s: Error configuring UART device %s: %" PRIi32
"";
926 this->m_objName.toChar(),
933 this->m_LogText_OutputPort[0].invoke(
943 void LinuxUartDriverComponentBase ::
944 log_WARNING_HI_WriteError(
950 if (this->m_WriteErrorThrottle >= EVENTID_WRITEERROR_THROTTLE) {
954 this->m_WriteErrorThrottle++;
959 if (this->m_Time_OutputPort[0].isConnected()) {
960 this->m_Time_OutputPort[0].invoke(_logTime);
965 _id = this->getIdBase() + EVENTID_WRITEERROR;
968 if (this->m_Log_OutputPort[0].isConnected()) {
972#if FW_AMPCS_COMPATIBLE
987#if FW_AMPCS_COMPATIBLE
990 static_cast<U8>(
sizeof(I32))
1003 this->m_Log_OutputPort[0].invoke(
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
"";
1018 const char* _formatString =
1019 "%s: Error writing UART device %s: %" PRIi32
"";
1026 this->m_objName.toChar(),
1033 this->m_LogText_OutputPort[0].invoke(
1043 void LinuxUartDriverComponentBase ::
1044 log_WARNING_HI_ReadError(
1050 if (this->m_ReadErrorThrottle >= EVENTID_READERROR_THROTTLE) {
1054 this->m_ReadErrorThrottle++;
1059 if (this->m_Time_OutputPort[0].isConnected()) {
1060 this->m_Time_OutputPort[0].invoke(_logTime);
1065 _id = this->getIdBase() + EVENTID_READERROR;
1068 if (this->m_Log_OutputPort[0].isConnected()) {
1072#if FW_AMPCS_COMPATIBLE
1087#if FW_AMPCS_COMPATIBLE
1090 static_cast<U8>(
sizeof(I32))
1103 this->m_Log_OutputPort[0].invoke(
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
"";
1118 const char* _formatString =
1119 "%s: Error reading UART device %s: %" PRIi32
"";
1126 this->m_objName.toChar(),
1133 this->m_LogText_OutputPort[0].invoke(
1143 void LinuxUartDriverComponentBase ::
1148 if (this->m_Time_OutputPort[0].isConnected()) {
1149 this->m_Time_OutputPort[0].invoke(_logTime);
1154 _id = this->getIdBase() + EVENTID_PORTOPENED;
1157 if (this->m_Log_OutputPort[0].isConnected()) {
1161#if FW_AMPCS_COMPATIBLE
1176 this->m_Log_OutputPort[0].invoke(
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";
1191 const char* _formatString =
1192 "%s: UART Device %s configured";
1199 this->m_objName.toChar(),
1205 this->m_LogText_OutputPort[0].invoke(
1215 void LinuxUartDriverComponentBase ::
1219 if (this->m_NoBuffersThrottle >= EVENTID_NOBUFFERS_THROTTLE) {
1223 this->m_NoBuffersThrottle++;
1228 if (this->m_Time_OutputPort[0].isConnected()) {
1229 this->m_Time_OutputPort[0].invoke(_logTime);
1234 _id = this->getIdBase() + EVENTID_NOBUFFERS;
1237 if (this->m_Log_OutputPort[0].isConnected()) {
1241#if FW_AMPCS_COMPATIBLE
1256 this->m_Log_OutputPort[0].invoke(
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";
1271 const char* _formatString =
1272 "%s: UART Device %s ran out of buffers";
1279 this->m_objName.toChar(),
1285 this->m_LogText_OutputPort[0].invoke(
1295 void LinuxUartDriverComponentBase ::
1296 log_WARNING_HI_BufferTooSmall(
1304 if (this->m_Time_OutputPort[0].isConnected()) {
1305 this->m_Time_OutputPort[0].invoke(_logTime);
1310 _id = this->getIdBase() + EVENTID_BUFFERTOOSMALL;
1313 if (this->m_Log_OutputPort[0].isConnected()) {
1317#if FW_AMPCS_COMPATIBLE
1332#if FW_AMPCS_COMPATIBLE
1335 static_cast<U8>(
sizeof(U32))
1348#if FW_AMPCS_COMPATIBLE
1351 static_cast<U8>(
sizeof(U32))
1364 this->m_Log_OutputPort[0].invoke(
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
"";
1379 const char* _formatString =
1380 "%s: UART Device %s target buffer too small. Size: %" PRIu32
" Needs: %" PRIu32
"";
1387 this->m_objName.toChar(),
1395 this->m_LogText_OutputPort[0].invoke(
1409 void LinuxUartDriverComponentBase ::
1410 log_WARNING_HI_WriteError_ThrottleClear()
1413 this->m_WriteErrorThrottle = 0;
1416 void LinuxUartDriverComponentBase ::
1417 log_WARNING_HI_ReadError_ThrottleClear()
1420 this->m_ReadErrorThrottle = 0;
1423 void LinuxUartDriverComponentBase ::
1424 log_WARNING_HI_NoBuffers_ThrottleClear()
1427 this->m_NoBuffersThrottle = 0;
1434 void LinuxUartDriverComponentBase ::
1440 if (this->m_Tlm_OutputPort[0].isConnected()) {
1442 this->m_Time_OutputPort[0].isConnected() &&
1445 this->m_Time_OutputPort[0].invoke(_tlmTime);
1457 _id = this->getIdBase() + CHANNELID_BYTESSENT;
1459 this->m_Tlm_OutputPort[0].invoke(
1467 void LinuxUartDriverComponentBase ::
1473 if (this->m_Tlm_OutputPort[0].isConnected()) {
1475 this->m_Time_OutputPort[0].isConnected() &&
1478 this->m_Time_OutputPort[0].invoke(_tlmTime);
1490 _id = this->getIdBase() + CHANNELID_BYTESRECV;
1492 this->m_Tlm_OutputPort[0].invoke(
1507 if (this->m_Time_OutputPort[0].isConnected()) {
1509 this->m_Time_OutputPort[0].invoke(_time);
1524 void LinuxUartDriverComponentBase ::
1527 this->m_guardedPortMutex.lock();
1530 void LinuxUartDriverComponentBase ::
1533 this->m_guardedPortMutex.unLock();
#define FW_MIN(a, b)
MIN macro.
uint8_t U8
8-bit unsigned integer
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
PlatformAssertArgType FwAssertArgType
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
PlatformIndexType FwIndexType
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)/*#en...
Auto-generated base for LinuxUartDriver component.
Drv::SendStatus send_handlerBase(FwIndexType portNum, Fw::Buffer &sendBuffer)
Handler base-class function for input port send.
Status associated with the received data.
Status returned by the send call.
@ WARNING_HI
A serious but recoverable event.
@ ACTIVITY_HI
Important informational events.
void init()
Object initializer.
const char * toChar() const
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void format(const CHAR *formatString,...)
write formatted string to buffer
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
virtual const CHAR * toChar() const =0
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.