aboutsummaryrefslogtreecommitdiffstats
path: root/host/apps/omap_debug
diff options
context:
space:
mode:
authorPhilip Balister <philip@opensdr.com>2011-02-16 00:21:22 -0800
committerPhilip Balister <philip@opensdr.com>2011-02-16 00:22:07 -0800
commitd6897fc468db5576d11cd93f844f1892cbb89691 (patch)
tree8a454cd7a4be16e4913893ebafeaf0404cc08e86 /host/apps/omap_debug
parent3993c827f6f7e79617d301dd6df44dfffb068e60 (diff)
downloaduhd-d6897fc468db5576d11cd93f844f1892cbb89691.tar.gz
uhd-d6897fc468db5576d11cd93f844f1892cbb89691.tar.bz2
uhd-d6897fc468db5576d11cd93f844f1892cbb89691.zip
usrp-e-timed test program. Add checks for packet length and sequence
number.
Diffstat (limited to 'host/apps/omap_debug')
-rw-r--r--host/apps/omap_debug/usrp-e-crc-rw.c12
1 files changed, 12 insertions, 0 deletions
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];