diff options
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/dboard_manager.cpp | 6 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/mboard_impl.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/host/lib/usrp/dboard_manager.cpp b/host/lib/usrp/dboard_manager.cpp index f86545696..424626023 100644 --- a/host/lib/usrp/dboard_manager.cpp +++ b/host/lib/usrp/dboard_manager.cpp @@ -204,7 +204,7 @@ dboard_manager_impl::dboard_manager_impl( //make xcvr subdevs (make one subdev for both rx and tx dboards) if (rx_dboard_ctor == tx_dboard_ctor){ ASSERT_THROW(rx_subdevs == tx_subdevs); - BOOST_FOREACH(std::string subdev, rx_subdevs){ + BOOST_FOREACH(const std::string &subdev, rx_subdevs){ dboard_base::sptr xcvr_dboard = rx_dboard_ctor( dboard_base::ctor_args_t(subdev, interface, rx_dboard_id, tx_dboard_id) ); @@ -222,7 +222,7 @@ dboard_manager_impl::dboard_manager_impl( //make tx and rx subdevs (separate subdevs for rx and tx dboards) else{ //make the rx subdevs - BOOST_FOREACH(std::string subdev, rx_subdevs){ + BOOST_FOREACH(const std::string &subdev, rx_subdevs){ dboard_base::sptr rx_dboard = rx_dboard_ctor( dboard_base::ctor_args_t(subdev, interface, rx_dboard_id, dboard_id::NONE) ); @@ -232,7 +232,7 @@ dboard_manager_impl::dboard_manager_impl( ); } //make the tx subdevs - BOOST_FOREACH(std::string subdev, tx_subdevs){ + BOOST_FOREACH(const std::string &subdev, tx_subdevs){ dboard_base::sptr tx_dboard = tx_dboard_ctor( dboard_base::ctor_args_t(subdev, interface, dboard_id::NONE, tx_dboard_id) ); diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp index b6919a738..35dfd6287 100644 --- a/host/lib/usrp/usrp2/mboard_impl.cpp +++ b/host/lib/usrp/usrp2/mboard_impl.cpp @@ -116,7 +116,7 @@ void usrp2_impl::mboard_get(const wax::obj &key_, wax::obj &val){ ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_THIS_IS_MY_MAC_ADDR_DUDE); //extract the address - val = reinterpret_cast<mac_addr_t*>(in_data.data.mac_addr)->to_string(); + val = mac_addr_t::from_bytes(in_data.data.mac_addr).to_string(); return; } @@ -211,8 +211,8 @@ void usrp2_impl::mboard_set(const wax::obj &key, const wax::obj &val){ //setup the out data usrp2_ctrl_data_t out_data; out_data.id = htonl(USRP2_CTRL_ID_HERE_IS_A_NEW_MAC_ADDR_BRO); - mac_addr_t mac_addr(val.as<std::string>()); - std::memcpy(out_data.data.mac_addr, &mac_addr, sizeof(mac_addr_t)); + mac_addr_t mac_addr = mac_addr_t::from_string(val.as<std::string>()); + std::copy(mac_addr.to_bytes(), mac_addr.to_bytes()+mac_addr_t::hlen, out_data.data.mac_addr); //send and recv usrp2_ctrl_data_t in_data = ctrl_send_and_recv(out_data); |