From 1cf4bf789aeb6257f6423eab021da04873796ecf Mon Sep 17 00:00:00 2001 From: Stefan Mertl Date: Thu, 1 Feb 2018 12:58:29 +0100 Subject: [PATCH] Set the systemtime also when the first correct timestamp was detected. --- software/c++/ruwaicom/src/recorder.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/software/c++/ruwaicom/src/recorder.cpp b/software/c++/ruwaicom/src/recorder.cpp index ee70d77..b318c65 100644 --- a/software/c++/ruwaicom/src/recorder.cpp +++ b/software/c++/ruwaicom/src/recorder.cpp @@ -80,6 +80,7 @@ Recorder::Recorder(std::string serial_number, unsigned int total_channels, std:: state_first_timestamp_received = false; state_gps_fix_init = false; + state_system_time_set = false; //state_gps_fix = FIX_NO; //state_gps_fix_ok = false; sec_slts_cnt = 0; @@ -266,6 +267,10 @@ Recorder::handle_timestamp_sample(rw_smp_24bit_tsp_t paket) { char time_string_1[27]; syslog(LOG_INFO, "[add_timestamp_sample] Correct timestamp difference of %lld us detected. current: %s, last: %s", (long long int)ts_diff, ms_hptime2isotimestr(cur_timestamp.time, time_string, true), ms_hptime2isotimestr(last_timestamp.time, time_string_1, true)); + if (!state_system_time_set) + { + set_system_time = true; + } } } @@ -283,6 +288,7 @@ Recorder::handle_timestamp_sample(rw_smp_24bit_tsp_t paket) else { syslog(LOG_NOTICE, "[add_timestamp_sample] Successfully set the system time."); + state_system_time_set = true; } } -- 2.11.4.GIT