|
|
|
@ -63,6 +63,8 @@ double callback_set_rx_gain(void *h, double gain) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
phch_recv::phch_recv() {
|
|
|
|
|
dl_freq = -1;
|
|
|
|
|
ul_freq = -1;
|
|
|
|
|
bzero(&cell, sizeof(srslte_cell_t));
|
|
|
|
|
running = false;
|
|
|
|
|
}
|
|
|
|
@ -445,6 +447,11 @@ void phch_recv::set_earfcn(std::vector<uint32_t> earfcn) {
|
|
|
|
|
this->earfcn = earfcn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void phch_recv::force_freq(float dl_freq, float ul_freq) {
|
|
|
|
|
this->dl_freq = dl_freq;
|
|
|
|
|
this->ul_freq = ul_freq;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool phch_recv::stop_sync() {
|
|
|
|
|
|
|
|
|
|
wait_radio_reset();
|
|
|
|
@ -568,17 +575,25 @@ bool phch_recv::cell_select(uint32_t earfcn, srslte_cell_t cell) {
|
|
|
|
|
|
|
|
|
|
bool phch_recv::set_frequency()
|
|
|
|
|
{
|
|
|
|
|
double dl_freq = 1e6*srslte_band_fd(current_earfcn);
|
|
|
|
|
double ul_freq = 1e6*srslte_band_fu(srslte_band_ul_earfcn(current_earfcn));
|
|
|
|
|
if (dl_freq > 0 && ul_freq > 0) {
|
|
|
|
|
double set_dl_freq = 0;
|
|
|
|
|
double set_ul_freq = 0;
|
|
|
|
|
|
|
|
|
|
if (this->dl_freq > 0 && this->ul_freq > 0) {
|
|
|
|
|
set_dl_freq = this->dl_freq;
|
|
|
|
|
set_ul_freq = this->ul_freq;
|
|
|
|
|
} else {
|
|
|
|
|
set_dl_freq = 1e6*srslte_band_fd(current_earfcn);
|
|
|
|
|
set_ul_freq = 1e6*srslte_band_fu(srslte_band_ul_earfcn(current_earfcn));
|
|
|
|
|
}
|
|
|
|
|
if (set_dl_freq > 0 && set_ul_freq > 0) {
|
|
|
|
|
log_h->info("SYNC: Set DL EARFCN=%d, f_dl=%.1f MHz, f_ul=%.1f MHz\n",
|
|
|
|
|
current_earfcn, dl_freq / 1e6, ul_freq / 1e6);
|
|
|
|
|
current_earfcn, set_dl_freq / 1e6, set_ul_freq / 1e6);
|
|
|
|
|
|
|
|
|
|
log_h->console("Searching cell in DL EARFCN=%d, f_dl=%.1f MHz, f_ul=%.1f MHz\n",
|
|
|
|
|
current_earfcn, dl_freq / 1e6, ul_freq / 1e6);
|
|
|
|
|
current_earfcn, set_dl_freq / 1e6, set_ul_freq / 1e6);
|
|
|
|
|
|
|
|
|
|
radio_h->set_rx_freq(dl_freq);
|
|
|
|
|
radio_h->set_tx_freq(ul_freq);
|
|
|
|
|
radio_h->set_rx_freq(set_dl_freq);
|
|
|
|
|
radio_h->set_tx_freq(set_ul_freq);
|
|
|
|
|
ul_dl_factor = radio_h->get_tx_freq()/radio_h->get_rx_freq();
|
|
|
|
|
|
|
|
|
|
srslte_ue_sync_reset(&ue_sync);
|
|
|
|
|