commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r7413 - usrp2/trunk/host/apps


From: eb
Subject: [Commit-gnuradio] r7413 - usrp2/trunk/host/apps
Date: Sat, 12 Jan 2008 21:21:06 -0700 (MST)

Author: eb
Date: 2008-01-12 21:21:02 -0700 (Sat, 12 Jan 2008)
New Revision: 7413

Modified:
   usrp2/trunk/host/apps/rx_samples.cc
Log:
now report expected values

Modified: usrp2/trunk/host/apps/rx_samples.cc
===================================================================
--- usrp2/trunk/host/apps/rx_samples.cc 2008-01-13 04:03:04 UTC (rev 7412)
+++ usrp2/trunk/host/apps/rx_samples.cc 2008-01-13 04:21:02 UTC (rev 7413)
@@ -256,9 +256,24 @@
     return 1;
   }
 
+  long expected_rx_packets = (nsamples + samples_per_frame - 
1)/samples_per_frame;
+  long expected_rx_bytes   = (expected_rx_packets * 24) + nsamples * 4;
+  long long delta;
+  
   printf("\nInterface statistics:\n");
-  printf("  rx_bytes:    %8Ld\n",   stop.rx_bytes - start.rx_bytes);
-  printf("  rx_packets:  %8Ld\n",   stop.rx_packets - start.rx_packets);
+
+  delta = stop.rx_bytes - start.rx_bytes;
+  printf("  rx_bytes:    %8Ld",     delta);
+  printf("   expected  %8ld  %s\n",
+        expected_rx_bytes,
+        expected_rx_bytes - delta == 0 ? "OK" : "NOT OK");
+
+  delta = stop.rx_packets - start.rx_packets;
+  printf("  rx_packets:  %8Ld",     delta);
+  printf("   expected  %8ld  %s\n",
+        expected_rx_packets,
+        expected_rx_packets - delta == 0 ? "OK" : "NOT OK");
+
   printf("  rx_errs:     %8Ld\n",   stop.rx_errs - start.rx_errs);
   printf("  rx_drop:     %8Ld\n",   stop.rx_drop - start.rx_drop);
   printf("  tx_bytes:    %8Ld\n",   stop.tx_bytes - start.tx_bytes);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]