Adding support for subdevices from @STKFLT (https://github.com/RangeNetworks/openbts/pull/12/files)

This commit is contained in:
FlUxIuS 2023-01-07 16:46:13 +01:00
parent d9ad8a5683
commit 15636159ad
5 changed files with 23 additions and 4 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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");

View file

@ -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,

View file

@ -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.');