aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/UHDDevice.cpp
diff options
context:
space:
mode:
authorkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-26 03:18:55 +0000
committerkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-26 03:18:55 +0000
commite380af3ecc94b64754de501deb211a31ba6573f9 (patch)
tree2fea0a8446748b4e5d287e56f27ce21bbf83b474 /Transceiver52M/UHDDevice.cpp
parent0803ad9ad96a59427dbb8093375572ba683c0be2 (diff)
transceiver: make the transmit drive loop bus dependent
With the introduction of the B100, there is USB support using UHD devices. The characteristics of the trasmit side burst submissions are more reflective of the bus type than the device or driver. Use a fixed latency interval for network devices and the adaptive underrun approach for USB devices - regardless of driver or device type. The GPMC based transport on the E100 appears unaffected by either latency scheme, which defaults to network. Signed-off-by: Thomas Tsou <ttsou@vt.edu> git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2677 19bc5d8c-e614-43d4-8b26-e1612bc8e597
Diffstat (limited to 'Transceiver52M/UHDDevice.cpp')
-rw-r--r--Transceiver52M/UHDDevice.cpp31
1 files changed, 26 insertions, 5 deletions
diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp
index 261eabc..e72fcfe 100644
--- a/Transceiver52M/UHDDevice.cpp
+++ b/Transceiver52M/UHDDevice.cpp
@@ -22,6 +22,7 @@
#include "radioDevice.h"
#include "Threads.h"
#include "Logger.h"
+#include <uhd/property_tree.hpp>
#include <uhd/usrp/single_usrp.hpp>
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/msg.hpp>
@@ -154,6 +155,7 @@ public:
bool stop();
void restart(uhd::time_spec_t ts);
void setPriority();
+ enum busType getBus() { return bus; }
int readSamples(short *buf, int len, bool *overrun,
TIMESTAMP timestamp, bool *underrun, unsigned *RSSI);
@@ -201,6 +203,7 @@ public:
private:
uhd::usrp::single_usrp::sptr usrp_dev;
+ enum busType bus;
double desired_smpl_rt, actual_smpl_rt;
@@ -373,22 +376,40 @@ double uhd_device::setRxGain(double db)
bool uhd_device::open()
{
- LOG(INFO) << "creating USRP device...";
+ std::string dev_str;
+ uhd::property_tree::sptr prop_tree;
// Register msg handler
uhd::msg::register_handler(&uhd_msg_handler);
// Allow all UHD devices
+ LOG(INFO) << "Creating transceiver with first found UHD device";
uhd::device_addr_t dev_addr("");
try {
usrp_dev = uhd::usrp::single_usrp::make(dev_addr);
- }
-
- catch(...) {
- LOG(ERROR) << "USRP make failed";
+ } catch(...) {
+ LOG(ERROR) << "UHD make failed";
return false;
}
+ // Set the device name and bus type
+ dev_str = usrp_dev->get_mboard_name();
+ LOG(NOTICE) << "Found " << dev_str;
+
+ prop_tree = usrp_dev->get_device()->get_tree();
+ dev_str = prop_tree->access<std::string>("/name").get();
+
+ size_t res1 = dev_str.find("B100");
+ size_t res2 = dev_str.find("B-Series");
+
+ if ((res1 != std::string::npos) || (res2 != std::string::npos)) {
+ bus = USB;
+ LOG(NOTICE) << "Using USB bus for " << dev_str;
+ } else {
+ bus = NET;
+ LOG(NOTICE) << "Using network bus for " << dev_str;
+ }
+
// Number of samples per over-the-wire packet
tx_spp = usrp_dev->get_device()->get_max_send_samps_per_packet();
rx_spp = usrp_dev->get_device()->get_max_recv_samps_per_packet();