Skip to content

Commit 4b2b607

Browse files
committed
add uptime to diagnostics for Systec
1 parent 16ae99e commit 4b2b607

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/include/CanDiagnostics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct CanDiagnostics {
4747

4848
std::optional<float>
4949
temperature; ///< Optional temperature reading for Anagate devices.
50-
std::optional<uint32_t> uptime; ///< Optional uptime for Anagate devices.
50+
std::optional<uint32_t> uptime; ///< Optional uptime in seconds.
5151

5252
std::optional<uint32_t> tcp_rx; ///< Optional TCP Received counter for
5353
///< both SocketCAN and Anagate devices.

src/main/CanVendorSystec.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#include "CanVendorSystec.h"
22

33
#include <time.h>
4-
#include <vector>
54
#include <LogIt.h>
65
#include <iomanip>
7-
#include <string>
86

97
std::mutex CanVendorSystec::m_handles_lock;
108
std::unordered_map<int, tUcanHandle> CanVendorSystec::m_handle_map;
@@ -210,8 +208,9 @@ CanDiagnostics CanVendorSystec::vendor_diagnostics() noexcept {
210208
case kUcanModeTxEcho: diagnostics.mode = "LOOPBACK"; break;
211209
}
212210

213-
// DWORD module_time;
214-
// UcanGetModuleTime(m_UcanHandle, &module_time);
211+
DWORD module_time; // in ms
212+
UcanGetModuleTime(m_UcanHandle, &module_time);
213+
diagnostics.uptime = (uint32_t) module_time / 1000;
215214

216215
return diagnostics;
217216
};

0 commit comments

Comments
 (0)