summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/deprecated.hpp78
-rw-r--r--host/include/uhd/device_deprecated.ipp10
-rw-r--r--host/include/uhd/types/io_type.hpp81
3 files changed, 84 insertions, 85 deletions
diff --git a/host/include/uhd/deprecated.hpp b/host/include/uhd/deprecated.hpp
index 0f4965bc6..e4112fa66 100644
--- a/host/include/uhd/deprecated.hpp
+++ b/host/include/uhd/deprecated.hpp
@@ -242,80 +242,4 @@ namespace uhd{
#endif /* INCLUDED_UHD_TYPES_OTW_TYPE_HPP */
-//
-// Copyright 2010-2011 Ettus Research LLC
-//
-// 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_UHD_TYPES_IO_TYPE_HPP
-#define INCLUDED_UHD_TYPES_IO_TYPE_HPP
-
-#include <uhd/config.hpp>
-
-namespace uhd{
-
- /*!
- * The Input/Output configuration struct:
- * Used to specify the IO type with device send/recv.
- */
- class UHD_API io_type_t{
- public:
-
- /*!
- * Built in IO types known to the system.
- */
- enum tid_t{
- //! Custom type (technically unsupported by implementation)
- CUSTOM_TYPE = int('?'),
- //! Complex floating point (64-bit floats) range [-1.0, +1.0]
- COMPLEX_FLOAT64 = int('d'),
- //! Complex floating point (32-bit floats) range [-1.0, +1.0]
- COMPLEX_FLOAT32 = int('f'),
- //! Complex signed integer (16-bit integers) range [-32768, +32767]
- COMPLEX_INT16 = int('s'),
- //! Complex signed integer (8-bit integers) range [-128, 127]
- COMPLEX_INT8 = int('b')
- };
-
- /*!
- * The size of this io type in bytes.
- */
- const size_t size;
-
- /*!
- * The type id of this io type.
- * Good for using with switch statements.
- */
- const tid_t tid;
-
- /*!
- * Create an io type from a built-in type id.
- * \param tid a type id known to the system
- */
- io_type_t(tid_t tid);
-
- /*!
- * Create an io type from attributes.
- * The tid will be set to custom.
- * \param size the size in bytes
- */
- io_type_t(size_t size);
-
- };
-
-} //namespace uhd
-
-#endif /* INCLUDED_UHD_TYPES_IO_TYPE_HPP */
-
+#include <uhd/types/io_type.hpp> //wish it was in here
diff --git a/host/include/uhd/device_deprecated.ipp b/host/include/uhd/device_deprecated.ipp
index 4647a050e..ad84a1a6b 100644
--- a/host/include/uhd/device_deprecated.ipp
+++ b/host/include/uhd/device_deprecated.ipp
@@ -79,13 +79,12 @@ size_t send(
){
if (_tx_streamer.get() == NULL or _tx_streamer->get_num_channels() != buffs.size() or _send_tid != io_type.tid){
_send_tid = io_type.tid;
- std::vector<size_t> chans(buffs.size());
- for (size_t ch = 0; ch < chans.size(); ch++) chans[ch] = ch;
_tx_streamer.reset(); //cleanup possible old one
streamer_args args;
args.cpu_format = (_send_tid == io_type_t::COMPLEX_FLOAT32)? "fc32" : "sc16";
args.otw_format = "sc16";
- args.channels = chans;
+ for (size_t ch = 0; ch < buffs.size(); ch++)
+ args.channels.push_back(ch); //linear mapping
_tx_streamer = get_tx_streamer(args);
}
const size_t nsamps = (send_mode == SEND_MODE_ONE_PACKET)?
@@ -135,13 +134,12 @@ size_t recv(
){
if (_rx_streamer.get() == NULL or _rx_streamer->get_num_channels() != buffs.size() or _recv_tid != io_type.tid){
_recv_tid = io_type.tid;
- std::vector<size_t> chans(buffs.size());
- for (size_t ch = 0; ch < chans.size(); ch++) chans[ch] = ch;
_rx_streamer.reset(); //cleanup possible old one
streamer_args args;
args.cpu_format = (_send_tid == io_type_t::COMPLEX_FLOAT32)? "fc32" : "sc16";
args.otw_format = "sc16";
- args.channels = chans;
+ for (size_t ch = 0; ch < buffs.size(); ch++)
+ args.channels.push_back(ch); //linear mapping
_rx_streamer = get_rx_streamer(args);
}
const size_t nsamps = (recv_mode == RECV_MODE_ONE_PACKET)?
diff --git a/host/include/uhd/types/io_type.hpp b/host/include/uhd/types/io_type.hpp
index e0ee4187b..967ad7908 100644
--- a/host/include/uhd/types/io_type.hpp
+++ b/host/include/uhd/types/io_type.hpp
@@ -1,2 +1,79 @@
-//The IO type API has been deprecated in favor of the streamer interface
-#include <uhd/deprecated.hpp>
+//
+// Copyright 2010-2011 Ettus Research LLC
+//
+// 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_UHD_TYPES_IO_TYPE_HPP
+#define INCLUDED_UHD_TYPES_IO_TYPE_HPP
+
+#include <uhd/config.hpp>
+
+namespace uhd{
+
+ /*!
+ * The DEPRECATED Input/Output configuration struct:
+ * Used to specify the IO type with device send/recv.
+ *
+ * Deprecated in favor of streamer interface.
+ * Its still in this file for the sake of gr-uhd swig.
+ */
+ class UHD_API io_type_t{
+ public:
+
+ /*!
+ * Built in IO types known to the system.
+ */
+ enum tid_t{
+ //! Custom type (technically unsupported by implementation)
+ CUSTOM_TYPE = int('?'),
+ //! Complex floating point (64-bit floats) range [-1.0, +1.0]
+ COMPLEX_FLOAT64 = int('d'),
+ //! Complex floating point (32-bit floats) range [-1.0, +1.0]
+ COMPLEX_FLOAT32 = int('f'),
+ //! Complex signed integer (16-bit integers) range [-32768, +32767]
+ COMPLEX_INT16 = int('s'),
+ //! Complex signed integer (8-bit integers) range [-128, 127]
+ COMPLEX_INT8 = int('b')
+ };
+
+ /*!
+ * The size of this io type in bytes.
+ */
+ const size_t size;
+
+ /*!
+ * The type id of this io type.
+ * Good for using with switch statements.
+ */
+ const tid_t tid;
+
+ /*!
+ * Create an io type from a built-in type id.
+ * \param tid a type id known to the system
+ */
+ io_type_t(tid_t tid);
+
+ /*!
+ * Create an io type from attributes.
+ * The tid will be set to custom.
+ * \param size the size in bytes
+ */
+ io_type_t(size_t size);
+
+ };
+
+} //namespace uhd
+
+#endif /* INCLUDED_UHD_TYPES_IO_TYPE_HPP */