From 0059e62ed067a4844edfb720da73fcdb8e69db6a Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 7 Oct 2010 10:43:58 -0700 Subject: usrp2: moved samples per packet calculation into io_impl --- host/lib/usrp/usrp2/usrp2_impl.hpp | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'host/lib/usrp/usrp2/usrp2_impl.hpp') diff --git a/host/lib/usrp/usrp2/usrp2_impl.hpp b/host/lib/usrp/usrp2/usrp2_impl.hpp index e12c4d6d4..558726a2b 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.hpp +++ b/host/lib/usrp/usrp2/usrp2_impl.hpp @@ -184,24 +184,18 @@ public: ~usrp2_impl(void); //the io interface - size_t get_max_send_samps_per_packet(void) const{ - const size_t bytes_per_packet = _data_transports.front()->get_send_frame_size() - _max_tx_header_bytes; - return bytes_per_packet/_tx_otw_type.get_sample_size(); - } size_t send( const std::vector &, size_t, const uhd::tx_metadata_t &, const uhd::io_type_t &, uhd::device::send_mode_t, double ); - size_t get_max_recv_samps_per_packet(void) const{ - const size_t bytes_per_packet = _data_transports.front()->get_recv_frame_size() - _max_rx_header_bytes; - return bytes_per_packet/_rx_otw_type.get_sample_size(); - } size_t recv( const std::vector &, size_t, uhd::rx_metadata_t &, const uhd::io_type_t &, uhd::device::recv_mode_t, double ); + size_t get_max_send_samps_per_packet(void) const; + size_t get_max_recv_samps_per_packet(void) const; bool recv_async_msg(uhd::async_metadata_t &, double); private: @@ -215,20 +209,9 @@ private: //io impl methods and members std::vector _data_transports; + uhd::otw_type_t _rx_otw_type, _tx_otw_type; UHD_PIMPL_DECL(io_impl) _io_impl; void io_init(void); - - //over-the-wire structs and constants - uhd::otw_type_t _rx_otw_type, _tx_otw_type; - static const size_t _max_rx_header_bytes = 0 - + uhd::transport::vrt::max_if_hdr_words32*sizeof(boost::uint32_t) - + sizeof(uhd::transport::vrt::if_packet_info_t().tlr) //forced to have trailer - - sizeof(uhd::transport::vrt::if_packet_info_t().cid) //no class id ever used - ; - static const size_t _max_tx_header_bytes = 0 - + uhd::transport::vrt::max_if_hdr_words32*sizeof(boost::uint32_t) - - sizeof(uhd::transport::vrt::if_packet_info_t().cid) //no class id ever used - ; }; #endif /* INCLUDED_USRP2_IMPL_HPP */ -- cgit v1.2.3