commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r5488 - gnuradio/branches/developers/gnychis/inband/us


From: gnychis
Subject: [Commit-gnuradio] r5488 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband
Date: Thu, 17 May 2007 18:55:44 -0600 (MDT)

Author: gnychis
Date: 2007-05-17 18:55:43 -0600 (Thu, 17 May 2007)
New Revision: 5488

Modified:
   gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/Makefile.am
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.h
Log:
trying to implement communication with the USRP, having trouble linking to the 
original USRP basic library


Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/Makefile.am    
    2007-05-17 17:56:18 UTC (rev 5487)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/Makefile.am    
    2007-05-18 00:55:43 UTC (rev 5488)
@@ -29,9 +29,10 @@
 EXTRA_DIST =                           \
        usrp_server.mbh                 
 
+
 lib_LTLIBRARIES =                      \
-       libusrp_inband.la               \
-       libusrp_inband-qa.la                    
+       libusrp_inband.la                       \
+       libusrp_inband-qa.la
 
 
 # ------------------------------------------------------------------------
@@ -51,6 +52,7 @@
 
 libusrp_inband_la_LIBADD =             \
        $(MBLOCK_LA)                    \
+       $(USRP_LA)                              \
        -lstdc++
 
 

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc 
    2007-05-17 17:56:18 UTC (rev 5487)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc 
    2007-05-18 00:55:43 UTC (rev 5488)
@@ -24,10 +24,12 @@
 #endif
 #include <usrp_server.h>
 #include <iostream>
+#include <usb.h>
 #include <usrp_inband_usb_packet.h>
 #include <mb_class_registry.h>
 #include <vector>
 #include <fake_usrp.h>
+#include "usrp_standard.h"
 
 typedef usrp_inband_usb_packet transport_pkt;   // makes conversion to gigabit 
easy
 
@@ -95,13 +97,16 @@
   d_nrx_chan = 2;
 
   // Initialize capacity on each channel to 0 and to no owner
+  // Also initialize the USRP standard tx/rx pointers to NULL
   for(int chan=0; chan < d_ntx_chan; chan++) {
     d_chaninfo_tx[chan].assigned_capacity = 0;
     d_chaninfo_tx[chan].owner = PMT_NIL;
+    d_utx.push_back(NULL);
   }
   for(int chan=0; chan < d_nrx_chan; chan++) {
     d_chaninfo_rx[chan].assigned_capacity = 0;
     d_chaninfo_rx[chan].owner = PMT_NIL;
+    d_urx.push_back(NULL);
   }
 }
 
@@ -141,16 +146,45 @@
       // extract args from data
       invocation_handle = pmt_nth(0, data);
       long which_usrp = pmt_to_long(pmt_nth(1, data)); // integer usrp id, 
usually 0
+
+      // Open up a standard RX and TX for communication with the USRP
+      // 
+      // I'm not sure if i should be opening up all RX and TX channels,  but 
given that
+      // one is not specified in the signal, I am assuming so.
+      for(int chan=0; chan < d_ntx_chan; chan++) {
+        d_utx[chan] = usrp_standard_tx::make (which_usrp,
+          16,               // interp = 32.0MB/s
+          chan,                
+          -1,               // mux
+          USB_PKT_SIZE,     // USB block size should be our USB packet size?
+          1);               // number of blocks in a burst, I need to search 
for this exact number
+
+        if(!d_utx[chan]) {
+          std::cout << "[usrp_server] Failed to open channel " << chan << "\n";
+          reply_data = pmt_list2(invocation_handle, PMT_F);
+          d_cs->send(s_response_open, reply_data);
+          return;
+        }
+
+        if(!d_utx[chan]->set_tx_freq (0,0)) {  // try setting center freq to 0
+          std::cout << "[usrp_server] Failed to set center frequency on 
channel " << chan << "\n";
+          reply_data = pmt_list2(invocation_handle, PMT_F);
+          d_cs->send(s_response_open, reply_data);
+          return;
+        }
+
+        d_utx[chan]->start();  // not sure if this is the appropriate place to 
start yet
+      }
+      for(int chan=0; chan < d_nrx_chan; chan++) {
+
+      }
       
       // Do the right thing....
       // build a reply
 
-      // if everything OK
-      status = PMT_T;
-      reply_data = pmt_list2(invocation_handle, status);
+      reply_data = pmt_list2(invocation_handle, PMT_T);
+      d_cs->send(s_response_open, reply_data);
 
-      //  ...and send it
-      d_cs->send(s_response_open, reply_data);
       return;
     }
     else if (pmt_eq(event, s_cmd_close)){

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.h
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.h  
    2007-05-17 17:56:18 UTC (rev 5487)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.h  
    2007-05-18 00:55:43 UTC (rev 5488)
@@ -23,6 +23,7 @@
 
 #include <mb_mblock.h>
 #include <vector>
+#include "usrp_standard.h"
 
 /*!
  * \brief Implements the lowest-level mblock interface to the USRP
@@ -31,6 +32,9 @@
 {
 public:
 
+  std::vector<usrp_standard_tx*> d_utx;
+  std::vector<usrp_standard_rx*> d_urx;
+
   enum error_codes {
     RQSTD_CAPACITY_UNAVAIL = 0,
     CHANNEL_UNAVAIL = 1,





reply via email to

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