From 2e64fff1df08c4d7973b4e7de850630b2844f680 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 16 Dec 2020 22:01:28 +0100 Subject: [PATCH] common: extend timestamp interface for byte_buffer * allow setting timestamp to a specific std::chrono::time_point * add getter from raw tp --- lib/include/srslte/common/common.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/include/srslte/common/common.h b/lib/include/srslte/common/common.h index cc1dabfa6..48d85cd63 100644 --- a/lib/include/srslte/common/common.h +++ b/lib/include/srslte/common/common.h @@ -155,6 +155,8 @@ public: #endif } + std::chrono::high_resolution_clock::time_point get_timestamp() { return tp; } + void set_timestamp() { #ifdef ENABLE_TIMESTAMP @@ -163,6 +165,12 @@ public: #endif } + void set_timestamp(std::chrono::high_resolution_clock::time_point tp_) + { + tp = tp_; + timestamp_is_set = true; + } + void append_bytes(uint8_t* buf, uint32_t size) { memcpy(&msg[N_bytes], buf, size);