Skip to content

Commit a5f269a

Browse files
committed
Rate drive sent/receive telemetry
1 parent e7840de commit a5f269a

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

Drv/LinuxUartDriver/LinuxUartDriver.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,11 @@ LinuxUartDriver ::~LinuxUartDriver() {
295295
// Handler implementations for user-defined typed input ports
296296
// ----------------------------------------------------------------------
297297

298+
void LinuxUartDriver ::run_handler(FwIndexType portNum, U32 context) {
299+
this->tlmWrite_BytesSent(this->m_bytesSent);
300+
this->tlmWrite_BytesRecv(this->m_bytesReceived);
301+
}
302+
298303
void LinuxUartDriver ::send_handler(const FwIndexType portNum, Fw::Buffer& serBuffer) {
299304
Drv::ByteStreamStatus status = Drv::ByteStreamStatus::OP_OK;
300305
if (this->m_fd == -1 || serBuffer.getData() == nullptr || serBuffer.getSize() == 0) {
@@ -312,7 +317,6 @@ void LinuxUartDriver ::send_handler(const FwIndexType portNum, Fw::Buffer& serBu
312317
status = Drv::ByteStreamStatus::OTHER_ERROR;
313318
} else {
314319
this->m_bytesSent += static_cast<FwSizeType>(stat);
315-
this->tlmWrite_BytesSent(this->m_bytesSent);
316320
}
317321
}
318322
// Return the buffer back to the caller
@@ -362,7 +366,6 @@ void LinuxUartDriver ::serialReadTaskEntry(void* ptr) {
362366
buff.setSize(static_cast<U32>(stat));
363367
status = ByteStreamStatus::OP_OK; // added by m.chase 03.06.2017
364368
comp->m_bytesReceived += static_cast<FwSizeType>(stat);
365-
comp->tlmWrite_BytesRecv(comp->m_bytesReceived);
366369
} else {
367370
status = ByteStreamStatus::OTHER_ERROR; // Simply to return the buffer
368371
}

Drv/LinuxUartDriver/LinuxUartDriver.fpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ module Drv {
1414
@ Deallocation of allocated buffers
1515
output port deallocate: Fw.BufferSend
1616

17+
@ The rate group input for sending telemetry
18+
sync input port run: Svc.Sched
19+
1720
# ----------------------------------------------------------------------
1821
# Special ports
1922
# ----------------------------------------------------------------------

Drv/LinuxUartDriver/LinuxUartDriver.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ class LinuxUartDriver final : public LinuxUartDriverComponentBase {
9595
// Handler implementations for user-defined typed input ports
9696
// ----------------------------------------------------------------------
9797

98+
//! Handler implementation for run
99+
//!
100+
//! The rate group input for sending telemetry
101+
void run_handler(FwIndexType portNum, //!< The port number
102+
U32 context //!< The call order
103+
) override;
104+
98105
//! Handler implementation for serialSend
99106
//!
100107
void send_handler(FwIndexType portNum, /*!< The port number*/

0 commit comments

Comments
 (0)