minor update in library name
This commit is contained in:
@@ -101,19 +101,9 @@ int set_transport(openair0_device *device) {
|
|||||||
int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, char *cfgfile, uint8_t flag) {
|
int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, char *cfgfile, uint8_t flag) {
|
||||||
|
|
||||||
void *lib_handle;
|
void *lib_handle;
|
||||||
char *OAI_RF_LIBNAME;
|
|
||||||
char *OAI_TP_LIBNAME;
|
|
||||||
oai_device_initfunc_t fp ;
|
oai_device_initfunc_t fp ;
|
||||||
|
|
||||||
if (device->host_type==BBU_HOST) {
|
if (flag == RF_DEVICE) {
|
||||||
OAI_RF_LIBNAME= "/home/guepe/openairinterface5g/cmake_targets/lte_noS1_build_oai/build/liboai_device.so";
|
|
||||||
OAI_TP_LIBNAME= "/home/guepe/openairinterface5g/cmake_targets/lte_noS1_build_oai/build/liboai_transpro.so";
|
|
||||||
} else {
|
|
||||||
OAI_RF_LIBNAME= "liboai_device.so";
|
|
||||||
OAI_TP_LIBNAME= "liboai_transpro.so";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag == RF_DEVICE) {
|
|
||||||
lib_handle = dlopen(OAI_RF_LIBNAME, RTLD_LAZY);
|
lib_handle = dlopen(OAI_RF_LIBNAME, RTLD_LAZY);
|
||||||
if (!lib_handle) {
|
if (!lib_handle) {
|
||||||
printf( "Unable to locate %s: HW device set to NONE_DEV.\n", OAI_RF_LIBNAME);
|
printf( "Unable to locate %s: HW device set to NONE_DEV.\n", OAI_RF_LIBNAME);
|
||||||
|
|||||||
@@ -332,17 +332,17 @@ int trx_usrp_reset_stats(openair0_device* device) {
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
int device_init(openair0_device* device, openair0_config_t *openair0_cfg, char *cfgfile) {
|
int device_init(openair0_device* device, openair0_config_t *openair0_cfg, char *cfgfile) {
|
||||||
|
|
||||||
uhd::set_thread_priority_safe(1.0);
|
uhd::set_thread_priority_safe(1.0);
|
||||||
usrp_state_t *s = (usrp_state_t*)malloc(sizeof(usrp_state_t));
|
usrp_state_t *s = (usrp_state_t*)malloc(sizeof(usrp_state_t));
|
||||||
memset(s, 0, sizeof(usrp_state_t));
|
memset(s, 0, sizeof(usrp_state_t));
|
||||||
|
|
||||||
// Initialize USRP device
|
// Initialize USRP device
|
||||||
|
|
||||||
std::string args = "type=b200";
|
std::string args = "type=b200";
|
||||||
|
|
||||||
|
|
||||||
uhd::device_addrs_t device_adds = uhd::device::find(args);
|
uhd::device_addrs_t device_adds = uhd::device::find(args);
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
printf("Checking for USRPs\n");
|
printf("Checking for USRPs\n");
|
||||||
|
|
||||||
@@ -358,14 +358,14 @@ extern "C" {
|
|||||||
uhd::device_addrs_t device_adds = uhd::device::find(args);
|
uhd::device_addrs_t device_adds = uhd::device::find(args);
|
||||||
|
|
||||||
if(device_adds.size() == 0)
|
if(device_adds.size() == 0)
|
||||||
{
|
{
|
||||||
std::cerr<<"No USRP Device Found. " << std::endl;
|
std::cerr<<"No USRP Device Found. " << std::endl;
|
||||||
free(s);
|
free(s);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Found USRP X300\n");
|
printf("Found USRP X300\n");
|
||||||
s->usrp = uhd::usrp::multi_usrp::make(args);
|
s->usrp = uhd::usrp::multi_usrp::make(args);
|
||||||
// s->usrp->set_rx_subdev_spec(rx_subdev);
|
// s->usrp->set_rx_subdev_spec(rx_subdev);
|
||||||
// s->usrp->set_tx_subdev_spec(tx_subdev);
|
// s->usrp->set_tx_subdev_spec(tx_subdev);
|
||||||
@@ -383,15 +383,14 @@ extern "C" {
|
|||||||
// s->usrp->set_rx_subdev_spec(rx_subdev);
|
// s->usrp->set_rx_subdev_spec(rx_subdev);
|
||||||
// s->usrp->set_tx_subdev_spec(tx_subdev);
|
// s->usrp->set_tx_subdev_spec(tx_subdev);
|
||||||
|
|
||||||
// do not explicitly set the clock to "internal", because this will disable the gpsdo
|
// do not explicitly set the clock to "internal", because this will disable the gpsdo
|
||||||
// // lock mboard clocks
|
// // lock mboard clocks
|
||||||
// s->usrp->set_clock_source("internal");
|
// s->usrp->set_clock_source("internal");
|
||||||
// set master clock rate and sample rate for tx & rx for streaming
|
// set master clock rate and sample rate for tx & rx for streaming
|
||||||
s->usrp->set_master_clock_rate(30.72e6);
|
s->usrp->set_master_clock_rate(30.72e6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(i=0;i<s->usrp->get_rx_num_channels();i++) {
|
for(i=0;i<s->usrp->get_rx_num_channels();i++) {
|
||||||
if (i<openair0_cfg[0].rx_num_channels) {
|
if (i<openair0_cfg[0].rx_num_channels) {
|
||||||
s->usrp->set_rx_rate(openair0_cfg[0].sample_rate,i);
|
s->usrp->set_rx_rate(openair0_cfg[0].sample_rate,i);
|
||||||
@@ -439,17 +438,13 @@ extern "C" {
|
|||||||
uhd::stream_args_t stream_args_tx("sc16", "sc16");
|
uhd::stream_args_t stream_args_tx("sc16", "sc16");
|
||||||
//stream_args_tx.args["spp"] = str(boost::format("%d") % 2048);//(openair0_cfg[0].tx_num_channels*openair0_cfg[0].samples_per_packet));
|
//stream_args_tx.args["spp"] = str(boost::format("%d") % 2048);//(openair0_cfg[0].tx_num_channels*openair0_cfg[0].samples_per_packet));
|
||||||
for (i = 0; i<openair0_cfg[0].tx_num_channels; i++)
|
for (i = 0; i<openair0_cfg[0].tx_num_channels; i++)
|
||||||
stream_args_tx.channels.push_back(i);
|
stream_args_tx.channels.push_back(i);
|
||||||
s->tx_stream = s->usrp->get_tx_stream(stream_args_tx);
|
s->tx_stream = s->usrp->get_tx_stream(stream_args_tx);
|
||||||
std::cout << boost::format("tx_max_num_samps %u") % (s->tx_stream->get_max_num_samps()) << std::endl;
|
std::cout << boost::format("tx_max_num_samps %u") % (s->tx_stream->get_max_num_samps()) << std::endl;
|
||||||
|
|
||||||
|
|
||||||
s->usrp->set_time_now(uhd::time_spec_t(0.0));
|
s->usrp->set_time_now(uhd::time_spec_t(0.0));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (i=0;i<openair0_cfg[0].rx_num_channels;i++) {
|
for (i=0;i<openair0_cfg[0].rx_num_channels;i++) {
|
||||||
if (i<openair0_cfg[0].rx_num_channels) {
|
if (i<openair0_cfg[0].rx_num_channels) {
|
||||||
printf("RX Channel %lu\n",i);
|
printf("RX Channel %lu\n",i);
|
||||||
@@ -462,7 +457,6 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i=0;i<openair0_cfg[0].tx_num_channels;i++) {
|
for (i=0;i<openair0_cfg[0].tx_num_channels;i++) {
|
||||||
|
|
||||||
if (i<openair0_cfg[0].tx_num_channels) {
|
if (i<openair0_cfg[0].tx_num_channels) {
|
||||||
printf("TX Channel %lu\n",i);
|
printf("TX Channel %lu\n",i);
|
||||||
std::cout << std::endl<<boost::format("Actual TX sample rate: %fMSps...") % (s->usrp->get_tx_rate(i)/1e6) << std::endl;
|
std::cout << std::endl<<boost::format("Actual TX sample rate: %fMSps...") % (s->usrp->get_tx_rate(i)/1e6) << std::endl;
|
||||||
@@ -492,35 +486,35 @@ extern "C" {
|
|||||||
// init tx_forward_nsamps based usrp_time_offset ex
|
// init tx_forward_nsamps based usrp_time_offset ex
|
||||||
/*if(is_equal(s->sample_rate, (double)30.72e6))
|
/*if(is_equal(s->sample_rate, (double)30.72e6))
|
||||||
s->tx_forward_nsamps = 176;
|
s->tx_forward_nsamps = 176;
|
||||||
if(is_equal(s->sample_rate, (double)15.36e6))
|
if(is_equal(s->sample_rate, (double)15.36e6))
|
||||||
s->tx_forward_nsamps = 90;
|
s->tx_forward_nsamps = 90;
|
||||||
if(is_equal(s->sample_rate, (double)7.68e6))
|
if(is_equal(s->sample_rate, (double)7.68e6))
|
||||||
s->tx_forward_nsamps = 50;*/
|
s->tx_forward_nsamps = 50;*/
|
||||||
/* move device specific parameters from lte-softmodem.c here */
|
/* move device specific parameters from lte-softmodem.c here */
|
||||||
if(is_equal(s->sample_rate, (double)30.72e6)) {
|
if(is_equal(s->sample_rate, (double)30.72e6)) {
|
||||||
openair0_cfg->tx_delay = 8;
|
openair0_cfg->tx_delay = 8;
|
||||||
s->tx_forward_nsamps = 175;
|
s->tx_forward_nsamps = 175;
|
||||||
openair0_cfg->tx_forward_nsamps = 175;
|
openair0_cfg->tx_forward_nsamps = 175;
|
||||||
}
|
}
|
||||||
if(is_equal(s->sample_rate, (double)15.36e6)) {
|
if(is_equal(s->sample_rate, (double)15.36e6)) {
|
||||||
openair0_cfg->tx_delay = 5;
|
openair0_cfg->tx_delay = 5;
|
||||||
s->tx_forward_nsamps = 95;
|
s->tx_forward_nsamps = 95;
|
||||||
openair0_cfg->tx_forward_nsamps = 95;
|
openair0_cfg->tx_forward_nsamps = 95;
|
||||||
}
|
}
|
||||||
if(is_equal(s->sample_rate, (double)7.68e6)) {
|
if(is_equal(s->sample_rate, (double)7.68e6)) {
|
||||||
openair0_cfg->tx_delay = 5;
|
openair0_cfg->tx_delay = 5;
|
||||||
s->tx_forward_nsamps = 70;
|
s->tx_forward_nsamps = 70;
|
||||||
openair0_cfg->tx_forward_nsamps = 70;
|
openair0_cfg->tx_forward_nsamps = 70;
|
||||||
}
|
}
|
||||||
if(is_equal(s->sample_rate, (double)1.92e6)) {
|
if(is_equal(s->sample_rate, (double)1.92e6)) {
|
||||||
openair0_cfg->tx_delay = 8;
|
openair0_cfg->tx_delay = 8;
|
||||||
s->tx_forward_nsamps = 40;
|
s->tx_forward_nsamps = 40;
|
||||||
openair0_cfg->tx_forward_nsamps = 40;
|
openair0_cfg->tx_forward_nsamps = 40;
|
||||||
}
|
}
|
||||||
openair0_cfg->iq_txshift= 5;
|
openair0_cfg->iq_txshift= 5;
|
||||||
openair0_cfg->iq_rxrescale = 15;
|
openair0_cfg->iq_rxrescale = 15;
|
||||||
printf("check params %d:%d",openair0_cfg->tx_forward_nsamps, openair0_cfg->tx_delay);
|
printf("check params %d:%d",openair0_cfg->tx_forward_nsamps, openair0_cfg->tx_delay);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user