common: extend timestamp interface for byte_buffer

* allow setting timestamp to a specific std::chrono::time_point
* add getter from raw tp
master
Andre Puschmann 4 years ago
parent 81cfce6cf0
commit 2e64fff1df

@ -155,6 +155,8 @@ public:
#endif #endif
} }
std::chrono::high_resolution_clock::time_point get_timestamp() { return tp; }
void set_timestamp() void set_timestamp()
{ {
#ifdef ENABLE_TIMESTAMP #ifdef ENABLE_TIMESTAMP
@ -163,6 +165,12 @@ public:
#endif #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) void append_bytes(uint8_t* buf, uint32_t size)
{ {
memcpy(&msg[N_bytes], buf, size); memcpy(&msg[N_bytes], buf, size);

Loading…
Cancel
Save