|
|
@ -540,6 +540,7 @@ void phch_recv::run_thread()
|
|
|
|
if (phy_state.is_camping()) {
|
|
|
|
if (phy_state.is_camping()) {
|
|
|
|
log_h->warning("Detected radio overflow while camping. Resynchronizing cell\n");
|
|
|
|
log_h->warning("Detected radio overflow while camping. Resynchronizing cell\n");
|
|
|
|
sfn_p.reset();
|
|
|
|
sfn_p.reset();
|
|
|
|
|
|
|
|
srslte_ue_sync_reset(&ue_sync);
|
|
|
|
phy_state.force_sfn_sync();
|
|
|
|
phy_state.force_sfn_sync();
|
|
|
|
radio_overflow_return = true;
|
|
|
|
radio_overflow_return = true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -1047,29 +1048,33 @@ phch_recv::sfn_sync::ret_code phch_recv::sfn_sync::run_subframe(srslte_cell_t *c
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int sfn_offset = 0;
|
|
|
|
int sfn_offset = 0;
|
|
|
|
Info("SYNC: Trying to decode MIB... SNR=%.1f dB\n", 10*log10(srslte_chest_dl_get_snr(&ue_mib.chest)));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int n = srslte_ue_mib_decode(&ue_mib, bch_payload, NULL, &sfn_offset);
|
|
|
|
int n = srslte_ue_mib_decode(&ue_mib, bch_payload, NULL, &sfn_offset);
|
|
|
|
if (n < 0) {
|
|
|
|
switch(n) {
|
|
|
|
|
|
|
|
default:
|
|
|
|
Error("SYNC: Error decoding MIB while synchronising SFN");
|
|
|
|
Error("SYNC: Error decoding MIB while synchronising SFN");
|
|
|
|
return ERROR;
|
|
|
|
return ERROR;
|
|
|
|
} else if (n == SRSLTE_UE_MIB_FOUND) {
|
|
|
|
case SRSLTE_UE_MIB_FOUND:
|
|
|
|
uint32_t sfn;
|
|
|
|
uint32_t sfn;
|
|
|
|
srslte_pbch_mib_unpack(bch_payload, cell, &sfn);
|
|
|
|
srslte_pbch_mib_unpack(bch_payload, cell, &sfn);
|
|
|
|
|
|
|
|
|
|
|
|
sfn = (sfn+sfn_offset)%1024;
|
|
|
|
sfn = (sfn+sfn_offset)%1024;
|
|
|
|
if (tti_cnt) {
|
|
|
|
if (tti_cnt) {
|
|
|
|
*tti_cnt = 10*sfn;
|
|
|
|
*tti_cnt = 10*sfn;
|
|
|
|
Info("SYNC: DONE, TTI=%d, sfn_offset=%d\n", *tti_cnt, sfn_offset);
|
|
|
|
Info("SYNC: DONE, SNR=%.1f dB, TTI=%d, sfn_offset=%d\n",
|
|
|
|
|
|
|
|
10*log10(srslte_chest_dl_get_snr(&ue_mib.chest)), *tti_cnt, sfn_offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
srslte_ue_sync_decode_sss_on_track(ue_sync, true);
|
|
|
|
srslte_ue_sync_decode_sss_on_track(ue_sync, true);
|
|
|
|
reset();
|
|
|
|
reset();
|
|
|
|
return SFN_FOUND;
|
|
|
|
return SFN_FOUND;
|
|
|
|
|
|
|
|
case SRSLTE_UE_MIB_NOTFOUND:
|
|
|
|
|
|
|
|
Info("SYNC: Found PSS but could not decode MIB. SNR=%.1f dB (%d/%d)\n",
|
|
|
|
|
|
|
|
10*log10(srslte_chest_dl_get_snr(&ue_mib.chest)), cnt, timeout);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Info("SYNC: PSS/SSS not found...\n");
|
|
|
|
Info("SYNC: Waiting for PSS while trying to decode MIB (%d/%d)\n", cnt, timeout);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cnt++;
|
|
|
|
cnt++;
|
|
|
|