FreeCalypso > hg > themwi-system-sw
diff mtctest/main.c @ 159:c8e9b295e88f
mtctest: add time reporting for DTMF events
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 12 Oct 2022 12:11:06 -0800 |
parents | a065b4a62a8a |
children |
line wrap: on
line diff
--- a/mtctest/main.c Wed Oct 12 08:45:39 2022 -0800 +++ b/mtctest/main.c Wed Oct 12 12:11:06 2022 -0800 @@ -3,6 +3,7 @@ */ #include <sys/types.h> +#include <sys/time.h> #include <sys/errno.h> #include <stdio.h> #include <stdint.h> @@ -13,6 +14,8 @@ extern int mtc_socket; extern int disconnect_mode; +struct timeval cur_event_time; + static void drain_stdin() { @@ -64,6 +67,7 @@ perror("select"); exit(1); } + gettimeofday(&cur_event_time, 0); if (FD_ISSET(mtc_socket, &fds)) mtc_socket_select(); if (!disconnect_mode && FD_ISSET(0, &fds)) {