fix scanning of E-GSM-900

Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
Steve Markgraf 2012-10-09 21:14:51 +02:00
parent 912f946144
commit ed733cc952
2 changed files with 4 additions and 4 deletions

View file

@ -95,7 +95,7 @@ double arfcn_to_freq(int n, int *bi) {
} }
if((1 <= n) && (n <= 124)) { if((1 <= n) && (n <= 124)) {
if(bi) if(bi && (*bi != GSM_E_900))
*bi = GSM_900; *bi = GSM_900;
return 890.0e6 + 0.2e6 * n + 45.0e6; return 890.0e6 + 0.2e6 * n + 45.0e6;
} }

View file

@ -79,7 +79,7 @@ int c0_detect(usrp_source *u, int bi) {
} }
u->start(); u->start();
u->flush(); u->flush();
for(i = first_chan(bi); i > 0; i = next_chan(i, bi)) { for(i = first_chan(bi); i >= 0; i = next_chan(i, bi)) {
freq = arfcn_to_freq(i, &bi); freq = arfcn_to_freq(i, &bi);
if(!u->tune(freq)) { if(!u->tune(freq)) {
fprintf(stderr, "error: usrp_source::tune\n"); fprintf(stderr, "error: usrp_source::tune\n");
@ -111,7 +111,7 @@ int c0_detect(usrp_source *u, int bi) {
* channels when we construct the average. * channels when we construct the average.
*/ */
chan_count = 0; chan_count = 0;
for(i = first_chan(bi); i > 0; i = next_chan(i, bi)) { for(i = first_chan(bi); i >= 0; i = next_chan(i, bi)) {
spower[chan_count++] = power[i]; spower[chan_count++] = power[i];
} }
sort(spower, chan_count); sort(spower, chan_count);
@ -166,7 +166,7 @@ int c0_detect(usrp_source *u, int bi) {
i = next_chan(i, bi); i = next_chan(i, bi);
} }
} }
} while(i > 0); } while(i >= 0);
return 0; return 0;
} }