fix for the case multiple USRP devices are specified in the config string
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
echo "building ctags for openair1 and openair2 ..."
|
echo "building ctags for openair1 and openair2 ..."
|
||||||
ctags -e -R --exclude=openair1/DOCS/ --exclude=openair2/DOCS/ --exclude=openair1/SIMULATION/ --exclude=targets/DOCS/ --exclude=targets/PROJECTS/ openair1 openair2 openair3 targets cmake_targets common nfapi executables sdr
|
ctags -e -R --exclude=openair1/DOCS/ --exclude=openair2/DOCS/ --exclude=openair1/SIMULATION/ --exclude=targets/DOCS/ --exclude=targets/PROJECTS/ openair1 openair2 openair3 targets cmake_targets common nfapi executables radio
|
||||||
|
|
||||||
|
|||||||
@@ -1067,18 +1067,28 @@ extern "C" {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_I(HW,"Found USRP %s\n", device_adds[0].get("type").c_str());
|
std::string type_str, product_str;
|
||||||
|
if (args.find("addr0") != std::string::npos) {
|
||||||
|
type_str = "type0";
|
||||||
|
product_str = "product0";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
type_str = "type";
|
||||||
|
product_str = "product";
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_I(HW,"Found USRP %s\n", device_adds[0].get(type_str).c_str());
|
||||||
double usrp_master_clock;
|
double usrp_master_clock;
|
||||||
|
|
||||||
if (device_adds[0].get("type") == "b200") {
|
if (device_adds[0].get(type_str) == "b200") {
|
||||||
device->type = USRP_B200_DEV;
|
device->type = USRP_B200_DEV;
|
||||||
usrp_master_clock = 30.72e6;
|
usrp_master_clock = 30.72e6;
|
||||||
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
|
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
|
||||||
args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=7680, recv_frame_size=7680" ;
|
args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=7680, recv_frame_size=7680" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device_adds[0].get("type") == "n3xx") {
|
if (device_adds[0].get(type_str) == "n3xx") {
|
||||||
const std::string product = device_adds[0].get("product");
|
const std::string product = device_adds[0].get(product_str);
|
||||||
printf("Found USRP %s\n", product.c_str());
|
printf("Found USRP %s\n", product.c_str());
|
||||||
device->type=USRP_N300_DEV;
|
device->type=USRP_N300_DEV;
|
||||||
if (product == "n320")
|
if (product == "n320")
|
||||||
@@ -1091,7 +1101,7 @@ extern "C" {
|
|||||||
LOG_W(HW,"Can't set kernel parameters for N3x0\n");
|
LOG_W(HW,"Can't set kernel parameters for N3x0\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device_adds[0].get("type") == "x300") {
|
if (device_adds[0].get(type_str) == "x300") {
|
||||||
printf("Found USRP x300\n");
|
printf("Found USRP x300\n");
|
||||||
device->type=USRP_X300_DEV;
|
device->type=USRP_X300_DEV;
|
||||||
usrp_master_clock = 184.32e6;
|
usrp_master_clock = 184.32e6;
|
||||||
@@ -1102,7 +1112,7 @@ extern "C" {
|
|||||||
LOG_W(HW,"Can't set kernel parameters for X3xx\n");
|
LOG_W(HW,"Can't set kernel parameters for X3xx\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device_adds[0].get("type") == "x4xx") {
|
if (device_adds[0].get(type_str) == "x4xx") {
|
||||||
printf("Found USRP x400\n");
|
printf("Found USRP x400\n");
|
||||||
device->type = USRP_X400_DEV;
|
device->type = USRP_X400_DEV;
|
||||||
usrp_master_clock = 245.76e6;
|
usrp_master_clock = 245.76e6;
|
||||||
|
|||||||
Reference in New Issue
Block a user