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
}
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);

Loading…
Cancel
Save