diff options
author | Josh Blum <josh@joshknows.com> | 2010-08-31 18:03:20 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-08-31 18:03:20 -0700 |
commit | 53e5f300dedfe4b1d573877ef07db447d1f3a046 (patch) | |
tree | 3b7d8cb5c2450574ba718dc86f433fbf061501ff /host/lib/usrp/usrp1/mboard_impl.cpp | |
parent | b5461fc3f5e7d1da74735ba5e025115dd2b7f04a (diff) | |
parent | ce3a95dbefa8528354301529eeb30957412d9b9f (diff) | |
download | uhd-53e5f300dedfe4b1d573877ef07db447d1f3a046.tar.gz uhd-53e5f300dedfe4b1d573877ef07db447d1f3a046.tar.bz2 uhd-53e5f300dedfe4b1d573877ef07db447d1f3a046.zip |
Merge branch 'usrp1' into next
Diffstat (limited to 'host/lib/usrp/usrp1/mboard_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp1/mboard_impl.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp1/mboard_impl.cpp b/host/lib/usrp/usrp1/mboard_impl.cpp index 8555577f5..a90532cb8 100644 --- a/host/lib/usrp/usrp1/mboard_impl.cpp +++ b/host/lib/usrp/usrp1/mboard_impl.cpp @@ -30,6 +30,7 @@ #include <boost/assign/list_of.hpp> #include <boost/foreach.hpp> #include <boost/bind.hpp> +#include <boost/thread/thread.hpp> #include <iostream> using namespace uhd; @@ -251,6 +252,20 @@ void usrp1_impl::mboard_get(const wax::obj &key_, wax::obj &val) { named_prop_t key = named_prop_t::extract(key_); + if(key_.type() == typeid(std::string)) { + if(key.as<std::string>() == "serial") { + uhd::byte_vector_t buf; + buf.insert(buf.begin(), 248); + boost::this_thread::sleep(boost::posix_time::milliseconds(100)); + _iface->write_i2c(I2C_DEV_EEPROM, buf); + boost::this_thread::sleep(boost::posix_time::milliseconds(100)); + buf = _iface->read_i2c(I2C_DEV_EEPROM, 8); + val = std::string(buf.begin(), buf.end()); + } + + return; + } + //handle the get request conditioned on the key switch(key.as<mboard_prop_t>()){ case MBOARD_PROP_NAME: |