Commit b863db00 authored by Joanne Hugé's avatar Joanne Hugé

WIP: use txtime generated in client.c for etf

parent 7a514843
...@@ -122,7 +122,7 @@ static void *packet_sending_thread(void *p) { ...@@ -122,7 +122,7 @@ static void *packet_sending_thread(void *p) {
clock_gettime(CLOCK_MONOTONIC, &next); clock_gettime(CLOCK_MONOTONIC, &next);
next_txtime = next.tv_sec * NSEC_PER_SEC + next.tv_nsec; next_txtime = next.tv_sec * NSEC_PER_SEC + next.tv_nsec;
// Wait around 1 second // Wait around 1 second
next_txtime += (10 * NSEC_PER_SEC / param->interval) * param->interval; next_txtime += (1 * NSEC_PER_SEC / param->interval) * param->interval;
// Send packet while thread is sleeping // Send packet while thread is sleeping
next_txtime += (param->interval) / 2; next_txtime += (param->interval) / 2;
...@@ -136,7 +136,7 @@ static void *packet_sending_thread(void *p) { ...@@ -136,7 +136,7 @@ static void *packet_sending_thread(void *p) {
do_tsn_task(param, next_txtime); do_tsn_task(param, next_txtime);
add_ns(&next, param->interval); add_ns(&next, param->interval);
next_txtime += (param->interval) / 2; next_txtime += (param->interval);
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &next, NULL); clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &next, NULL);
} }
......
...@@ -191,7 +191,7 @@ packet_timestamps_t send_udp_packet(int use_etf, int use_timestamps, ...@@ -191,7 +191,7 @@ packet_timestamps_t send_udp_packet(int use_etf, int use_timestamps,
cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_TXTIME; cmsg->cmsg_type = SCM_TXTIME;
cmsg->cmsg_len = CMSG_LEN(sizeof(uint64_t)); cmsg->cmsg_len = CMSG_LEN(sizeof(uint64_t));
*((uint64_t *)CMSG_DATA(cmsg)) = get_txtime(); *((uint64_t *)CMSG_DATA(cmsg)) = txtime;
msg.msg_controllen = cmsg->cmsg_len; msg.msg_controllen = cmsg->cmsg_len;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment