aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/mboard_impl.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-03-29 12:58:06 -0700
committerJosh Blum <josh@joshknows.com>2010-03-29 12:58:06 -0700
commit1295df8cbba76c088a36f9d546a68c1d00e7a1a8 (patch)
treed8e0fdc72589d6d7614a14788caf31dbe6df6140 /host/lib/usrp/usrp2/mboard_impl.cpp
parent7396b53e1bdd1aa5f9dcba760c8993a0cf620b6a (diff)
downloaduhd-1295df8cbba76c088a36f9d546a68c1d00e7a1a8.tar.gz
uhd-1295df8cbba76c088a36f9d546a68c1d00e7a1a8.tar.bz2
uhd-1295df8cbba76c088a36f9d546a68c1d00e7a1a8.zip
Added utility methods to device addr and mac addr to make them more usable.
Diffstat (limited to 'host/lib/usrp/usrp2/mboard_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp6
1 files changed, 3 insertions, 3 deletions
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);