resolve errors after merging with develop / add configuration file for RRH with USRP
This commit is contained in:
@@ -51,8 +51,11 @@ int set_device(openair0_device *device) {
|
||||
case EXMIMO_DEV:
|
||||
printf("[%s] has loaded EXPRESS MIMO device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"));
|
||||
break;
|
||||
case USRP_DEV:
|
||||
printf("[%s] has loaded USRP device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"));
|
||||
case USRP_B200_DEV:
|
||||
printf("[%s] has loaded USRP B200 device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"));
|
||||
break;
|
||||
case USRP_X300_DEV:
|
||||
printf("[%s] has loaded USRP X300 device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"));
|
||||
break;
|
||||
case BLADERF_DEV:
|
||||
printf("[%s] has loaded BLADERF device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"));
|
||||
|
||||
@@ -72,17 +72,17 @@ int eth_socket_init_raw(openair0_device *device) {
|
||||
int sock_proto=0;
|
||||
|
||||
if (device->host_type == RRH_HOST ) { /* RRH doesn't know remote MAC(will be retrieved from first packet send from BBU) and remote port(don't care) */
|
||||
local_mac = device->openair0_cfg.my_addr;
|
||||
local_port = device->openair0_cfg.my_port;
|
||||
local_mac = device->openair0_cfg->my_addr;
|
||||
local_port = device->openair0_cfg->my_port;
|
||||
remote_mac = malloc(ETH_ALEN);
|
||||
memset(remote_mac,0,ETH_ALEN);
|
||||
remote_port = 0;
|
||||
printf("[%s] local MAC addr %s remote MAC addr %s\n","RRH", local_mac,remote_mac);
|
||||
} else {
|
||||
local_mac = device->openair0_cfg.my_addr;
|
||||
local_port = device->openair0_cfg.my_port;
|
||||
remote_mac = device->openair0_cfg.remote_addr;
|
||||
remote_port = device->openair0_cfg.remote_port;
|
||||
local_mac = device->openair0_cfg->my_addr;
|
||||
local_port = device->openair0_cfg->my_port;
|
||||
remote_mac = device->openair0_cfg->remote_addr;
|
||||
remote_port = device->openair0_cfg->remote_port;
|
||||
printf("[%s] local MAC addr %s remote MAC addr %s\n","BBU", local_mac,remote_mac);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ int eth_socket_init_raw(openair0_device *device) {
|
||||
local_addr[Mod_id].sll_family = AF_PACKET;
|
||||
local_addr[Mod_id].sll_ifindex = if_index[Mod_id].ifr_ifindex;
|
||||
/* hear traffic from specific protocol*/
|
||||
local_addr[Mod_id].sll_protocol = htons((short)device->openair0_cfg.my_port);
|
||||
local_addr[Mod_id].sll_protocol = htons((short)device->openair0_cfg->my_port);
|
||||
local_addr[Mod_id].sll_halen = ETH_ALEN;
|
||||
local_addr[Mod_id].sll_pkttype = PACKET_OTHERHOST;
|
||||
addr_len[Mod_id] = sizeof(struct sockaddr_ll);
|
||||
@@ -122,7 +122,7 @@ int eth_socket_init_raw(openair0_device *device) {
|
||||
/* Construct the Ethernet header */
|
||||
ether_aton_r(local_mac, (struct ether_addr *)(&(eh.ether_shost)));
|
||||
ether_aton_r(remote_mac, (struct ether_addr *)(&(eh.ether_dhost)));
|
||||
eh.ether_type = htons((short)device->openair0_cfg.my_port);
|
||||
eh.ether_type = htons((short)device->openair0_cfg->my_port);
|
||||
|
||||
printf("[%s] binding mod_%d to hardware address %x:%x:%x:%x:%x:%x\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"),Mod_id,eh.ether_shost[0],eh.ether_shost[1],eh.ether_shost[2],eh.ether_shost[3],eh.ether_shost[4],eh.ether_shost[5]);
|
||||
|
||||
|
||||
@@ -71,18 +71,18 @@ int addr_len[MAX_INST];
|
||||
int sock_type=0;
|
||||
int sock_proto=0;
|
||||
int enable=1;
|
||||
|
||||
|
||||
if (device->host_type == RRH_HOST ) {
|
||||
local_ip = device->openair0_cfg.my_addr;
|
||||
local_port = device->openair0_cfg.my_port;
|
||||
local_ip = device->openair0_cfg->my_addr;
|
||||
local_port = device->openair0_cfg->my_port;
|
||||
remote_ip = "0.0.0.0";
|
||||
remote_port = 0;
|
||||
printf("[%s] local ip addr %s port %d\n", "RRH", local_ip, local_port);
|
||||
} else {
|
||||
local_ip = device->openair0_cfg.my_addr;
|
||||
local_port = device->openair0_cfg.my_port;
|
||||
remote_ip = device->openair0_cfg.remote_addr;
|
||||
remote_port = device->openair0_cfg.remote_port;
|
||||
local_ip = device->openair0_cfg->my_addr;
|
||||
local_port = device->openair0_cfg->my_port;
|
||||
remote_ip = device->openair0_cfg->remote_addr;
|
||||
remote_port = device->openair0_cfg->remote_port;
|
||||
printf("[%s] local ip addr %s port %d\n","BBU", local_ip, local_port);
|
||||
}
|
||||
|
||||
@@ -123,22 +123,17 @@ int addr_len[MAX_INST];
|
||||
}
|
||||
|
||||
/* apply additional configuration */
|
||||
//ethernet_tune (device,MTU_SIZE,UDP_PACKET_SIZE_BYTES(device->openair0_cfg.samples_per_packet));
|
||||
//ethernet_tune (device,MTU_SIZE,UDP_PACKET_SIZE_BYTES(device->openair0_cfg->samples_per_packet));
|
||||
|
||||
/* if RRH, then I am the server, so bind */
|
||||
if (device->host_type == RRH_HOST) {
|
||||
/* want to receive -> so bind */
|
||||
if (bind(eth->sockfd[Mod_id],(struct sockaddr *)&local_addr[Mod_id],addr_len[Mod_id])<0) {
|
||||
perror("ETHERNET: Cannot bind to socket");
|
||||
exit(0);
|
||||
} else {
|
||||
printf("[%s] binding mod_%d to %s:%d\n","RRH",Mod_id,str_local,ntohs(local_addr[Mod_id].sin_port));
|
||||
}
|
||||
/* if BBU, then I am a client, so connect */
|
||||
} else {
|
||||
printf("[%s] Connecting to %s:%d\n","BBU",str_remote,ntohs(dest_addr[Mod_id].sin_port));
|
||||
}
|
||||
|
||||
|
||||
|
||||
printf("ssssssssssssssss\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -359,14 +354,14 @@ int eth_get_dev_conf_udp(openair0_device *device) {
|
||||
|
||||
/* get remote ip address and port */
|
||||
/* inet_ntop(AF_INET, &(dest_addr[Mod_id].sin_addr), str1, INET_ADDRSTRLEN); */
|
||||
/* device->openair0_cfg.remote_port =ntohs(dest_addr[Mod_id].sin_port); */
|
||||
/* device->openair0_cfg.remote_addr =str1; */
|
||||
/* device->openair0_cfg->remote_port =ntohs(dest_addr[Mod_id].sin_port); */
|
||||
/* device->openair0_cfg->remote_addr =str1; */
|
||||
|
||||
/* /\* restore local ip address and port *\/ */
|
||||
/* inet_ntop(AF_INET, &(local_addr[Mod_id].sin_addr), str, INET_ADDRSTRLEN); */
|
||||
/* device->openair0_cfg.my_port =ntohs(local_addr[Mod_id].sin_port); */
|
||||
/* device->openair0_cfg.my_addr =str; */
|
||||
/* device->openair0_cfg->my_port =ntohs(local_addr[Mod_id].sin_port); */
|
||||
/* device->openair0_cfg->my_addr =str; */
|
||||
|
||||
/* printf("[RRH] mod_%d socket %d connected to BBU %s:%d %s:%d\n", Mod_id, eth->sockfd[Mod_id],str1, device->openair0_cfg.remote_port, str, device->openair0_cfg.my_port); */
|
||||
/* printf("[RRH] mod_%d socket %d connected to BBU %s:%d %s:%d\n", Mod_id, eth->sockfd[Mod_id],str1, device->openair0_cfg->remote_port, str, device->openair0_cfg->my_port); */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ int trx_eth_start(openair0_device *device) {
|
||||
if(eth_get_dev_conf_raw(device)!=0) return -1;
|
||||
}
|
||||
/* adjust MTU wrt number of samples per packet */
|
||||
if(ethernet_tune (device,MTU_SIZE,RAW_PACKET_SIZE_BYTES(device->openair0_cfg.samples_per_packet))!=0) return -1;
|
||||
if(ethernet_tune (device,MTU_SIZE,RAW_PACKET_SIZE_BYTES(device->openair0_cfg->samples_per_packet))!=0) return -1;
|
||||
} else {
|
||||
if (eth_socket_init_udp(device)!=0) return -1;
|
||||
/* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
|
||||
@@ -82,7 +82,7 @@ int trx_eth_start(openair0_device *device) {
|
||||
if(eth_get_dev_conf_udp(device)!=0) return -1;
|
||||
}
|
||||
/* adjust MTU wrt number of samples per packet */
|
||||
if(ethernet_tune (device,MTU_SIZE,UDP_PACKET_SIZE_BYTES(device->openair0_cfg.samples_per_packet))!=0) return -1;
|
||||
if(ethernet_tune (device,MTU_SIZE,UDP_PACKET_SIZE_BYTES(device->openair0_cfg->samples_per_packet))!=0) return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -93,7 +93,7 @@ void trx_eth_end(openair0_device *device) {
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
int Mod_id = device->Mod_id;
|
||||
/*destroys socket only for the processes that call the eth_end fuction-- shutdown() for beaking the pipe */
|
||||
/* destroys socket only for the processes that call the eth_end fuction-- shutdown() for beaking the pipe */
|
||||
if ( close(eth->sockfd[Mod_id]) <0 ) {
|
||||
perror("ETHERNET: Failed to close socket");
|
||||
exit(0);
|
||||
@@ -177,7 +177,7 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) {
|
||||
if (1==0) {
|
||||
/***************** get working interface name ***************************/
|
||||
/* convert ascii ip address from config file to network binary format */
|
||||
inet_aton(device->openair0_cfg.my_addr, &ia);
|
||||
inet_aton(device->openair0_cfg->my_addr, &ia);
|
||||
/* look for the interface used, we have its ip address get info on all our network interfaces*/
|
||||
ids = if_nameindex();
|
||||
/* loop on these network interfaces */
|
||||
@@ -201,7 +201,7 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) {
|
||||
}
|
||||
if_freenameindex(ids);
|
||||
if( if_name == NULL) {
|
||||
printf("Unable to find interface name for %s\n",device->openair0_cfg.my_addr);
|
||||
printf("Unable to find interface name for %s\n",device->openair0_cfg->my_addr);
|
||||
return -1;
|
||||
}
|
||||
eth->if_name[Mod_id]=if_name;
|
||||
@@ -339,12 +339,9 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, cha
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)malloc(sizeof(eth_state_t));
|
||||
memset(eth, 0, sizeof(eth_state_t));
|
||||
int card = 0;
|
||||
|
||||
/*hardcoded!!!!*/
|
||||
eth->flags = ETH_RAW_MODE;
|
||||
eth->buffer_size = (unsigned int)openair0_cfg[card].samples_per_packet*sizeof(int32_t);
|
||||
|
||||
|
||||
printf("[ETHERNET]: Initializing openair0_device for %s ...\n", ((device->host_type == BBU_HOST) ? "BBU": "RRH"));
|
||||
device->Mod_id = num_devices_eth++;
|
||||
device->transp_type = ETHERNET_TP;
|
||||
@@ -370,7 +367,7 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, cha
|
||||
device->priv = eth;
|
||||
openair0_cfg->iq_txshift = 5;
|
||||
openair0_cfg->iq_rxrescale = 15;
|
||||
memcpy((void*)&device->openair0_cfg,(void*)openair0_cfg,sizeof(openair0_config_t));
|
||||
memcpy((void*)device->openair0_cfg,(void*)openair0_cfg,sizeof(openair0_config_t));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -407,14 +404,14 @@ void dump_dev(openair0_device *device) {
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
|
||||
printf("Ethernet device interface %i configuration:\n" ,device->openair0_cfg.Mod_id);
|
||||
printf(" Log level is %i :\n" ,device->openair0_cfg.log_level);
|
||||
printf("Ethernet device interface %i configuration:\n" ,device->openair0_cfg->Mod_id);
|
||||
printf(" Log level is %i :\n" ,device->openair0_cfg->log_level);
|
||||
printf(" RB number: %i, sample rate: %lf \n" ,
|
||||
device->openair0_cfg.num_rb_dl, device->openair0_cfg.sample_rate);
|
||||
printf(" Delay: %i, Forward samples: %u \n" ,
|
||||
device->openair0_cfg.tx_delay, device->openair0_cfg.tx_forward_nsamps);
|
||||
device->openair0_cfg->num_rb_dl, device->openair0_cfg->sample_rate);
|
||||
printf(" Scheduling_advance: %i, Sample_advance: %u \n" ,
|
||||
device->openair0_cfg->tx_scheduling_advance, device->openair0_cfg->tx_sample_advance);
|
||||
printf(" BBU configured for %i tx/%i rx channels)\n",
|
||||
device->openair0_cfg.tx_num_channels,device->openair0_cfg.rx_num_channels);
|
||||
device->openair0_cfg->tx_num_channels,device->openair0_cfg->rx_num_channels);
|
||||
printf(" Running flags: %s %s %s\n",
|
||||
((eth->flags & ETH_RAW_MODE) ? "RAW socket mode - ":""),
|
||||
((eth->flags & ETH_UDP_MODE) ? "UDP socket mode - ":""),
|
||||
@@ -425,14 +422,14 @@ void dump_dev(openair0_device *device) {
|
||||
|
||||
void inline dump_txcounters(openair0_device *device) {
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
printf(" Ethernet device interface %i, tx counters:\n" ,device->openair0_cfg.Mod_id);
|
||||
printf(" Ethernet device interface %i, tx counters:\n" ,device->openair0_cfg->Mod_id);
|
||||
printf(" Sent packets: %llu send errors: %i\n", eth->tx_count, eth->num_tx_errors);
|
||||
}
|
||||
|
||||
void inline dump_rxcounters(openair0_device *device) {
|
||||
|
||||
eth_state_t *eth = (eth_state_t*)device->priv;
|
||||
printf(" Ethernet device interface %i rx counters:\n" ,device->openair0_cfg.Mod_id);
|
||||
printf(" Ethernet device interface %i rx counters:\n" ,device->openair0_cfg->Mod_id);
|
||||
printf(" Received packets: %llu missed packets errors: %i\n", eth->rx_count, eth->num_underflows);
|
||||
}
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
||||
#endif
|
||||
|
||||
|
||||
if (device->type == USRP_B200_IF) {
|
||||
if (device->type == USRP_B200_DEV) {
|
||||
if (cc>1) {
|
||||
// receive multiple channels (e.g. RF A and RF B)
|
||||
std::vector<void *> buff_ptrs;
|
||||
@@ -198,7 +198,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} else if (device->type == USRP_X300_IF) {
|
||||
} else if (device->type == USRP_X300_DEV) {
|
||||
if (cc>1) {
|
||||
// receive multiple channels (e.g. RF A and RF B)
|
||||
std::vector<void *> buff_ptrs;
|
||||
@@ -395,15 +395,9 @@ extern "C" {
|
||||
|
||||
// Initialize USRP device
|
||||
|
||||
<<<<<<< HEAD
|
||||
std::string args = "type=b200";
|
||||
|
||||
std::string args = "type=b200";
|
||||
|
||||
|
||||
uhd::device_addrs_t device_adds = uhd::device::find(args);
|
||||
size_t i;
|
||||
|
||||
printf("Checking for USRPs\n");
|
||||
=======
|
||||
uhd::device_addrs_t device_adds = uhd::device::find(args);
|
||||
size_t i;
|
||||
|
||||
@@ -413,29 +407,19 @@ extern "C" {
|
||||
sscanf(uhd::get_version_string().c_str(),"%d.%d.%d",&vers,&subvers,&subsubvers);
|
||||
|
||||
printf("Checking for USRPs : UHD %s (%d.%d.%d)\n",uhd::get_version_string().c_str(),vers,subvers,subsubvers);
|
||||
>>>>>>> acd607fa359709ba16a83437f483c230cee1d9b0
|
||||
|
||||
if(device_adds.size() == 0)
|
||||
{
|
||||
double usrp_master_clock = 184.32e6;
|
||||
|
||||
|
||||
std::string args = "type=x300";
|
||||
|
||||
// workaround for an api problem, master clock has to be set with the constructor not via set_master_clock_rate
|
||||
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
|
||||
|
||||
uhd::device_addrs_t device_adds = uhd::device::find(args);
|
||||
|
||||
|
||||
if(device_adds.size() == 0)
|
||||
<<<<<<< HEAD
|
||||
{
|
||||
std::cerr<<"No USRP Device Found. " << std::endl;
|
||||
free(s);
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
=======
|
||||
{
|
||||
std::cerr<<"No USRP Device Found. " << std::endl;
|
||||
free(s);
|
||||
@@ -444,17 +428,16 @@ extern "C" {
|
||||
}
|
||||
|
||||
|
||||
>>>>>>> acd607fa359709ba16a83437f483c230cee1d9b0
|
||||
printf("Found USRP X300\n");
|
||||
s->usrp = uhd::usrp::multi_usrp::make(args);
|
||||
// s->usrp->set_rx_subdev_spec(rx_subdev);
|
||||
// s->usrp->set_tx_subdev_spec(tx_subdev);
|
||||
|
||||
|
||||
// lock mboard clocks
|
||||
s->usrp->set_clock_source("internal");
|
||||
|
||||
//Setting device type to USRP X300/X310
|
||||
device->type=USRP_X300_IF;
|
||||
device->type=USRP_X300_DEV;
|
||||
|
||||
// this is not working yet, master clock has to be set via constructor
|
||||
// set master clock rate and sample rate for tx & rx for streaming
|
||||
@@ -511,11 +494,8 @@ extern "C" {
|
||||
// s->usrp->set_clock_source("internal");
|
||||
// set master clock rate and sample rate for tx & rx for streaming
|
||||
|
||||
device->type = USRP_B200_IF;
|
||||
device->type = USRP_B200_DEV;
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
|
||||
if ((vers == 3) && (subvers == 9) && (subsubvers>=2)) {
|
||||
openair0_cfg[0].rx_gain_calib_table = calib_table_b210;
|
||||
@@ -574,20 +554,14 @@ extern "C" {
|
||||
}
|
||||
}
|
||||
|
||||
>>>>>>> acd607fa359709ba16a83437f483c230cee1d9b0
|
||||
for(i=0;i<s->usrp->get_rx_num_channels();i++) {
|
||||
if (i<openair0_cfg[0].rx_num_channels) {
|
||||
s->usrp->set_rx_rate(openair0_cfg[0].sample_rate,i);
|
||||
s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i);
|
||||
printf("Setting rx freq/gain on channel %lu/%lu : BW %f (readback %f)\n",i,s->usrp->get_rx_num_channels(),openair0_cfg[0].rx_bw/1e6,s->usrp->get_rx_bandwidth(i)/1e6);
|
||||
s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[i],i);
|
||||
<<<<<<< HEAD
|
||||
set_rx_gain_offset(&openair0_cfg[0],i);
|
||||
|
||||
=======
|
||||
set_rx_gain_offset(&openair0_cfg[0],i,bw_gain_adjust);
|
||||
|
||||
>>>>>>> acd607fa359709ba16a83437f483c230cee1d9b0
|
||||
::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(i);
|
||||
// limit to maximum gain
|
||||
if (openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i] > gain_range.stop()) {
|
||||
@@ -610,11 +584,11 @@ extern "C" {
|
||||
s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[i],i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// display USRP settings
|
||||
std::cout << boost::format("Actual master clock: %fMHz...") % (s->usrp->get_master_clock_rate()/1e6) << std::endl;
|
||||
|
||||
|
||||
// create tx & rx streamer
|
||||
uhd::stream_args_t stream_args_rx("sc16", "sc16");
|
||||
//stream_args_rx.args["spp"] = str(boost::format("%d") % 2048);//(openair0_cfg[0].rx_num_channels*openair0_cfg[0].samples_per_packet));
|
||||
@@ -623,17 +597,18 @@ extern "C" {
|
||||
s->rx_stream = s->usrp->get_rx_stream(stream_args_rx);
|
||||
std::cout << boost::format("rx_max_num_samps %u") % (s->rx_stream->get_max_num_samps()) << std::endl;
|
||||
//openair0_cfg[0].samples_per_packet = s->rx_stream->get_max_num_samps();
|
||||
|
||||
|
||||
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));
|
||||
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);
|
||||
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));
|
||||
|
||||
|
||||
|
||||
for (i=0;i<openair0_cfg[0].rx_num_channels;i++) {
|
||||
if (i<openair0_cfg[0].rx_num_channels) {
|
||||
printf("RX Channel %lu\n",i);
|
||||
@@ -644,8 +619,9 @@ extern "C" {
|
||||
std::cout << boost::format("Actual RX antenna: %s...") % (s->usrp->get_rx_antenna(i)) << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i=0;i<openair0_cfg[0].tx_num_channels;i++) {
|
||||
|
||||
if (i<openair0_cfg[0].tx_num_channels) {
|
||||
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;
|
||||
@@ -655,11 +631,10 @@ extern "C" {
|
||||
std::cout << boost::format("Actual TX antenna: %s...") % (s->usrp->get_tx_antenna(i)) << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::cout << boost::format("Device timestamp: %f...") % (s->usrp->get_time_now().get_real_secs()) << std::endl;
|
||||
|
||||
device->priv = s;
|
||||
device->type = USRP_DEV;
|
||||
device->trx_start_func = trx_usrp_start;
|
||||
device->trx_write_func = trx_usrp_write;
|
||||
device->trx_read_func = trx_usrp_read;
|
||||
@@ -673,37 +648,12 @@ extern "C" {
|
||||
s->sample_rate = openair0_cfg[0].sample_rate;
|
||||
// TODO:
|
||||
// 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;
|
||||
if(is_equal(s->sample_rate, (double)15.36e6))
|
||||
if(is_equal(s->sample_rate, (double)15.36e6))
|
||||
s->tx_forward_nsamps = 90;
|
||||
if(is_equal(s->sample_rate, (double)7.68e6))
|
||||
s->tx_forward_nsamps = 50;*/
|
||||
/* move device specific parameters from lte-softmodem.c here */
|
||||
if(is_equal(s->sample_rate, (double)30.72e6)) {
|
||||
openair0_cfg->tx_delay = 8;
|
||||
s->tx_forward_nsamps = 175;
|
||||
openair0_cfg->tx_forward_nsamps = 175;
|
||||
}
|
||||
if(is_equal(s->sample_rate, (double)15.36e6)) {
|
||||
openair0_cfg->tx_delay = 5;
|
||||
s->tx_forward_nsamps = 95;
|
||||
openair0_cfg->tx_forward_nsamps = 95;
|
||||
}
|
||||
if(is_equal(s->sample_rate, (double)7.68e6)) {
|
||||
openair0_cfg->tx_delay = 5;
|
||||
s->tx_forward_nsamps = 70;
|
||||
openair0_cfg->tx_forward_nsamps = 70;
|
||||
}
|
||||
if(is_equal(s->sample_rate, (double)1.92e6)) {
|
||||
openair0_cfg->tx_delay = 8;
|
||||
s->tx_forward_nsamps = 40;
|
||||
openair0_cfg->tx_forward_nsamps = 40;
|
||||
}
|
||||
openair0_cfg->iq_txshift= 5;
|
||||
openair0_cfg->iq_rxrescale = 15;
|
||||
printf("check params %d:%d",openair0_cfg->tx_forward_nsamps, openair0_cfg->tx_delay);
|
||||
|
||||
s->tx_forward_nsamps = 50;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user