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

Remove sanity checks in server to avoid tests stopping

parent f8c4c3dc
......@@ -125,14 +125,6 @@ static void *emit_signal_thread(void *p) {
pthread_cond_wait(&emit_signal_ts_received, &emit_signal_mutex);
clock_gettime(CLOCK_REALTIME, &current);
// Sanity check
if(current.tv_sec > emit_signal_next.tv_sec)
goto invalid_ts;
if(current.tv_sec == emit_signal_next.tv_sec && current.tv_nsec > emit_signal_next.tv_nsec)
goto invalid_ts;
if(current.tv_sec + 15 < emit_signal_next.tv_sec)
goto invalid_ts;
clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &emit_signal_next, NULL);
toggle_gpio();
......@@ -140,12 +132,6 @@ static void *emit_signal_thread(void *p) {
pthread_mutex_unlock(&emit_signal_mutex);
pthread_exit(NULL);
invalid_ts:
fprintf(stderr, "Invalid timestamp : %" PRIu64 "\n", ts_to_uint(emit_signal_next));
fprintf(stderr, "Current time is : %" PRIu64 "\n", ts_to_uint(current));
fprintf(stderr, "Difference with timestamp : %" PRIi64 "\n\n\n", ((int64_t)ts_to_uint(emit_signal_next)) - ((int64_t)ts_to_uint(current)));
exit(EXIT_FAILURE);
}
/* Real-time thread:
......@@ -205,14 +191,6 @@ static void *tsn_thread(void *p) {
emit_signal_next = uint_to_ts(emit_signal_t);
pthread_cond_signal(&emit_signal_ts_received);
pthread_mutex_unlock(&emit_signal_mutex);
// Sanity check
if(current.tv_sec > emit_signal_next.tv_sec)
goto invalid_ts;
if(current.tv_sec == emit_signal_next.tv_sec && current.tv_nsec > emit_signal_next.tv_nsec)
goto invalid_ts;
if(current.tv_sec + 15 < emit_signal_next.tv_sec)
goto invalid_ts;
}
// Update stats
......@@ -257,12 +235,6 @@ static void *tsn_thread(void *p) {
}
return NULL;
invalid_ts:
fprintf(stderr, "Invalid timestamp at reception : %" PRIu64 "\n", ts_to_uint(emit_signal_next));
fprintf(stderr, "Current time is : %" PRIu64 "\n", ts_to_uint(current));
fprintf(stderr, "Difference with timestamp : %" PRIi64 "\n\n\n", ((int64_t)ts_to_uint(emit_signal_next)) - ((int64_t)ts_to_uint(current)));
exit(EXIT_FAILURE);
}
static void create_thread(void *(*thread_function)(void *)) {
......
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