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_impl.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_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_impl.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index af3ec216a..58f0696b5 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -76,16 +76,17 @@ uhd::device_addrs_t usrp2::find(const device_addr_t &hint){ udp_transport->send(boost::asio::buffer(&ctrl_data_out, sizeof(ctrl_data_out))); //loop and recieve until the 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 ctrl_data_in; - size_t len = udp_transport->recv(asio::buffer(&ctrl_data_in, sizeof(ctrl_data_in))); + size_t len = udp_transport->recv(asio::buffer(usrp2_ctrl_data_in_mem)); //std::cout << len << "\n"; if (len >= sizeof(usrp2_ctrl_data_t)){ //handle the received data - switch(ntohl(ctrl_data_in.id)){ + switch(ntohl(ctrl_data_in->id)){ case USRP2_CTRL_ID_WAZZUP_DUDE: //make a boost asio ipv4 with the raw addr in host byte order - boost::asio::ip::address_v4 ip_addr(ntohl(ctrl_data_in.data.ip_addr)); + boost::asio::ip::address_v4 ip_addr(ntohl(ctrl_data_in->data.ip_addr)); device_addr_t new_addr; new_addr["name"] = "USRP2"; new_addr["addr"] = ip_addr.to_string(); @@ -147,9 +148,9 @@ usrp2_impl::usrp2_impl( //make a new interface for usrp2 stuff _iface = usrp2_iface::make(ctrl_transport); - _clock_ctrl = clock_ctrl::make(_iface); - _codec_ctrl = codec_ctrl::make(_iface); - _serdes_ctrl = serdes_ctrl::make(_iface); + _clock_ctrl = usrp2_clock_ctrl::make(_iface); + _codec_ctrl = usrp2_codec_ctrl::make(_iface); + _serdes_ctrl = usrp2_serdes_ctrl::make(_iface); //load the allowed decim/interp rates //_USRP2_RATES = range(4, 128+1, 1) + range(130, 256+1, 2) + range(260, 512+1, 4) |