diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index bb1ea79..72d1458 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -210,7 +210,7 @@ public: uhd_device(int sps, bool skip_rx); ~uhd_device(); - int open(const std::string &args, ReferenceType ref); + int open(const std::string &args, ReferenceType ref, const std::string &subdev); bool start(); bool stop(); void restart(uhd::time_spec_t ts); @@ -545,7 +545,7 @@ bool uhd_device::parse_dev_type() return true; } -int uhd_device::open(const std::string &args, ReferenceType ref) +int uhd_device::open(const std::string &args, ReferenceType ref, const std::string &subdev) { // Find UHD devices uhd::device_addr_t addr(args); @@ -570,6 +570,12 @@ int uhd_device::open(const std::string &args, ReferenceType ref) set_ref_clk(ref); + //specify subdevice (daughterboard) + if(!subdev.empty()) { + usrp_dev->set_tx_subdev_spec(subdev); + usrp_dev->set_rx_subdev_spec(subdev); + } + // Create TX and RX streamers uhd::stream_args_t stream_args("sc16"); tx_stream = usrp_dev->get_tx_stream(stream_args); diff --git a/Transceiver52M/radioDevice.h b/Transceiver52M/radioDevice.h index 4017439..7df91c9 100644 --- a/Transceiver52M/radioDevice.h +++ b/Transceiver52M/radioDevice.h @@ -43,7 +43,7 @@ class RadioDevice { virtual ~RadioDevice() { } /** Initialize the USRP */ - virtual int open(const std::string &args, ReferenceType ref)=0; + virtual int open(const std::string &args, ReferenceType ref, const std::string &subdev = "")=0; /** Start the USRP */ virtual bool start()=0; diff --git a/Transceiver52M/runTransceiver.cpp b/Transceiver52M/runTransceiver.cpp index c06d3c3..8a6854b 100644 --- a/Transceiver52M/runTransceiver.cpp +++ b/Transceiver52M/runTransceiver.cpp @@ -112,7 +112,7 @@ int testConfig(const char *filename) int main(int argc, char *argv[]) { int trxPort, radioType, fail = 0; - std::string deviceArgs, logLevel, trxAddr, refstr; + std::string deviceArgs, logLevel, trxAddr, refstr, subdev; RadioDevice *usrp = NULL; RadioDevice::ReferenceType refType; RadioInterface *radio = NULL; @@ -142,6 +142,7 @@ int main(int argc, char *argv[]) logLevel = gConfig.getStr("Log.Level"); trxPort = gConfig.getNum("TRX.Port"); trxAddr = gConfig.getStr("TRX.IP"); + subdev = gConfig.getStr("TRX.Subdevice"); if (gConfig.defines("TRX.Reference")) refstr = gConfig.getStr("TRX.Reference"); diff --git a/apps/GetConfigurationKeys.cpp b/apps/GetConfigurationKeys.cpp index 6360639..11b735f 100644 --- a/apps/GetConfigurationKeys.cpp +++ b/apps/GetConfigurationKeys.cpp @@ -3078,6 +3078,17 @@ ConfigurationKeyMap getConfigurationKeys() map[tmp.getName()] = tmp; } + { ConfigurationKey tmp("TRX.Subdevice","", + "", + ConfigurationKey::CUSTOMERWARN, + ConfigurationKey::STRING, + "", + true, + "This value is a string that specifies a subdevice for Ettus Hardware." + ); + map[tmp.getName()] = tmp; + } + { ConfigurationKey tmp("TRX.Timeout.Clock","10", "seconds", ConfigurationKey::DEVELOPER, diff --git a/apps/OpenBTS.example.sql b/apps/OpenBTS.example.sql index 1610138..421072e 100644 --- a/apps/OpenBTS.example.sql +++ b/apps/OpenBTS.example.sql @@ -237,6 +237,7 @@ INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.RadioFrequencyOffset','128',1,0,'Fine INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.Timeout.Clock','10',0,0,'How long to wait during a read operation from the Transceiver before giving up.'); INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.Timeout.Start','2',0,0,'How long to wait during system startup before checking to see if the Transceiver can be reached.'); INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.TxAttenOffset','0',1,0,'Hardware-specific gain adjustment for transmitter, matched to the power amplifier, expessed as an attenuation in dB. Set at the factory. Do not adjust without proper calibration. Static.'); +INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.Subdevice','',1,0,'Subdevice (Daughterboard) to use on Ettus hardware that supports it'); INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.Reference','internal',0,0,'TRX reference type ("internal", "external", "gpsdo")'); INSERT OR IGNORE INTO "CONFIG" VALUES('Test.GSM.SimulatedFER.Downlink','0',0,0,'Probability (0-100) of dropping any downlink frame to test robustness.'); INSERT OR IGNORE INTO "CONFIG" VALUES('Test.GSM.SimulatedFER.Uplink','0',0,0,'Probability (0-100) of dropping any uplink frame to test robustness.');