commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 87/148: Removed references to channel numbe


From: git
Subject: [Commit-gnuradio] [gnuradio] 87/148: Removed references to channel numbers in usrp2 and gr usrp2. Removed the sample handler and replaced it with the vrt packet handler. Fixed the build systems to require vrt for usrp.
Date: Mon, 15 Aug 2016 00:47:27 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

nwest pushed a commit to annotated tag old_usrp_devel_udp
in repository gnuradio.

commit 58ddfc86754326635f092ac2699c523ab36076f0
Author: Josh Blum <address@hidden>
Date:   Wed Dec 16 15:03:50 2009 -0800

    Removed references to channel numbers in usrp2 and gr usrp2.
    Removed the sample handler and replaced it with the vrt packet handler.
    Fixed the build systems to require vrt for usrp.
---
 config/grc_usrp2.m4                          |  4 +-
 configure.ac                                 |  3 +-
 gr-usrp2/src/usrp2_sink_16sc.cc              |  9 +----
 gr-usrp2/src/usrp2_sink_32fc.cc              |  9 +----
 gr-usrp2/src/usrp2_source_16sc.cc            |  2 +-
 gr-usrp2/src/usrp2_source_32fc.cc            |  2 +-
 gr-usrp2/src/usrp2_source_base.cc            |  4 +-
 usrp2/firmware/include/usrp2_eth_packet.h    | 47 ----------------------
 usrp2/host/apps/Makefile.am                  |  5 ++-
 usrp2/host/apps/rx_streaming_samples.cc      |  2 +-
 usrp2/host/apps/tx_samples.cc                |  2 +-
 usrp2/host/include/usrp2/Makefile.am         |  3 +-
 usrp2/host/include/usrp2/rx_nop_handler.h    |  4 +-
 usrp2/host/include/usrp2/rx_sample_handler.h | 60 ----------------------------
 usrp2/host/include/usrp2/usrp2.h             | 19 ++++-----
 usrp2/host/lib/Makefile.am                   |  1 -
 usrp2/host/lib/rx_sample_handler.cc          | 27 -------------
 usrp2/host/lib/usrp2.cc                      | 24 +++++------
 usrp2/host/lib/usrp2_impl.cc                 | 56 ++++++++------------------
 usrp2/host/lib/usrp2_impl.h                  | 12 +++---
 20 files changed, 59 insertions(+), 236 deletions(-)

diff --git a/config/grc_usrp2.m4 b/config/grc_usrp2.m4
index f7064c9..fda75d8 100644
--- a/config/grc_usrp2.m4
+++ b/config/grc_usrp2.m4
@@ -23,9 +23,9 @@ AC_DEFUN([GRC_USRP2],[
     dnl firmware uses a subsidiary configure.ac
     AC_CONFIG_SUBDIRS([usrp2/firmware])
 
-    dnl Don't do usrp if omnithread or gruel is skipped
+    dnl Don't do usrp if vrt or gruel is skipped
     GRC_CHECK_DEPENDENCY(usrp2, gruel)
-    GRC_CHECK_DEPENDENCY(usrp2, omnithread)
+    GRC_CHECK_DEPENDENCY(usrp2, vrt)
 
     dnl USRP2 host code only works on Linux at the moment
     AC_MSG_CHECKING([whether host_os is linux*])
diff --git a/configure.ac b/configure.ac
index fbb8bb5..0d722c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -334,11 +334,10 @@ GRC_GCELL
 GRC_GNURADIO_CORE
 GRC_MBLOCK                     dnl this must come after GRC_GRUEL
 GRC_USRP
+GRC_VRT                        dnl this must come before GRC_USRP2
 GRC_USRP2
-GRC_VRT
 GRC_GR_USRP                    dnl this must come after GRC_USRP
 GRC_GR_USRP2
-GRC_GR_VRT
 GRC_GR_GCELL                   dnl this must come after GRC_GCELL and 
GRC_GNURADIO_CORE
 GRC_GR_MSDD6000        
 GRC_GR_AUDIO_ALSA
diff --git a/gr-usrp2/src/usrp2_sink_16sc.cc b/gr-usrp2/src/usrp2_sink_16sc.cc
index 3651a69..18b9ff1 100644
--- a/gr-usrp2/src/usrp2_sink_16sc.cc
+++ b/gr-usrp2/src/usrp2_sink_16sc.cc
@@ -60,18 +60,11 @@ usrp2_sink_16sc::work(int noutput_items,
 {
   std::complex<int16_t> *in = (std::complex<int16_t> *)input_items[0];
 
-  // FIXME: Current libusrp2 can't handle short packets.
-  // Returning 0 assumes there will be more samples
-  // the next round...
-  if (noutput_items < U2_MIN_SAMPLES)
-    return 0;
-
   usrp2::tx_metadata metadata;
   metadata.send_now = 1;
   metadata.start_of_burst = 1;
 
-  bool ok = d_u2->tx_16sc(0,  // FIXME: someday, streams will have channel 
numbers
-                         in, noutput_items, &metadata);
+  bool ok = d_u2->tx_16sc(in, noutput_items, &metadata);
   if (!ok){
     std::cerr << "usrp2_sink_16sc: tx_16sc failed" << std::endl;
     return -1; // say we're done
diff --git a/gr-usrp2/src/usrp2_sink_32fc.cc b/gr-usrp2/src/usrp2_sink_32fc.cc
index cf6fd04..9b43285 100644
--- a/gr-usrp2/src/usrp2_sink_32fc.cc
+++ b/gr-usrp2/src/usrp2_sink_32fc.cc
@@ -60,18 +60,11 @@ usrp2_sink_32fc::work(int noutput_items,
 {
   gr_complex *in = (gr_complex *)input_items[0];
 
-  // FIXME: Current libusrp2 can't handle short packets.
-  // Returning 0 assumes there will be more samples
-  // the next round...
-  if (noutput_items < U2_MIN_SAMPLES)
-    return 0;
-
   usrp2::tx_metadata metadata;
   metadata.send_now = 1;
   metadata.start_of_burst = 1;
 
-  bool ok = d_u2->tx_32fc(0, // FIXME: someday, streams will have channel 
numbers
-                         in, noutput_items, &metadata);
+  bool ok = d_u2->tx_32fc(in, noutput_items, &metadata);
   if (!ok){
     std::cerr << "usrp2_sink_32fc: tx_32fc failed" << std::endl;
     return -1; // say we're done
diff --git a/gr-usrp2/src/usrp2_source_16sc.cc 
b/gr-usrp2/src/usrp2_source_16sc.cc
index 33114b5..b2b93bf 100644
--- a/gr-usrp2/src/usrp2_source_16sc.cc
+++ b/gr-usrp2/src/usrp2_source_16sc.cc
@@ -59,7 +59,7 @@ usrp2_source_16sc::work(int noutput_items,
 
   rx_16sc_handler::sptr handler = rx_16sc_handler::make(noutput_items, 
USRP2_MIN_RX_SAMPLES, out);
 
-  bool ok = d_u2->rx_samples(0, handler.get()); // FIXME: channel number 
instead of 0
+  bool ok = d_u2->rx_samples(handler.get());
   if (!ok){
     std::cerr << "usrp2::rx_samples() failed" << std::endl;
     return -1; // say we're done
diff --git a/gr-usrp2/src/usrp2_source_32fc.cc 
b/gr-usrp2/src/usrp2_source_32fc.cc
index 89b4bea..71e6354 100644
--- a/gr-usrp2/src/usrp2_source_32fc.cc
+++ b/gr-usrp2/src/usrp2_source_32fc.cc
@@ -59,7 +59,7 @@ usrp2_source_32fc::work(int noutput_items,
 
   rx_32fc_handler::sptr handler = rx_32fc_handler::make(noutput_items, 
USRP2_MIN_RX_SAMPLES, out);
 
-  bool ok = d_u2->rx_samples(0, handler.get()); // FIXME: channel number 
instead of 0
+  bool ok = d_u2->rx_samples(handler.get());
   if (!ok){
     std::cerr << "usrp2::rx_samples() failed" << std::endl;
     return -1; // say we're done
diff --git a/gr-usrp2/src/usrp2_source_base.cc 
b/gr-usrp2/src/usrp2_source_base.cc
index 0ad7008..7cf42ac 100644
--- a/gr-usrp2/src/usrp2_source_base.cc
+++ b/gr-usrp2/src/usrp2_source_base.cc
@@ -139,13 +139,13 @@ usrp2_source_base::missing()
 bool
 usrp2_source_base::start()
 {
-  return d_u2->start_rx_streaming(0); // FIXME: someday sources will have 
channel #s
+  return d_u2->start_rx_streaming();
 }
 
 bool
 usrp2_source_base::stop()
 {
-  return d_u2->stop_rx_streaming(0); // FIXME: someday sources will have 
channel #s
+  return d_u2->stop_rx_streaming();
 }
 
 bool
diff --git a/usrp2/firmware/include/usrp2_eth_packet.h 
b/usrp2/firmware/include/usrp2_eth_packet.h
index cd55b27..b85db24 100644
--- a/usrp2/firmware/include/usrp2_eth_packet.h
+++ b/usrp2/firmware/include/usrp2_eth_packet.h
@@ -86,53 +86,6 @@ typedef struct {
  *  mbz == must be zero
  */
 
-typedef struct { // FIXME remove when we get vrt tx
-  uint32_t     word0;          // flags etc
-  uint32_t     timestamp;      // time of rx or tx (100 MHz)
-} u2_fixed_hdr_t;
-
-
-#define U2P_CHAN_MASK          0x1f
-#define        U2P_CHAN_SHIFT          27
-
-#define U2P_TX_IMMEDIATE       0x00000004  // send samples NOW, else at 
timestamp
-#define U2P_TX_START_OF_BURST  0x00000002  // this frame is the start of a 
burst
-#define        U2P_TX_END_OF_BURST     0x00000001  // this frame is the end of 
a burst
-
-#define        U2P_ALL_FLAGS           0x00000007
-
-
-static inline int // FIXME remove when we get vrt tx
-u2p_chan(u2_fixed_hdr_t *p)
-{
-  return (ntohl(p->word0) >> U2P_CHAN_SHIFT) & U2P_CHAN_MASK;
-}
-
-inline static uint32_t // FIXME remove when we get vrt tx
-u2p_word0(u2_fixed_hdr_t *p)
-{
-  return ntohl(p->word0);
-}
-
-inline static uint32_t // FIXME remove when we get vrt tx
-u2p_timestamp(u2_fixed_hdr_t *p)
-{
-  return ntohl(p->timestamp);
-}
-
-inline static void  // FIXME remove when we get vrt tx
-u2p_set_word0(u2_fixed_hdr_t *p, int flags, int chan)
-{
-  p->word0 = htonl((flags & U2P_ALL_FLAGS)
-                  | ((chan & U2P_CHAN_MASK) << U2P_CHAN_SHIFT));
-}
-
-inline static void  // FIXME remove when we get vrt tx
-u2p_set_timestamp(u2_fixed_hdr_t *p, uint32_t ts)
-{
-  p->timestamp = htonl(ts);
-}
-
 /*!
  * \brief consolidated packet: ethernet header + transport header
  */
diff --git a/usrp2/host/apps/Makefile.am b/usrp2/host/apps/Makefile.am
index 3b2ba5b..c13f678 100644
--- a/usrp2/host/apps/Makefile.am
+++ b/usrp2/host/apps/Makefile.am
@@ -35,13 +35,14 @@ noinst_PROGRAMS = \
        gen_const \
        rx_streaming_samples \
        tx_samples \
-       test_mimo_tx \
        gpio
 
+#FIXME test_mimo_tx
+
 find_usrps_SOURCES = find_usrps.cc
 usrp2_burn_mac_addr_SOURCES = usrp2_burn_mac_addr.cc
 rx_streaming_samples_SOURCES = rx_streaming_samples.cc
 gen_const_SOURCES = gen_const.cc
 tx_samples_SOURCES = tx_samples.cc
-test_mimo_tx_SOURCES = test_mimo_tx.cc
+#test_mimo_tx_SOURCES = test_mimo_tx.cc
 gpio_SOURCES = gpio.cc
diff --git a/usrp2/host/apps/rx_streaming_samples.cc 
b/usrp2/host/apps/rx_streaming_samples.cc
index 06a5ed9..0bd1048 100644
--- a/usrp2/host/apps/rx_streaming_samples.cc
+++ b/usrp2/host/apps/rx_streaming_samples.cc
@@ -343,7 +343,7 @@ main(int argc, char **argv)
   while (!signaled && 
          !handler->has_errored_p() && 
          !handler->has_finished_p()) {
-    bool ok = u2->rx_samples(0, handler.get());
+    bool ok = u2->rx_samples(handler.get());
     if (!ok){
       fprintf(stderr, "u2->rx_samples failed\n");
       return 1;
diff --git a/usrp2/host/apps/tx_samples.cc b/usrp2/host/apps/tx_samples.cc
index 5f899f6..4ba1aa5 100644
--- a/usrp2/host/apps/tx_samples.cc
+++ b/usrp2/host/apps/tx_samples.cc
@@ -254,7 +254,7 @@ main(int argc, char **argv)
 
     // FIXME if r < 9, pad to 9 for minimum packet size constraint
 
-    if (!u2->tx_16sc(0, samples, r, &md)){
+    if (!u2->tx_16sc(samples, r, &md)){
       fprintf(stderr, "tx_complex_int16 failed\n");
       break;
     }
diff --git a/usrp2/host/include/usrp2/Makefile.am 
b/usrp2/host/include/usrp2/Makefile.am
index 08fdcde..51d1730 100644
--- a/usrp2/host/include/usrp2/Makefile.am
+++ b/usrp2/host/include/usrp2/Makefile.am
@@ -24,11 +24,10 @@ usrp2includedir = $(includedir)/usrp2
 usrp2include_HEADERS = \
        copiers.h \
        copy_handler.h \
-        data_handler.h \
+       data_handler.h \
        metadata.h \
        mimo_config.h \
        rx_nop_handler.h \
-       rx_sample_handler.h \
        strtod_si.h \
        tune_result.h \
        usrp2.h \
diff --git a/usrp2/host/include/usrp2/rx_nop_handler.h 
b/usrp2/host/include/usrp2/rx_nop_handler.h
index 71a0a69..801ecca 100644
--- a/usrp2/host/include/usrp2/rx_nop_handler.h
+++ b/usrp2/host/include/usrp2/rx_nop_handler.h
@@ -19,7 +19,7 @@
 #ifndef INCLUDED_RX_NOP_HANDLER_H
 #define INCLUDED_RX_NOP_HANDLER_H
 
-#include <usrp2/rx_sample_handler.h>
+#include <vrt/rx_packet_handler.h>
 #include <boost/shared_ptr.hpp>
 
 /*!
@@ -37,7 +37,7 @@
 
 namespace usrp2 {
 
-  class rx_nop_handler : public rx_sample_handler
+  class rx_nop_handler : public vrt::rx_packet_handler
   {
     uint64_t   d_max_samples;
     uint64_t    d_max_quantum;
diff --git a/usrp2/host/include/usrp2/rx_sample_handler.h 
b/usrp2/host/include/usrp2/rx_sample_handler.h
deleted file mode 100644
index 00082e5..0000000
--- a/usrp2/host/include/usrp2/rx_sample_handler.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008 Free Software Foundation, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-#ifndef INCLUDED_USRP2_RX_SAMPLE_HANDLER_H
-#define INCLUDED_USRP2_RX_SAMPLE_HANDLER_H
-
-#include <usrp2/metadata.h>
-#include <vrt/expanded_header.h>
-#include <stddef.h>
-
-
-namespace usrp2 {
-
-  /*!
-   * \brief Abstract function object called to handle received data blocks.
-   * \ingroup usrp2
-   *
-   * An object derived from this class is passed to usrp2::rx_samples
-   * to process the received frames of samples.
-   */
-  class rx_sample_handler {
-  public:
-    virtual ~rx_sample_handler();
-
-    /*!
-     * \param items points to the first 32-bit word of uninterpreted sample 
data in the frame.
-     * \param nitems is the number of entries in the frame in units of 
uint32_t's.
-     * \param metadata is the additional per frame data provided by the USRP2 
FPGA.
-     *
-     * \p items points to the raw sample data received off of the ethernet.  
The data is
-     * packed into big-endian 32-bit unsigned ints for transport, but the 
actual format
-     * of the data is dependent on the current configuration of the USRP2.  
The most common
-     * format is 16-bit I & Q, with I in the top of the 32-bit word.
-     *
-     * This is the general purpose, low level interface and relies on other 
functions
-     * to handle all required endian-swapping and format conversion.  \sa 
FIXME.
-     *
-     * \returns true if the object wants to be called again with new data;
-     * false if no additional data is wanted.
-     */
-    virtual bool operator()(const uint32_t *items, size_t nitems, const 
vrt::expanded_header *vrt_header) = 0;
-  };
-
-};
-
-#endif /* INCLUDED_RX_SAMPLE_HANDLER_H */
diff --git a/usrp2/host/include/usrp2/usrp2.h b/usrp2/host/include/usrp2/usrp2.h
index 86ea7e0..ea39acc 100644
--- a/usrp2/host/include/usrp2/usrp2.h
+++ b/usrp2/host/include/usrp2/usrp2.h
@@ -23,7 +23,8 @@
 #include <boost/utility.hpp>
 #include <vector>
 #include <complex>
-#include <usrp2/rx_sample_handler.h>
+#include <vrt/rx_packet_handler.h>
+#include <usrp2/metadata.h> //FIXME remove for vrt
 #include <usrp2/tune_result.h>
 #include <usrp2/mimo_config.h>
 
@@ -173,21 +174,20 @@ namespace usrp2 {
      * Start streaming receive mode.  USRP2 will send a continuous stream of
      * DSP pipeline samples to host.  Call rx_samples(...) to access.
      * 
-     * \param channel          Stream channel number (0-30)
      * \param items_per_frame  Number of 32-bit items per frame.
      */
-    bool start_rx_streaming(unsigned int channel=0, unsigned int 
items_per_frame=0);
+    bool start_rx_streaming(unsigned int items_per_frame=0);
   
     /*!
      * Stop streaming receive mode.
      */
-    bool stop_rx_streaming(unsigned int channel=0);
+    bool stop_rx_streaming();
 
     /*!
      * \brief Receive data from the specified channel
      * This method is used to receive all data: streaming or discrete.
      */
-    bool rx_samples(unsigned int channel, rx_sample_handler *handler);
+    bool rx_samples(vrt::rx_packet_handler *handler);
 
     /*!
      * Returns number of times receive overruns have occurred
@@ -267,7 +267,6 @@ namespace usrp2 {
     /*!
      * \brief transmit complex<float> samples to USRP2
      *
-     * \param channel specifies the channel to send them to
      * \param samples are the samples to transmit.  They should be in the 
range [-1.0, +1.0]
      * \param nsamples is the number of samples to transmit
      * \param metadata provides the timestamp and flags
@@ -276,7 +275,7 @@ namespace usrp2 {
      * "on the wire" representation, depending on the current USRP2
      * configuration.  Typically, this is big-endian 16-bit I & Q.
      */
-    bool tx_32fc(unsigned int channel,
+    bool tx_32fc(
                 const std::complex<float> *samples,
                 size_t nsamples,
                 const tx_metadata *metadata);
@@ -284,7 +283,6 @@ namespace usrp2 {
     /*!
      * \brief transmit complex<int16_t> samples to USRP2
      *
-     * \param channel specifies the channel to send them to
      * \param samples are the samples to transmit
      * \param nsamples is the number of samples to transmit
      * \param metadata provides the timestamp and flags
@@ -293,7 +291,7 @@ namespace usrp2 {
      * "on the wire" representation, depending on the current USRP2
      * configuration.  Typically, this is big-endian 16-bit I & Q.
      */
-    bool tx_16sc(unsigned int channel,
+    bool tx_16sc(
                 const std::complex<int16_t> *samples,
                 size_t nsamples,
                 const tx_metadata *metadata);
@@ -306,12 +304,11 @@ namespace usrp2 {
      * This method is used primarily by the system itself.  Users
      * should call tx_32fc or tx_16sc instead.
      *
-     * \param channel specifies the channel to send them to
      * \param items are the data items to transmit
      * \param nitems is the number of items to transmit
      * \param metadata provides the timestamp and flags
      */
-    bool tx_raw(unsigned int channel,
+    bool tx_raw(
                const uint32_t *items,
                size_t nitems,
                const tx_metadata *metadata);
diff --git a/usrp2/host/lib/Makefile.am b/usrp2/host/lib/Makefile.am
index cfccac3..2b6b08c 100644
--- a/usrp2/host/lib/Makefile.am
+++ b/usrp2/host/lib/Makefile.am
@@ -44,7 +44,6 @@ libusrp2_la_SOURCES = \
        open_usrp2_socket.cc \
        pktfilter.cc \
        rx_nop_handler.cc \
-       rx_sample_handler.cc \
        strtod_si.c \
        usrp2.cc \
        usrp2_impl.cc
diff --git a/usrp2/host/lib/rx_sample_handler.cc 
b/usrp2/host/lib/rx_sample_handler.cc
deleted file mode 100644
index 4521025..0000000
--- a/usrp2/host/lib/rx_sample_handler.cc
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008 Free Software Foundation, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <usrp2/rx_sample_handler.h>
-
-usrp2::rx_sample_handler::~rx_sample_handler()
-{
-  // nop
-}
diff --git a/usrp2/host/lib/usrp2.cc b/usrp2/host/lib/usrp2.cc
index 81f6c9d..1126fc3 100644
--- a/usrp2/host/lib/usrp2.cc
+++ b/usrp2/host/lib/usrp2.cc
@@ -251,21 +251,21 @@ namespace usrp2 {
   }
   
   bool
-  usrp2::start_rx_streaming(unsigned int channel, unsigned int items_per_frame)
+  usrp2::start_rx_streaming(unsigned int items_per_frame)
   {
-    return d_impl->start_rx_streaming(channel, items_per_frame);
+    return d_impl->start_rx_streaming(items_per_frame);
   }
   
   bool
-  usrp2::rx_samples(unsigned int channel, rx_sample_handler *handler)
+  usrp2::rx_samples(vrt::rx_packet_handler *handler)
   {
-    return d_impl->rx_samples(channel, handler);
+    return d_impl->rx_samples(handler);
   }
 
   bool
-  usrp2::stop_rx_streaming(unsigned int channel)
+  usrp2::stop_rx_streaming()
   {
-    return d_impl->stop_rx_streaming(channel);
+    return d_impl->stop_rx_streaming();
   }
 
   unsigned int
@@ -358,30 +358,30 @@ namespace usrp2 {
   }
   
   bool
-  usrp2::tx_32fc(unsigned int channel,
+  usrp2::tx_32fc(
                 const std::complex<float> *samples,
                 size_t nsamples,
                 const tx_metadata *metadata)
   {
-    return d_impl->tx_32fc(channel, samples, nsamples, metadata);
+    return d_impl->tx_32fc(samples, nsamples, metadata);
   }
 
   bool
-  usrp2::tx_16sc(unsigned int channel,
+  usrp2::tx_16sc(
                 const std::complex<int16_t> *samples,
                 size_t nsamples,
                 const tx_metadata *metadata)
   {
-    return d_impl->tx_16sc(channel, samples, nsamples, metadata);
+    return d_impl->tx_16sc(samples, nsamples, metadata);
   }
 
   bool
-  usrp2::tx_raw(unsigned int channel,
+  usrp2::tx_raw(
                const uint32_t *items,
                size_t nitems,
                const tx_metadata *metadata)
   {
-    return d_impl->tx_raw(channel, items, nitems, metadata);
+    return d_impl->tx_raw(items, nitems, metadata);
   }
 
   // miscellaneous methods
diff --git a/usrp2/host/lib/usrp2_impl.cc b/usrp2/host/lib/usrp2_impl.cc
index 0a72698..8d1cfb7 100644
--- a/usrp2/host/lib/usrp2_impl.cc
+++ b/usrp2/host/lib/usrp2_impl.cc
@@ -129,10 +129,10 @@ namespace usrp2 {
    ********************************************************************/
   class data_packet_handler : public data_handler{
   private:
-    rx_sample_handler *d_handler;
+    vrt::rx_packet_handler *d_handler;
 
   public:
-    data_packet_handler(rx_sample_handler *handler): d_handler(handler){}
+    data_packet_handler(vrt::rx_packet_handler *handler): d_handler(handler){}
 
     data_handler::result operator()(const void *base, size_t len){
         DEBUG_LOG("h"); 
@@ -168,8 +168,7 @@ namespace usrp2 {
     memset(d_pending_replies, 0, sizeof(d_pending_replies));
 
     // In case the USRP2 was left streaming RX
-    // FIXME: only one channel right now
-    stop_rx_streaming(0);
+    stop_rx_streaming();
 
     if (!dboard_info())                // we're hosed
       throw std::runtime_error("Unable to retrieve daughterboard info");
@@ -409,26 +408,15 @@ namespace usrp2 {
   }
   
   bool
-  usrp2::impl::start_rx_streaming(unsigned int channel, unsigned int 
items_per_frame)
+  usrp2::impl::start_rx_streaming(unsigned int items_per_frame)
   {
-    if (channel > MAX_CHAN) {
-      std::cerr << "usrp2: invalid channel number (" << channel
-               << ")" << std::endl;
-      return false;
-    }
-
-    if (channel > 0) { // until firmware supports multiple streams
-      std::cerr << "usrp2: channel " << channel
-               << " not implemented" << std::endl;
-      return false;
-    }
 
     //flush any old samples in the data transport
     d_data_transport->flush();
 
       if (items_per_frame == 0)
-       items_per_frame = U2_MAX_SAMPLES;               // minimize overhead
-      
+        items_per_frame = U2_MAX_SAMPLES;              // minimize overhead
+
       op_start_rx_streaming_cmd cmd;
       op_generic_t reply;
 
@@ -451,19 +439,8 @@ namespace usrp2 {
   }
   
   bool
-  usrp2::impl::stop_rx_streaming(unsigned int channel)
+  usrp2::impl::stop_rx_streaming()
   {
-    if (channel > MAX_CHAN) {
-      std::cerr << "usrp2: invalid channel number (" << channel
-               << ")" << std::endl;
-      return false;
-    }
-
-    if (channel > 0) { // until firmware supports multiple streams
-      std::cerr << "usrp2: channel " << channel
-               << " not implemented" << std::endl;
-      return false;
-    }
 
     op_stop_rx_cmd cmd;
     op_generic_t reply;
@@ -487,7 +464,7 @@ namespace usrp2 {
   }
 
   bool
-  usrp2::impl::rx_samples(unsigned int channel, rx_sample_handler *handler)
+  usrp2::impl::rx_samples(vrt::rx_packet_handler *handler)
   {
     data_handler *pkt_handler = new data_packet_handler(handler);
     d_data_transport->recv(pkt_handler);
@@ -652,18 +629,18 @@ namespace usrp2 {
   }
 
   bool
-  usrp2::impl::tx_32fc(unsigned int channel,
+  usrp2::impl::tx_32fc(
                       const std::complex<float> *samples,
                       size_t nsamples,
                       const tx_metadata *metadata)
   {
     uint32_t items[nsamples];
     copy_host_32fc_to_u2_16sc(nsamples, samples, items);
-    return tx_raw(channel, items, nsamples, metadata);
+    return tx_raw(items, nsamples, metadata);
   }
 
   bool
-  usrp2::impl::tx_16sc(unsigned int channel,
+  usrp2::impl::tx_16sc(
                       const std::complex<int16_t> *samples,
                       size_t nsamples,
                       const tx_metadata *metadata)
@@ -674,19 +651,19 @@ namespace usrp2 {
     // No conversion required.
 
     assert(sizeof(samples[0]) == sizeof(uint32_t));
-    return tx_raw(channel, (const uint32_t *) samples, nsamples, metadata);
+    return tx_raw((const uint32_t *) samples, nsamples, metadata);
 
 #else
 
     uint32_t items[nsamples];
     copy_host_16sc_to_u2_16sc(nsamples, samples, items);
-    return tx_raw(channel, items, nsamples, metadata);
+    return tx_raw(items, nsamples, metadata);
 
 #endif
   }
 
   bool
-  usrp2::impl::tx_raw(unsigned int channel,
+  usrp2::impl::tx_raw(
                      const uint32_t *items,
                      size_t nitems,
                      const tx_metadata *metadata)
@@ -717,14 +694,13 @@ namespace usrp2 {
       size_t i = std::min((size_t) U2_MAX_SAMPLES, nitems - n);
 
       //setup the header
-      uint32_t vrt_if_data_pkt_hdr[2];
+      uint32_t vrt_if_data_pkt_hdr[1];
       d_tx_pkt_cnt++; //increment the tx packet count
       vrt_if_data_pkt_hdr[0] =
-        VRTH_PT_IF_DATA_WITH_SID |
+        VRTH_PT_IF_DATA_NO_SID |
         burst_flags              |
         ((i+dimof(vrt_if_data_pkt_hdr)) & VRTH_PKT_SIZE_MASK) |
         ((d_tx_pkt_cnt << VRTH_PKT_CNT_SHIFT) & VRTH_PKT_CNT_MASK);
-      vrt_if_data_pkt_hdr[1] = channel;
 
       //make the header nbo
       for (size_t j = 0; j < dimof(vrt_if_data_pkt_hdr); j++){
diff --git a/usrp2/host/lib/usrp2_impl.h b/usrp2/host/lib/usrp2_impl.h
index cd54bd5..57f1e83 100644
--- a/usrp2/host/lib/usrp2_impl.h
+++ b/usrp2/host/lib/usrp2_impl.h
@@ -102,9 +102,9 @@ namespace usrp2 {
     bool enable_gpio_streaming(int bank, int enable);
     bool write_gpio(int bank, uint16_t value, uint16_t mask);
     bool read_gpio(int bank, uint16_t *value);
-    bool start_rx_streaming(unsigned int channel, unsigned int 
items_per_frame);
-    bool rx_samples(unsigned int channel, rx_sample_handler *handler);
-    bool stop_rx_streaming(unsigned int channel);
+    bool start_rx_streaming(unsigned int items_per_frame);
+    bool rx_samples(vrt::rx_packet_handler *handler);
+    bool stop_rx_streaming();
 
     // Tx
 
@@ -121,17 +121,17 @@ namespace usrp2 {
     void default_tx_scale_iq(int interpolation_factor, int *scale_i, int 
*scale_q);
     bool set_tx_scale_iq(int scale_i, int scale_q);
 
-    bool tx_32fc(unsigned int channel,
+    bool tx_32fc(
                 const std::complex<float> *samples,
                 size_t nsamples,
                 const tx_metadata *metadata);
 
-    bool tx_16sc(unsigned int channel,
+    bool tx_16sc(
                 const std::complex<int16_t> *samples,
                 size_t nsamples,
                 const tx_metadata *metadata);
 
-    bool tx_raw(unsigned int channel,
+    bool tx_raw(
                const uint32_t *items,
                size_t nitems,
                const tx_metadata *metadata);



reply via email to

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