From d6897fc468db5576d11cd93f844f1892cbb89691 Mon Sep 17 00:00:00 2001 From: Philip Balister Date: Wed, 16 Feb 2011 00:21:22 -0800 Subject: usrp-e-timed test program. Add checks for packet length and sequence number. --- host/apps/omap_debug/usrp-e-crc-rw.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'host/apps/omap_debug') diff --git a/host/apps/omap_debug/usrp-e-crc-rw.c b/host/apps/omap_debug/usrp-e-crc-rw.c index 6659b790b..2fa692429 100644 --- a/host/apps/omap_debug/usrp-e-crc-rw.c +++ b/host/apps/omap_debug/usrp-e-crc-rw.c @@ -75,9 +75,12 @@ static void *read_thread(void *threadid) unsigned int rx_crc, pkt_len, pkt_seq; unsigned long bytes_transfered; struct timeval start_time; + unsigned int prev_seq = 0; + int first = 1; __u8 *p; + printf("Greetings from the reading thread!\n"); // IMPORTANT: must assume max length packet from fpga @@ -111,6 +114,15 @@ static void *read_thread(void *threadid) // printf("Pkt len = %X, pkt seq = %X, driver len = %X\n", pkt_len, pkt_seq, cnt); + if (pkt_len != (cnt - 4)) + printf("Packet length check fail, driver len = %ud, content = %ud\n", + cnt, pkt_len); + + if (!first && (pkt_seq != (prev_seq + 1))) + printf("Sequence number check fail, pkt_seq = %ud, prev_seq = %ud\n", + pkt_seq, prev_seq); + first = 0; + for (i = 0; i < cnt-4; i++) { ck_sum += p[i]; -- cgit v1.2.3