39#define LF_CLOCK_SYNC_OFF 1
40#define LF_CLOCK_SYNC_INIT 2
41#define LF_CLOCK_SYNC_ON 3
44#define LF_CLOCK_SYNC LF_CLOCK_SYNC_INIT
52#ifndef _LF_CLOCK_SYNC_EXCHANGES_PER_INTERVAL
53#define _LF_CLOCK_SYNC_EXCHANGES_PER_INTERVAL 10
57#ifndef _LF_CLOCK_SYNC_ATTENUATION
58#define _LF_CLOCK_SYNC_ATTENUATION 10
62#ifndef _LF_CLOCK_SYNC_COLLECT_STATS
63#define _LF_CLOCK_SYNC_COLLECT_STATS true
72#define CLOCK_SYNC_GUARD_BAND USEC(100)
112#ifdef _LF_CLOCK_SYNC_COLLECT_STATS
128 long long clock_synchronization_error);
struct lf_stat_ll calculate_socket_stat(struct socket_stat_t *socket_stat)
void handle_T4_clock_sync_message(unsigned char *buffer, int socket, instant_t r4)
void synchronize_initial_physical_clock_with_rti(int *rti_socket_TCP)
void clock_sync_set_constant_bias(interval_t offset)
void update_socket_stat(struct socket_stat_t *socket_stat, long long network_delay, long long clock_synchronization_error)
void clock_sync_add_offset(instant_t *t)
Add the current clock synchronization offset to a specified timestamp.
Definition clock.c:16
void * listen_to_rti_UDP_thread(void *args)
struct socket_stat_t socket_stat_t
uint16_t setup_clock_synchronization_with_rti(void)
#define _LF_CLOCK_SYNC_EXCHANGES_PER_INTERVAL
Definition clock-sync.h:53
int create_clock_sync_thread(lf_thread_t *thread_id)
int handle_T1_clock_sync_message(unsigned char *buffer, int socket, instant_t t2)
void reset_socket_stat(struct socket_stat_t *socket_stat)
void clock_sync_subtract_offset(instant_t *t)
Subtract the clock synchronization offset from a timestamp.
Definition clock.c:17
void * lf_thread_t
Definition lf_arduino_support.h:120
Definition clock-sync.h:83
interval_t network_stat_round_trip_delay_max
Definition clock-sync.h:99
interval_t network_stat_samples[_LF_CLOCK_SYNC_EXCHANGES_PER_INTERVAL]
Definition clock-sync.h:108
instant_t remote_physical_clock_snapshot_T1
Definition clock-sync.h:84
int network_stat_sample_index
Definition clock-sync.h:101
interval_t local_delay
Definition clock-sync.h:88
interval_t clock_synchronization_error_bound
Definition clock-sync.h:103
interval_t history
Definition clock-sync.h:92
int received_T4_messages_in_current_sync_window
Definition clock-sync.h:90
instant_t local_physical_clock_snapshot_T2
Definition clock-sync.h:86
int64_t instant_t
Definition tag.h:63
int64_t interval_t
Definition tag.h:68
char buffer[BUFFER_SIZE]
Definition trace_util.c:42