commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: eb
Subject: [Commit-gnuradio] r7350 - usrp2/trunk/host/apps
Date: Fri, 4 Jan 2008 21:07:26 -0700 (MST)

Author: eb
Date: 2008-01-04 21:07:26 -0700 (Fri, 04 Jan 2008)
New Revision: 7350

Modified:
   usrp2/trunk/host/apps/find_usrps.cc
   usrp2/trunk/host/apps/rx_samples.cc
   usrp2/trunk/host/apps/tx_samples.cc
Log:
usrp2 host work-in-progress

Modified: usrp2/trunk/host/apps/find_usrps.cc
===================================================================
--- usrp2/trunk/host/apps/find_usrps.cc 2008-01-05 04:02:19 UTC (rev 7349)
+++ usrp2/trunk/host/apps/find_usrps.cc 2008-01-05 04:07:26 UTC (rev 7350)
@@ -21,12 +21,39 @@
 #endif
 #include "usrp2_basic.h"
 #include <iostream>
+#include <getopt.h>
 
+static void
+usage(const char *progname)
+{
+  fprintf(stderr, "usage: %s [-e ethN]\n",
+         progname);
+}
 
 int
 main(int argc, char **argv)
 {
+  int ch;
   const char *interface = "eth0";
+
+  while ((ch = getopt(argc, argv, "he:")) != EOF){
+    switch (ch){
+    case 'e':
+      interface = optarg;
+      break;
+      
+    case 'h':
+    default:
+      usage(argv[0]);
+      exit(1);
+    }
+  }
+
+  if (argc - optind != 0){
+    usage(argv[0]);
+    exit(1);
+  }
+  
   usrp2_basic *u2 = new usrp2_basic();
 
   if (!u2->open(interface)){

Modified: usrp2/trunk/host/apps/rx_samples.cc
===================================================================
--- usrp2/trunk/host/apps/rx_samples.cc 2008-01-05 04:02:19 UTC (rev 7349)
+++ usrp2/trunk/host/apps/rx_samples.cc 2008-01-05 04:07:26 UTC (rev 7350)
@@ -80,6 +80,11 @@
     }
   }
   
+  if (argc - optind != 0){
+    usage(argv[0]);
+    exit(1);
+  }
+
   FILE *of = fopen(output_filename, "wb");
 
   usrp2_basic *u2 = new usrp2_basic();

Modified: usrp2/trunk/host/apps/tx_samples.cc
===================================================================
--- usrp2/trunk/host/apps/tx_samples.cc 2008-01-05 04:02:19 UTC (rev 7349)
+++ usrp2/trunk/host/apps/tx_samples.cc 2008-01-05 04:07:26 UTC (rev 7350)
@@ -67,6 +67,11 @@
     }
   }
   
+  if (argc - optind != 0){
+    usage(argv[0]);
+    exit(1);
+  }
+  
   FILE *fp = 0;
   if (input_filename == 0)
     fp = stdin;





reply via email to

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