aboutsummaryrefslogtreecommitdiffstats
path: root/src/nmt
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2017-10-12 19:43:15 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2017-10-22 19:23:06 +0200
commitf7a0e4622bed9551bb0999d3c54bb69249065d38 (patch)
treeb0f4585d3d7b013046636285783157aa993c2fd3 /src/nmt
parente67c171035807f547ae2eeb7359d7ec8d158cc2a (diff)
Display channel offset with TX and RX channel frequencies on startup
Diffstat (limited to 'src/nmt')
-rw-r--r--src/nmt/countries.c2
-rw-r--r--src/nmt/main.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/nmt/countries.c b/src/nmt/countries.c
index f2e58fd..957c563 100644
--- a/src/nmt/countries.c
+++ b/src/nmt/countries.c
@@ -254,6 +254,8 @@ double nmt_channel2freq(int nmt_system, const char *short_name, int channel, int
for (j = 0; nmt_country[i].nmt_frequency[j].first_frequency; j++) {
if (channel >= nmt_country[i].nmt_frequency[j].first_channel
&& channel <= nmt_country[i].nmt_frequency[j].last_channel) {
+ if (uplink == 2)
+ return -nmt_country[i].nmt_frequency[j].duplex_spacing * 1e6;
/* add "channel offset" * "channel spacing" to "first frequency" */
freq = nmt_country[i].nmt_frequency[j].first_frequency;
freq += (double)(channel - nmt_country[i].nmt_frequency[j].first_channel) * nmt_country[i].nmt_frequency[j].channel_spacing;
diff --git a/src/nmt/main.c b/src/nmt/main.c
index d6b5ed0..a2dcb23 100644
--- a/src/nmt/main.c
+++ b/src/nmt/main.c
@@ -410,7 +410,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Failed to create transceiver instance. Quitting!\n");
goto fail;
}
- printf("base station on channel %d ready, please tune transmitter to %.4f MHz and receiver to %.4f MHz.\n", kanal[i], nmt_channel2freq(nmt_system, country, kanal[i], 0, NULL, NULL, NULL) / 1e6, nmt_channel2freq(nmt_system, country, kanal[i], 1, NULL, NULL, NULL) / 1e6);
+ printf("base station on channel %d ready, please tune transmitter to %.4f MHz and receiver to %.4f MHz. (%.3f MHz offset)\n", kanal[i], nmt_channel2freq(nmt_system, country, kanal[i], 0, NULL, NULL, NULL) / 1e6, nmt_channel2freq(nmt_system, country, kanal[i], 1, NULL, NULL, NULL) / 1e6, nmt_channel2freq(nmt_system, country, kanal[i], 2, NULL, NULL, NULL) / 1e6);
}
nmt_check_channels(nmt_system);