10 #if FW_ENABLE_TEXT_LOGGING
32 this->m_send_InputPort[port].
init();
39 #if FW_OBJECT_NAMES == 1
43 this->m_objName.toChar(),
46 this->m_send_InputPort[port].setObjName(portName.
toChar());
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());
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());
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());
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());
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());
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());
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());
217 return &this->m_send_InputPort[portNum];
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);
267 this->m_Time_OutputPort[portNum].
addCallPort(port);
299 this->m_allocate_OutputPort[portNum].
addCallPort(port);
313 this->m_deallocate_OutputPort[portNum].
addCallPort(port);
327 this->m_ready_OutputPort[portNum].
addCallPort(port);
341 this->m_recv_OutputPort[portNum].
addCallPort(port);
344 #if FW_PORT_SERIALIZATION
353 Fw::InputSerializePort* port
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);
385 Fw::InputSerializePort* port
393 this->m_Time_OutputPort[portNum].registerSerialPort(port);
399 Fw::InputSerializePort* port
407 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
412 #if FW_PORT_SERIALIZATION
421 Fw::InputSerializePort* port
429 this->m_deallocate_OutputPort[portNum].registerSerialPort(port);
435 Fw::InputSerializePort* port
443 this->m_ready_OutputPort[portNum].registerSerialPort(port);
449 Fw::InputSerializePort* port
457 this->m_recv_OutputPort[portNum].registerSerialPort(port);
468 Fw::PassiveComponentBase(compName)
470 this->m_WriteErrorThrottle = 0;
471 this->m_ReadErrorThrottle = 0;
472 this->m_NoBuffersThrottle = 0;
501 #if FW_ENABLE_TEXT_LOGGING == 1
504 getNum_LogText_OutputPorts()
const
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();
589 return this->m_Time_OutputPort[portNum].
isConnected();
600 return this->m_Tlm_OutputPort[portNum].
isConnected();
615 return this->m_allocate_OutputPort[portNum].
isConnected();
626 return this->m_deallocate_OutputPort[portNum].
isConnected();
637 return this->m_ready_OutputPort[portNum].
isConnected();
648 return this->m_recv_OutputPort[portNum].
isConnected();
700 return this->m_allocate_OutputPort[portNum].
invoke(
715 this->m_deallocate_OutputPort[portNum].
invoke(
727 this->m_ready_OutputPort[portNum].
invoke();
741 this->m_recv_OutputPort[portNum].
invoke(
760 if (this->m_Time_OutputPort[0].isConnected()) {
761 this->m_Time_OutputPort[0].
invoke(_logTime);
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(
859 if (this->m_Time_OutputPort[0].isConnected()) {
860 this->m_Time_OutputPort[0].
invoke(_logTime);
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(
954 this->m_WriteErrorThrottle++;
959 if (this->m_Time_OutputPort[0].isConnected()) {
960 this->m_Time_OutputPort[0].
invoke(_logTime);
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(
1054 this->m_ReadErrorThrottle++;
1059 if (this->m_Time_OutputPort[0].isConnected()) {
1060 this->m_Time_OutputPort[0].
invoke(_logTime);
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(
1148 if (this->m_Time_OutputPort[0].isConnected()) {
1149 this->m_Time_OutputPort[0].
invoke(_logTime);
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(
1223 this->m_NoBuffersThrottle++;
1228 if (this->m_Time_OutputPort[0].isConnected()) {
1229 this->m_Time_OutputPort[0].
invoke(_logTime);
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(
1304 if (this->m_Time_OutputPort[0].isConnected()) {
1305 this->m_Time_OutputPort[0].
invoke(_logTime);
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(
1413 this->m_WriteErrorThrottle = 0;
1420 this->m_ReadErrorThrottle = 0;
1427 this->m_NoBuffersThrottle = 0;
1440 if (this->m_Tlm_OutputPort[0].isConnected()) {
1442 this->m_Time_OutputPort[0].isConnected() &&
1445 this->m_Time_OutputPort[0].
invoke(_tlmTime);
1459 this->m_Tlm_OutputPort[0].
invoke(
1473 if (this->m_Tlm_OutputPort[0].isConnected()) {
1475 this->m_Time_OutputPort[0].isConnected() &&
1478 this->m_Time_OutputPort[0].
invoke(_tlmTime);
1492 this->m_Tlm_OutputPort[0].
invoke(
1507 if (this->m_Time_OutputPort[0].isConnected()) {
1509 this->m_Time_OutputPort[0].
invoke(_time);
1527 this->m_guardedPortMutex.
lock();
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)
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.
@ EVENTID_CONFIGERROR
UART config error.
@ EVENTID_WRITEERROR
UART write error.
@ EVENTID_BUFFERTOOSMALL
UART ran out of buffers.
@ EVENTID_OPENERROR
UART open error.
@ EVENTID_PORTOPENED
UART port opened event.
@ EVENTID_NOBUFFERS
UART ran out of buffers.
@ EVENTID_READERROR
UART read error.
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)
FwIndexType getNum_allocate_OutputPorts() const
void log_WARNING_HI_BufferTooSmall(const Fw::StringBase &device, U32 size, U32 needed)
FwIndexType getNum_Tlm_OutputPorts() const
Drv::InputByteStreamSendPort * get_send_InputPort(FwIndexType portNum)
bool isConnected_deallocate_OutputPort(FwIndexType portNum)
FwIndexType getNum_send_InputPorts() const
void log_WARNING_HI_NoBuffers_ThrottleClear()
Reset throttle value for NoBuffers.
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)
@ CHANNELID_BYTESRECV
Channel ID for BytesRecv.
@ CHANNELID_BYTESSENT
Channel ID for BytesSent.
FwIndexType getNum_Time_OutputPorts() const
bool isConnected_recv_OutputPort(FwIndexType portNum)
FwIndexType getNum_ready_OutputPorts() const
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.
FwIndexType getNum_deallocate_OutputPorts() const
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.
FwIndexType getNum_recv_OutputPorts() const
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.
FwIndexType getNum_Log_OutputPorts() const
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.
@ WARNING_HI
A serious but recoverable event.
@ ACTIVITY_HI
Important informational events.
void init()
Object initializer.
const char * toChar() const
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.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
void addCallPort(InputLogPort *callPort)
Register an input port.
void addCallPort(InputTimePort *callPort)
Register an input port.
void invoke(Fw::Time &time)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputTlmPort *callPort)
Register an input port.
void init()
Initialization function.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke a port interface.
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
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
void unLock()
unlock the mutex and assert success
void lock()
lock the mutex and assert success
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.