Check maximum EARFCN

This commit is contained in:
Ismael Gomez 2017-01-26 00:35:02 +01:00
parent 5615df0fee
commit 9cbaad2c3a
1 changed files with 7 additions and 1 deletions

View File

@ -439,6 +439,9 @@ int srslte_band_get_band(uint32_t earfcn) {
}
float srslte_band_fd(uint32_t earfcn) {
if (earfcn > lte_bands[SRSLTE_NOF_LTE_BANDS-1].earfcn_max) {
return -1;
}
uint32_t i = SRSLTE_NOF_LTE_BANDS-1;
while(i > 0 && lte_bands[i].earfcn_offset>earfcn) {
i--;
@ -448,6 +451,9 @@ float srslte_band_fd(uint32_t earfcn) {
float srslte_band_fu(uint32_t earfcn) {
if (earfcn > lte_bands[SRSLTE_NOF_LTE_BANDS-1].earfcn_max) {
return -1;
}
uint32_t i = SRSLTE_NOF_LTE_BANDS-1;
while(i > 0 && lte_bands[i].earfcn_offset>earfcn) {
i--;