Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Drv/LinuxUartDriver/LinuxUartDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ LinuxUartDriver ::LinuxUartDriver(const char* const compName)
m_fd(-1),
m_allocationSize(0),
m_device("NOT_EXIST"),
m_bytesSent(0),
m_bytesReceived(0),
m_quitReadThread(false) {}

bool LinuxUartDriver::open(const char* const device,
Expand Down Expand Up @@ -308,6 +310,9 @@ void LinuxUartDriver ::send_handler(const FwIndexType portNum, Fw::Buffer& serBu
Fw::LogStringArg _arg = this->m_device;
this->log_WARNING_HI_WriteError(_arg, static_cast<I32>(stat));
status = Drv::ByteStreamStatus::OTHER_ERROR;
} else {
this->m_bytesSent += static_cast<FwSizeType>(stat);
this->tlmWrite_BytesSent(this->m_bytesSent);
}
}
// Return the buffer back to the caller
Expand Down Expand Up @@ -356,9 +361,12 @@ void LinuxUartDriver ::serialReadTaskEntry(void* ptr) {
} else if (stat > 0) {
buff.setSize(static_cast<U32>(stat));
status = ByteStreamStatus::OP_OK; // added by m.chase 03.06.2017
comp->m_bytesReceived += static_cast<FwSizeType>(stat);
comp->tlmWrite_BytesRecv(comp->m_bytesReceived);
} else {
status = ByteStreamStatus::OTHER_ERROR; // Simply to return the buffer
}

comp->recv_out(0, buff, status); // added by m.chase 03.06.2017
}
}
Expand Down
4 changes: 3 additions & 1 deletion Drv/LinuxUartDriver/LinuxUartDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ class LinuxUartDriver final : public LinuxUartDriverComponentBase {

Os::Task m_readTask; //!< task instance for thread to read serial port

bool m_quitReadThread; //!< flag to quit thread
FwSizeType m_bytesSent; //!< number of bytes sent
FwSizeType m_bytesReceived; //!< number of bytes received
bool m_quitReadThread; //!< flag to quit thread
};

} // end namespace Drv
Expand Down
4 changes: 2 additions & 2 deletions Drv/LinuxUartDriver/Telemetry.fppi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@ Bytes Sent
telemetry BytesSent: U32 id 0
telemetry BytesSent: FwSizeType id 0

@ Bytes Received
telemetry BytesRecv: U32 id 1
telemetry BytesRecv: FwSizeType id 1
Loading