diff options
author | Josh Blum <josh@joshknows.com> | 2010-06-04 21:13:53 +0000 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-06-04 21:13:53 +0000 |
commit | 9fa97e153d01985bc7bdf9db8a97d79a328a3e61 (patch) | |
tree | 68606b25eff9d2d88878bbd89c794fc86ac18fb5 /host/lib/usrp/usrp2/usrp2_iface.cpp | |
parent | 685cf432a373ee7556db507f7958f51e6ccf581a (diff) | |
parent | 4f0736ef7ce93d58f0768d99257b2624d5711490 (diff) | |
download | uhd-9fa97e153d01985bc7bdf9db8a97d79a328a3e61.tar.gz uhd-9fa97e153d01985bc7bdf9db8a97d79a328a3e61.tar.bz2 uhd-9fa97e153d01985bc7bdf9db8a97d79a328a3e61.zip |
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_iface.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_iface.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp index e43b9678e..6e0d3266a 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.cpp +++ b/host/lib/usrp/usrp2/usrp2_iface.cpp @@ -146,18 +146,19 @@ public: _ctrl_transport->send(boost::asio::buffer(&out_copy, sizeof(usrp2_ctrl_data_t))); //loop until we get the packet or timeout + boost::uint8_t usrp2_ctrl_data_in_mem[1500]; //allocate MTU bytes for recv + usrp2_ctrl_data_t *ctrl_data_in = reinterpret_cast<usrp2_ctrl_data_t *>(usrp2_ctrl_data_in_mem); while(true){ - usrp2_ctrl_data_t in_data; - size_t len = _ctrl_transport->recv(boost::asio::buffer(&in_data, sizeof(in_data))); - if(len >= sizeof(boost::uint32_t) and ntohl(in_data.proto_ver) != USRP2_PROTO_VERSION){ + size_t len = _ctrl_transport->recv(boost::asio::buffer(usrp2_ctrl_data_in_mem)); + if(len >= sizeof(boost::uint32_t) and ntohl(ctrl_data_in->proto_ver) != USRP2_PROTO_VERSION){ throw std::runtime_error(str( boost::format("Expected protocol version %d, but got %d\n" "The firmware build does not match the host code build." - ) % int(USRP2_PROTO_VERSION) % ntohl(in_data.proto_ver) + ) % int(USRP2_PROTO_VERSION) % ntohl(ctrl_data_in->proto_ver) )); } - if (len >= sizeof(usrp2_ctrl_data_t) and ntohl(in_data.seq) == _ctrl_seq_num){ - return in_data; + if (len >= sizeof(usrp2_ctrl_data_t) and ntohl(ctrl_data_in->seq) == _ctrl_seq_num){ + return *ctrl_data_in; } if (len == 0) break; //timeout //didnt get seq or bad packet, continue looking... @@ -165,13 +166,6 @@ public: throw std::runtime_error("usrp2 no control response"); } -/*********************************************************************** - * Master Clock! Ahhhhh - **********************************************************************/ - double get_master_clock_freq(void){ - return 100e6; - } - private: //this lovely lady makes it all possible transport::udp_simple::sptr _ctrl_transport; |