aboutsummaryrefslogtreecommitdiffstats
path: root/src/TimestampDecoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/TimestampDecoder.h')
-rw-r--r--src/TimestampDecoder.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/TimestampDecoder.h b/src/TimestampDecoder.h
index dda8644..2793e02 100644
--- a/src/TimestampDecoder.h
+++ b/src/TimestampDecoder.h
@@ -39,7 +39,7 @@ struct frame_timestamp
int32_t fct;
uint8_t fp; // Frame Phase
- uint32_t timestamp_sec;
+ uint32_t timestamp_sec; // seconds in unix epoch
uint32_t timestamp_pps; // In units of 1/16384000 s
bool timestamp_valid = false;
bool offset_changed = false;
@@ -56,6 +56,8 @@ struct frame_timestamp
return timestamp_pps / 16384000.0;
}
+ double offset_to_system_time() const;
+
double get_real_secs() const {
double t = timestamp_sec;
t += pps_offset();
@@ -74,6 +76,8 @@ struct frame_timestamp
timestamp_pps = lrint(subsecond * 16384000.0);
}
+ std::string to_string() const;
+
void print(const char* t) const {
etiLog.log(debug,
"%s <frame_timestamp(%s, %d, %.9f, %d)>\n",
@@ -93,7 +97,7 @@ class TimestampDecoder : public RemoteControllable
*/
TimestampDecoder(double& offset_s);
- std::shared_ptr<frame_timestamp> getTimestamp(void);
+ frame_timestamp getTimestamp(void);
/* Update timestamp data from ETI */
void updateTimestampEti(