aboutsummaryrefslogtreecommitdiffstats
path: root/src/TimestampDecoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/TimestampDecoder.cpp')
-rw-r--r--src/TimestampDecoder.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/TimestampDecoder.cpp b/src/TimestampDecoder.cpp
index e68bb4b..ba1a221 100644
--- a/src/TimestampDecoder.cpp
+++ b/src/TimestampDecoder.cpp
@@ -221,6 +221,9 @@ void TimestampDecoder::set_parameter(
ss >> timestamp_offset;
offset_changed = true;
}
+ else if (parameter == "timestamp") {
+ throw ParameterError("timestamp is read-only");
+ }
else {
stringstream ss;
ss << "Parameter '" << parameter
@@ -238,6 +241,16 @@ const std::string TimestampDecoder::get_parameter(
if (parameter == "offset") {
ss << timestamp_offset;
}
+ else if (parameter == "timestamp") {
+ if (full_timestamp_received) {
+ ss.setf(std::ios_base::fixed, std::ios_base::floatfield);
+ ss << time_secs + ((double)time_pps / 16384000.0) <<
+ " for frame FCT " << latestFCT;
+ }
+ else {
+ throw ParameterError("Not available yet");
+ }
+ }
else {
ss << "Parameter '" << parameter <<
"' is not exported by controllable " << get_rc_name();