Attempt to reset timer regardless of N310

This commit is contained in:
Ismael Gomez 2017-11-10 18:00:05 +01:00
parent 9389cc1957
commit 9cf95f5c32
2 changed files with 12 additions and 3 deletions

View File

@ -127,6 +127,8 @@ private:
// RRC constants and timers
srslte::mac_interface_timers *mac_timers;
uint32_t sync_reset_cnt;
const static uint32_t SYNC_RESET_TIMEOUT = 10;
uint32_t n310_cnt, N310;
uint32_t n311_cnt, N311;
uint32_t t301, t310, t311;

View File

@ -48,6 +48,9 @@ rrc::rrc()
:state(RRC_STATE_IDLE)
,drb_up(false)
{
sync_reset_cnt = 0;
n310_cnt = 0;
n311_cnt = 0;
}
static void liblte_rrc_handler(void *ctx, char *str) {
@ -489,13 +492,17 @@ void rrc::earfcn_end() {
// Detection of physical layer problems (5.3.11.1)
void rrc::out_of_sync() {
// attempt resync
sync_reset_cnt++;
if (sync_reset_cnt >= SYNC_RESET_TIMEOUT) {
rrc_log->info("Detected %d out-of-sync from PHY. Resynchronizing PHY.\n", sync_reset_cnt);
phy->sync_reset();
sync_reset_cnt = 0;
}
current_cell->in_sync = false;
if (!mac_timers->timer_get(t311)->is_running() && !mac_timers->timer_get(t310)->is_running()) {
n310_cnt++;
if (n310_cnt == N310) {
// attempt resync
//phy->sync_reset();
mac_timers->timer_get(t310)->reset();
mac_timers->timer_get(t310)->run();
n310_cnt = 0;