diff options
author | Josh Blum <josh@joshknows.com> | 2011-07-08 11:58:51 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-07-08 11:58:51 -0700 |
commit | 54229a06d1e4c05158ef9517fd61e61204363ed6 (patch) | |
tree | 9102001f3a60d3af433d5b257ed213cd3faa9fdf /host/lib/transport/super_send_packet_handler.hpp | |
parent | aa6b340f436acf4c0cad80416f69312ecfe3f29f (diff) | |
download | uhd-54229a06d1e4c05158ef9517fd61e61204363ed6.tar.gz uhd-54229a06d1e4c05158ef9517fd61e61204363ed6.tar.bz2 uhd-54229a06d1e4c05158ef9517fd61e61204363ed6.zip |
usrp: added software scale factor adjustment
Diffstat (limited to 'host/lib/transport/super_send_packet_handler.hpp')
-rw-r--r-- | host/lib/transport/super_send_packet_handler.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/host/lib/transport/super_send_packet_handler.hpp b/host/lib/transport/super_send_packet_handler.hpp index 05557250f..d5d9e6fe3 100644 --- a/host/lib/transport/super_send_packet_handler.hpp +++ b/host/lib/transport/super_send_packet_handler.hpp @@ -58,6 +58,7 @@ public: _next_packet_seq(0) { this->resize(size); + this->set_scale_factor(32767.); } //! Resize the number of transport channels @@ -132,6 +133,11 @@ public: return boost::mutex::scoped_lock(_mutex); } + //! Set the scale factor used in float conversion + void set_scale_factor(const double scale_factor){ + _scale_factor = scale_factor; + } + /******************************************************************* * Send: * The entry point for the fast-path send calls. @@ -238,6 +244,7 @@ private: size_t _max_samples_per_packet; std::vector<const void *> _zero_buffs; size_t _next_packet_seq; + double _scale_factor; /******************************************************************* * Send a single packet: @@ -270,7 +277,7 @@ private: otw_mem += if_packet_info.num_header_words32; //copy-convert the samples into the send buffer - _converters[io_type.tid](_io_buffs, otw_mem, nsamps_per_buff, 32767.); + _converters[io_type.tid](_io_buffs, otw_mem, nsamps_per_buff, _scale_factor); //commit the samples to the zero-copy interface size_t num_bytes_total = (_header_offset_words32+if_packet_info.num_packet_words32)*sizeof(boost::uint32_t); |