|
|
@ -244,18 +244,23 @@ int srslte_ue_mib_sync_nbiot_decode(srslte_ue_mib_sync_nbiot_t* q,
|
|
|
|
uint32_t* nof_tx_ports,
|
|
|
|
uint32_t* nof_tx_ports,
|
|
|
|
int* sfn_offset)
|
|
|
|
int* sfn_offset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
int ret = SRSLTE_ERROR_INVALID_INPUTS;
|
|
|
|
|
|
|
|
uint32_t nof_frames = 0;
|
|
|
|
int mib_ret = SRSLTE_UE_MIB_NBIOT_NOTFOUND;
|
|
|
|
int mib_ret = SRSLTE_UE_MIB_NBIOT_NOTFOUND;
|
|
|
|
|
|
|
|
|
|
|
|
if (q != NULL) {
|
|
|
|
if (q == NULL) {
|
|
|
|
int ret = SRSLTE_SUCCESS;
|
|
|
|
return ret;
|
|
|
|
uint32_t nof_frames = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
mib_ret = SRSLTE_UE_MIB_NBIOT_NOTFOUND;
|
|
|
|
mib_ret = SRSLTE_UE_MIB_NBIOT_NOTFOUND;
|
|
|
|
ret = srslte_ue_sync_nbiot_zerocopy_multi(&q->ue_sync, q->sf_buffer);
|
|
|
|
ret = srslte_ue_sync_nbiot_zerocopy_multi(&q->ue_sync, q->sf_buffer);
|
|
|
|
if (ret < 0) {
|
|
|
|
if (ret < 0) {
|
|
|
|
fprintf(stderr, "Error calling srslte_ue_sync_nbiot_zerocopy_multi()\n");
|
|
|
|
fprintf(stderr, "Error calling srslte_ue_sync_nbiot_zerocopy_multi()\n");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
} else if (srslte_ue_sync_nbiot_get_sfidx(&q->ue_sync) == 0) {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (srslte_ue_sync_nbiot_get_sfidx(&q->ue_sync) == 0) {
|
|
|
|
mib_ret = srslte_ue_mib_nbiot_decode(&q->ue_mib, NULL, bch_payload, nof_tx_ports, sfn_offset);
|
|
|
|
mib_ret = srslte_ue_mib_nbiot_decode(&q->ue_mib, NULL, bch_payload, nof_tx_ports, sfn_offset);
|
|
|
|
if (mib_ret < 0) {
|
|
|
|
if (mib_ret < 0) {
|
|
|
|
DEBUG("Resetting NPBCH decoder after %d frames\n", q->ue_mib.frame_cnt);
|
|
|
|
DEBUG("Resetting NPBCH decoder after %d frames\n", q->ue_mib.frame_cnt);
|
|
|
@ -263,10 +268,7 @@ int srslte_ue_mib_sync_nbiot_decode(srslte_ue_mib_sync_nbiot_t* q,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
nof_frames++;
|
|
|
|
nof_frames++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (mib_ret == SRSLTE_UE_MIB_NBIOT_NOTFOUND && ret >= 0 && nof_frames < max_frames_timeout);
|
|
|
|
} while (mib_ret == SRSLTE_UE_MIB_NBIOT_NOTFOUND && nof_frames < max_frames_timeout);
|
|
|
|
if (mib_ret < 0) {
|
|
|
|
|
|
|
|
ret = mib_ret;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return mib_ret;
|
|
|
|
return mib_ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|