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

Clean up code

parent 4ca02206
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
#include "send_packet.h" #include "send_packet.h"
#include "utilities.h" #include "utilities.h"
#define MESSAGE ((uint32_t)0x00FACADE)
static void process_timestamps(packet_info_t *packet_info, int64_t histograms[NB_HISTOGRAMS][MAX_HIST_VAL]); static void process_timestamps(packet_info_t *packet_info, int64_t histograms[NB_HISTOGRAMS][MAX_HIST_VAL]);
static void init_tx_buffer(size_t _tx_buffer_len); static void init_tx_buffer(size_t _tx_buffer_len);
...@@ -126,17 +124,6 @@ void init_udp_send(int use_etf, int use_timestamps, int packet_priority, ...@@ -126,17 +124,6 @@ void init_udp_send(int use_etf, int use_timestamps, int packet_priority,
} }
} }
uint64_t get_txtime() {
struct timespec txtime_ts;
uint64_t txtime;
clock_gettime(CLOCK_TAI, &txtime_ts);
txtime = txtime_ts.tv_sec * NSEC_PER_SEC + txtime_ts.tv_nsec;
txtime += NSEC_PER_SEC;
return txtime;
}
/* /*
* Sends udp packets * Sends udp packets
*/ */
...@@ -145,6 +132,7 @@ packet_info_t send_udp_packet(int use_etf, int use_timestamps, ...@@ -145,6 +132,7 @@ packet_info_t send_udp_packet(int use_etf, int use_timestamps,
uint64_t txtime, uint64_t txtime,
const char *server_ip, const char *server_ip,
int64_t histograms[NB_HISTOGRAMS][MAX_HIST_VAL]) { int64_t histograms[NB_HISTOGRAMS][MAX_HIST_VAL]) {
struct msghdr msg; // Message hardware, sent to the socket struct msghdr msg; // Message hardware, sent to the socket
struct cmsghdr *cmsg; // Control message hardware, for txtime struct cmsghdr *cmsg; // Control message hardware, for txtime
char control[CMSG_SPACE(sizeof(txtime))] = {}; // Stores txtime char control[CMSG_SPACE(sizeof(txtime))] = {}; // Stores txtime
......
...@@ -217,9 +217,10 @@ int main(int argc, char *argv[]) { ...@@ -217,9 +217,10 @@ int main(int argc, char *argv[]) {
if(tsn_task == RECV_PACKET_TASK) { if(tsn_task == RECV_PACKET_TASK) {
diff = ((int64_t)stats->max_interval) - stats->min_interval; diff = ((int64_t)stats->max_interval) - stats->min_interval;
printf( "(%d) Jitter : %" PRIi64 " [Packet data: %s]\n", printf( "(%d) Jitter : %" PRIi64 " [Packet data: %s (%x)]\n",
stats->packets_received, stats->packets_received,
diff, diff,
stats->packet_info.data,
stats->packet_info.data); stats->packet_info.data);
if(enable_timestamps) { if(enable_timestamps) {
......
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