uint64_t get_time_now() {
struct timespec tn;
- clock_gettime(CLOCK_REALTIME, &tn); // this should be optionally CLOCK_MONOTONIC etc.
+ clock_gettime(CLOCK_MONOTONIC_RAW, &tn);
return timespec_to_ns(&tn);
}
if (jitter > -10000000) {
// we take any positive or a limited negative jitter as a sync event
if (jitter < 0)
- offset = clock_private_info->previous_offset + jitter / 16;
+ offset = clock_private_info->previous_offset + jitter / 32;
else if (clock_private_info->follow_up_number < (5 * 8)) // at the beginning (8 samples per second)
offset = clock_private_info->previous_offset + jitter / 2; // accept positive changes quickly
else
- offset = clock_private_info->previous_offset + jitter / 16;
+ offset = clock_private_info->previous_offset + jitter / 2;
clock_private_info->last_sync_time = reception_time;
} else {
offset = clock_private_info->previous_offset; // forget the present sample...
#define STORAGE_ID "/nqptp"
#define MAX_CLOCKS 32
-#define NQPTP_SHM_STRUCTURES_VERSION 5
+#define NQPTP_SHM_STRUCTURES_VERSION 6
#define NQPTP_CONTROL_PORT 9000
// the control port will accept a UDP packet with the first letter being: