diff options
author | Josh Blum <josh@joshknows.com> | 2010-05-13 18:23:19 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-05-13 18:23:19 -0700 |
commit | abf2bc77f1880e34e206bd299fa0170f1bf9fe1d (patch) | |
tree | 119f9d2499b7600622e7d9e7eb1fa90ad4cd6506 | |
parent | 11059ddbd6f5301f72299933321c35d00663dfe6 (diff) | |
download | uhd-abf2bc77f1880e34e206bd299fa0170f1bf9fe1d.tar.gz uhd-abf2bc77f1880e34e206bd299fa0170f1bf9fe1d.tar.bz2 uhd-abf2bc77f1880e34e206bd299fa0170f1bf9fe1d.zip |
memcpy data when in custom io type
-rw-r--r-- | host/lib/transport/convert_types.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/host/lib/transport/convert_types.cpp b/host/lib/transport/convert_types.cpp index 8c3d6b17a..510d39454 100644 --- a/host/lib/transport/convert_types.cpp +++ b/host/lib/transport/convert_types.cpp @@ -115,10 +115,13 @@ void transport::convert_io_type_to_otw_type( switch(io_type.tid){ case io_type_t::COMPLEX_FLOAT32: host_floats_to_usrp2_items((boost::uint32_t *)otw_buff, (const fc32_t*)io_buff, num_samps); - break; + return; case io_type_t::COMPLEX_INT16: host_items_to_usrp2_items((boost::uint32_t *)otw_buff, (const boost::uint32_t*)io_buff, num_samps); - break; + return; + case io_type_t::CUSTOM_TYPE: + std::memcpy(otw_buff, io_buff, num_samps*io_type.size); + return; default: throw std::runtime_error(str(boost::format("convert_types: cannot handle type \"%c\"") % io_type.tid)); } @@ -135,10 +138,13 @@ void transport::convert_otw_type_to_io_type( switch(io_type.tid){ case io_type_t::COMPLEX_FLOAT32: usrp2_items_to_host_floats((fc32_t*)io_buff, (const boost::uint32_t *)otw_buff, num_samps); - break; + return; case io_type_t::COMPLEX_INT16: usrp2_items_to_host_items((boost::uint32_t*)io_buff, (const boost::uint32_t *)otw_buff, num_samps); - break; + return; + case io_type_t::CUSTOM_TYPE: + std::memcpy(io_buff, otw_buff, num_samps*io_type.size); + return; default: throw std::runtime_error(str(boost::format("convert_types: cannot handle type \"%c\"") % io_type.tid)); } |