aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index af3ec216a..1e6e02dd1 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();