Display channel offset with TX and RX channel frequencies on startup

This commit is contained in:
Andreas Eversberg
2017-10-12 19:43:15 +02:00
parent e67c171035
commit f7a0e4622b
12 changed files with 32 additions and 9 deletions

View File

@@ -75,6 +75,9 @@ double amps_channel2freq(int channel, int uplink)
double freq;
if (!tacs) {
if (uplink == 2)
return -45.000 * 1e6;
/* 832 channels, 990 not used, see TIA/EIA-136-110 */
if (channel < 1 || channel > 1023 || (channel > 799 && channel < 991))
return 0;
@@ -87,6 +90,9 @@ double amps_channel2freq(int channel, int uplink)
if (uplink)
freq -= 45.000;
} else if (!jtacs) {
if (uplink == 2)
return -45.000 * 1e6;
/* 600 channels */
if (channel < 1 || channel > 600)
return 0;
@@ -96,6 +102,9 @@ double amps_channel2freq(int channel, int uplink)
if (uplink)
freq -= 45.000;
} else {
if (uplink == 2)
return -55.000 * 1e6;
/* 799 channels */
if (channel < 1 || channel > 799)
return 0;

View File

@@ -397,9 +397,9 @@ int main_amps_tacs(int argc, char *argv[])
goto fail;
}
if (!tacs)
printf("Base station on channel %d ready (%s), please tune transmitter to %.3f MHz and receiver to %.3f MHz.\n", kanal[i], chan_type_long_name(chan_type[i]), amps_channel2freq(kanal[i], 0) / 1e6, amps_channel2freq(kanal[i], 1) / 1e6);
printf("Base station on channel %d ready (%s), please tune transmitter to %.3f MHz and receiver to %.3f MHz. (%.3f MHz offset)\n", kanal[i], chan_type_long_name(chan_type[i]), amps_channel2freq(kanal[i], 0) / 1e6, amps_channel2freq(kanal[i], 1) / 1e6, amps_channel2freq(kanal[i], 2) / 1e6);
else
printf("Base station on channel %d ready (%s), please tune transmitter to %.4f MHz and receiver to %.4f MHz.\n", kanal[i], chan_type_long_name(chan_type[i]), amps_channel2freq(kanal[i], 0) / 1e6, amps_channel2freq(kanal[i], 1) / 1e6);
printf("Base station on channel %d ready (%s), please tune transmitter to %.4f MHz and receiver to %.4f MHz. (%.3f MHz offset)\n", kanal[i], chan_type_long_name(chan_type[i]), amps_channel2freq(kanal[i], 0) / 1e6, amps_channel2freq(kanal[i], 1) / 1e6, amps_channel2freq(kanal[i], 2) / 1e6);
}
main_mobile(&quit, latency, interval, NULL, station_id, 10);