commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r5093 - in gnuradio/branches/developers/gnychis/inband


From: gnychis
Subject: [Commit-gnuradio] r5093 - in gnuradio/branches/developers/gnychis/inband/usrp/host/lib: . inband legacy
Date: Mon, 23 Apr 2007 18:31:28 -0600 (MDT)

Author: gnychis
Date: 2007-04-23 18:31:27 -0600 (Mon, 23 Apr 2007)
New Revision: 5093

Modified:
   gnuradio/branches/developers/gnychis/inband/usrp/host/lib/Makefile.am
   gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/Makefile.am
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.h
   gnuradio/branches/developers/gnychis/inband/usrp/host/lib/legacy/Makefile.am
Log:
Merged eb/geo -r5087:5091 into gynchis/inband. Refactored usrp library 
construction.

Modified: gnuradio/branches/developers/gnychis/inband/usrp/host/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/gnychis/inband/usrp/host/lib/Makefile.am       
2007-04-23 23:10:38 UTC (rev 5092)
+++ gnuradio/branches/developers/gnychis/inband/usrp/host/lib/Makefile.am       
2007-04-24 00:31:27 UTC (rev 5093)
@@ -20,27 +20,5 @@
 
 include $(top_srcdir)/Makefile.common
 
-SUBDIRS = legacy inband . 
+SUBDIRS = legacy inband
 
-INCLUDES = $(USRP_INCLUDES)
-
-EXTRA_DIST =                           
-BUILT_SOURCES =                        
-
-# generate libusrp.la from the convenience libraries in subdirs
-
-lib_LTLIBRARIES = libusrp.la
-
-libusrp_la_SOURCES =                   
-
-libusrp_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0
-
-libusrp_la_LIBADD =                    \
-       $(USB_LIBS)                     \
-       ../misc/libmisc.la              \
-       legacy/liblegacy.la             \
-       inband/libinband.la             
-
-MOSTLYCLEANFILES = \
-       $(BUILT_SOURCES) *~ *.pyc
-

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/Makefile.am    
    2007-04-23 23:10:38 UTC (rev 5092)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/Makefile.am    
    2007-04-24 00:31:27 UTC (rev 5093)
@@ -28,9 +28,14 @@
 
 EXTRA_DIST =                           
 
-noinst_LTLIBRARIES = libinband.la libinband-qa.la
+lib_LTLIBRARIES =                      \
+       libusrp_inband.la               \
+       libusrp_inband-qa.la                    
 
 
+# ------------------------------------------------------------------------
+# Build the inband library
+
 BUILT_SOURCES =                                \
        usrp_server_mbh.cc
 
@@ -38,45 +43,49 @@
        $(COMPILE_MBH) usrp_server.mbh usrp_server_mbh.cc
 
 
-libinband_la_SOURCES =                 \
+libusrp_inband_la_SOURCES =            \
        $(BUILT_SOURCES)                \
        usrp_server.cc
 
-libinband_la_LIBADD =                  \
+libusrp_inband_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0
+
+libusrp_inband_la_LIBADD =             \
        $(MBLOCK_LA)                    \
-       $(PMT_LA)                                       \
        -lstdc++
 
 
 include_HEADERS =                      \
        usrp_server.h                   
 
-noinst_HEADERS =      \
-       qa_inband.h                                     \
+noinst_HEADERS =                       \
+       qa_inband.h                     \
        qa_inband_packet_prims.h        \
        qa_inband_usrp_server.h
 
+# ------------------------------------------------------------------------
 # Build the qa code in its own library
 
-libinband_qa_la_SOURCES =   \
-       qa_inband.cc                                                    \
+libusrp_inband_qa_la_SOURCES =         \
+       qa_inband.cc                    \
        qa_inband_packet_prims.cc       \
        qa_inband_usrp_server.cc
 
 # magic flags
-libinband_qa_la_LDFLAGS = $(NO_UNDEFINED) -avoid-version
+libusrp_inband_qa_la_LDFLAGS = $(NO_UNDEFINED) -avoid-version
 
 # link against c++ standard library
-libinband_qa_la_LIBADD =    \
-       libinband.la            \
-       $(CPPUNIT_LIBS) \
+libusrp_inband_qa_la_LIBADD =          \
+       libusrp_inband.la               \
+       $(CPPUNIT_LIBS)                 \
        -lstdc++
 
+# ------------------------------------------------------------------------
+
 noinst_PROGRAMS =                      \
        test_inband
 
 test_inband_SOURCES = test_inband.cc
-test_inband_LDADD       = libinband-qa.la
+test_inband_LDADD   = libusrp_inband-qa.la
 
 
 MOSTLYCLEANFILES = \

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
   2007-04-23 23:10:38 UTC (rev 5092)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
   2007-04-24 00:31:27 UTC (rev 5093)
@@ -32,7 +32,6 @@
 #include <mb_protocol_class.h>
 #include <mb_class_registry.h>
 
-
 void 
 qa_inband_usrp_server::test_chan_allocation()
 {

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-04-23 23:10:38 UTC (rev 5092)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc 
    2007-04-24 00:31:27 UTC (rev 5093)
@@ -54,6 +54,14 @@
 static pmt_t s_response_xmit_raw_frame = pmt_intern("response-xmit-raw-frame");
 
 
+static std::string
+str(long x)
+{
+  std::ostringstream s;
+  s << x;
+  return s.str();
+}
+
 usrp_server::usrp_server(mb_runtime *rt, const std::string &instance_name, 
pmt_t user_arg)
   : mb_mblock(rt, instance_name, user_arg)
 {
@@ -67,8 +75,8 @@
   // (if/when we do replicated ports, these will be replaced by a
   //  single replicated port)
   for(int port=0; port < N_PORTS; port++) {
-    d_tx.push_back(define_port("rx"+port, "usrp-tx", true, mb_port::EXTERNAL));
-    d_rx.push_back(define_port("tx"+port, "usrp-rx", true, mb_port::EXTERNAL));
+    d_tx.push_back(define_port("rx"+str(port), "usrp-tx", true, 
mb_port::EXTERNAL));
+    d_rx.push_back(define_port("tx"+str(port), "usrp-rx", true, 
mb_port::EXTERNAL));
   }
 
   // FIXME ... initializing to 2 channels on each for now, eventually we should
@@ -161,11 +169,11 @@
 }
 
 // Return -1 if it is not an RX port, or an index
-long usrp_server::tx_port_index(pmt_t port_id) {
+int usrp_server::tx_port_index(pmt_t port_id) {
 
   std::vector<mb_port_sptr>::iterator tx;
 
-  for(int i=0; i < d_tx.size(); i++) 
+  for(int i=0; i < (int) d_tx.size(); i++) 
     if(pmt_eq(tx[i]->port_symbol(), port_id))
       return i;
 
@@ -173,11 +181,11 @@
 }
 
 // Return -1 if it is not an RX port, or an index
-long usrp_server::rx_port_index(pmt_t port_id) {
+int usrp_server::rx_port_index(pmt_t port_id) {
   
   std::vector<mb_port_sptr>::iterator rx;
 
-  for(int i=0; i < d_rx.size(); i++) 
+  for(int i=0; i < (int) d_rx.size(); i++) 
     if(pmt_eq(rx[i]->port_symbol(), port_id))
       return i;
 
@@ -328,13 +336,15 @@
 
   // Determine the number of packets to allocate contiguous memory for 
bursting over the
   // USB and get a pointer to the memory to be used in building the packets
-  long n_packets = std::ceil(n_bytes / (double)max_payload_len);
+  long n_packets = static_cast<long>(std::ceil(n_bytes / 
(double)max_payload_len));
   pmt_t v_packets = pmt_make_u8vector(sizeof(transport_pkt) * n_packets, 0);
-  transport_pkt *pkts = (transport_pkt *) 
pmt_u8vector_writeable_elements(v_packets, psize);
 
+  transport_pkt *pkts =
+    (transport_pkt *) pmt_u8vector_writeable_elements(v_packets, psize);
+
   for(int n=0; n < n_packets; n++) {
 
-    long payload_len = std::min((int)(n_bytes-(n*max_payload_len)), 
(int)max_payload_len);
+    long payload_len = std::min((long)(n_bytes-(n*max_payload_len)), 
(long)max_payload_len);
   
     if(n == 0) { // first packet gets start of burst flag and timestamp
       pkts[n].set_header(pkts[n].FL_START_OF_BURST, channel, 0, payload_len);

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-04-23 23:10:38 UTC (rev 5092)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.h  
    2007-04-24 00:31:27 UTC (rev 5093)
@@ -64,8 +64,8 @@
   void handle_cmd_allocate_channel(pmt_t port_id, pmt_t data);
   void handle_cmd_deallocate_channel(pmt_t port_id, pmt_t data);
   void handle_cmd_xmit_raw_frame(pmt_t data);
-  long rx_port_index(pmt_t port_id);
-  long tx_port_index(pmt_t port_id);
+  int rx_port_index(pmt_t port_id);
+  int tx_port_index(pmt_t port_id);
   long current_capacity_allocation();
 };
 

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/legacy/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/legacy/Makefile.am    
    2007-04-23 23:10:38 UTC (rev 5092)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/legacy/Makefile.am    
    2007-04-24 00:31:27 UTC (rev 5093)
@@ -22,9 +22,14 @@
 
 INCLUDES = $(USRP_INCLUDES)
 
-noinst_LTLIBRARIES = liblegacy.la
+lib_LTLIBRARIES = libusrp.la
 
+libusrp_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0
 
+libusrp_la_LIBADD =                    \
+       $(USB_LIBS)                     \
+       ../../misc/libmisc.la           
+
 EXTRA_DIST =                           \
        std_paths.h.in                  \
        usrp_dbid.dat                   
@@ -72,7 +77,7 @@
 #
 # include each <foo>_CODE entry here...
 #
-EXTRA_liblegacy_la_SOURCES =           \
+EXTRA_libusrp_la_SOURCES =             \
        $(generic_CODE)                 \
        $(darwin_CODE)                  \
        $(win32_CODE)                   \
@@ -81,7 +86,7 @@
 
 
 # work around automake deficiency
-liblegacy_la_common_SOURCES =          \
+libusrp_la_common_SOURCES =            \
        fusb.cc                         \
        md5.c                           \
        usrp_basic.cc                   \
@@ -93,23 +98,23 @@
 
 
 if FUSB_TECH_generic
-liblegacy_la_SOURCES = $(liblegacy_la_common_SOURCES) $(generic_CODE)
+libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(generic_CODE)
 endif
 
 if FUSB_TECH_darwin
-liblegacy_la_SOURCES = $(liblegacy_la_common_SOURCES) $(darwin_CODE)
+libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(darwin_CODE)
 endif
 
 if FUSB_TECH_win32
-liblegacy_la_SOURCES = $(liblegacy_la_common_SOURCES) $(win32_CODE)
+libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(win32_CODE)
 endif
 
 if FUSB_TECH_linux
-liblegacy_la_SOURCES = $(liblegacy_la_common_SOURCES) $(linux_CODE)
+libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(linux_CODE)
 endif
 
 if FUSB_TECH_ra_wb
-liblegacy_la_SOURCES = $(liblegacy_la_common_SOURCES) $(ra_wb_CODE)
+libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(ra_wb_CODE)
 endif
 
 include_HEADERS =                      \





reply via email to

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