aboutsummaryrefslogtreecommitdiffstats
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
parente67c171035807f547ae2eeb7359d7ec8d158cc2a (diff)
Display channel offset with TX and RX channel frequencies on startup
-rw-r--r--src/amps/amps.c9
-rw-r--r--src/amps/amps_tacs_main.c4
-rw-r--r--src/anetz/anetz.c3
-rw-r--r--src/anetz/main.c2
-rw-r--r--src/bnetz/bnetz.c3
-rw-r--r--src/bnetz/main.c2
-rw-r--r--src/cnetz/cnetz.c5
-rw-r--r--src/cnetz/main.c4
-rw-r--r--src/nmt/countries.c2
-rw-r--r--src/nmt/main.c2
-rw-r--r--src/r2000/main.c2
-rw-r--r--src/r2000/r2000.c3
12 files changed, 32 insertions, 9 deletions
diff --git a/src/amps/amps.c b/src/amps/amps.c
index e6f5bbd..3bc22b6 100644
--- a/src/amps/amps.c
+++ b/src/amps/amps.c
@@ -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;
diff --git a/src/amps/amps_tacs_main.c b/src/amps/amps_tacs_main.c
index 3065e7d..cd65a98 100644
--- a/src/amps/amps_tacs_main.c
+++ b/src/amps/amps_tacs_main.c
@@ -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);
diff --git a/src/anetz/anetz.c b/src/anetz/anetz.c
index e19c47a..1d58efe 100644
--- a/src/anetz/anetz.c
+++ b/src/anetz/anetz.c
@@ -91,6 +91,9 @@ double anetz_kanal2freq(int kanal, int unterband)
{
double freq = 162.050;
+ if (unterband == 2)
+ return -4.500 * 1e6;
+
freq += (kanal - 30) * 0.050;
if (kanal >= 45)
freq += 6.800;
diff --git a/src/anetz/main.c b/src/anetz/main.c
index ac20232..e144f8a 100644
--- a/src/anetz/main.c
+++ b/src/anetz/main.c
@@ -184,7 +184,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
goto fail;
}
- printf("Base station on channel %d ready, please tune transmitter to %.3f MHz and receiver to %.3f MHz.\n", kanal[i], anetz_kanal2freq(kanal[i], 0) / 1e6, anetz_kanal2freq(kanal[i], 1) / 1e6);
+ printf("Base station on channel %d ready, please tune transmitter to %.3f MHz and receiver to %.3f MHz. (%.3f MHz offset)\n", kanal[i], anetz_kanal2freq(kanal[i], 0) / 1e6, anetz_kanal2freq(kanal[i], 1) / 1e6, anetz_kanal2freq(kanal[i], 2) / 1e6);
}
main_mobile(&quit, latency, interval, NULL, station_id, 5);
diff --git a/src/bnetz/bnetz.c b/src/bnetz/bnetz.c
index fc09893..a1ff011 100644
--- a/src/bnetz/bnetz.c
+++ b/src/bnetz/bnetz.c
@@ -118,6 +118,9 @@ double bnetz_kanal2freq(int kanal, int unterband)
{
double freq = 153.010;
+ if (unterband == 2)
+ return -4.600 * 1e6;
+
if (kanal >= 50)
freq += 9.200 - 0.020 * 49;
freq += (kanal - 1) * 0.020;
diff --git a/src/bnetz/main.c b/src/bnetz/main.c
index 9b7cf44..04466b3 100644
--- a/src/bnetz/main.c
+++ b/src/bnetz/main.c
@@ -199,7 +199,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
goto fail;
}
- printf("Base station for channel %d ready, please tune transmitter to %.3f MHz and receiver " "to %.3f MHz.\n", kanal[i], bnetz_kanal2freq(kanal[i], 0) / 1e6, bnetz_kanal2freq(kanal[i], 1) / 1e6);
+ printf("Base station for channel %d ready, please tune transmitter to %.3f MHz and receiver " "to %.3f MHz. (%.3f MHz offset)\n", kanal[i], bnetz_kanal2freq(kanal[i], 0) / 1e6, bnetz_kanal2freq(kanal[i], 1) / 1e6, bnetz_kanal2freq(kanal[i], 2) / 1e6);
printf("To call phone, switch transmitter (using paging signal) to %.3f MHz.\n", bnetz_kanal2freq(19, 0) / 1e6);
}
diff --git a/src/cnetz/cnetz.c b/src/cnetz/cnetz.c
index 431e503..856d6ce 100644
--- a/src/cnetz/cnetz.c
+++ b/src/cnetz/cnetz.c
@@ -168,12 +168,15 @@ double cnetz_kanal2freq(int kanal, int unterband)
{
double freq = 465.750;
+ if (unterband == 2)
+ return -10.000 * 1e6;
+
if ((kanal & 1))
freq -= (double)(kanal + 1) / 2.0 * 0.010;
else
freq -= (double)kanal / 2.0 * 0.0125;
if (unterband)
- freq -= 10.0;
+ freq -= 10.000;
return freq * 1e6;
}
diff --git a/src/cnetz/main.c b/src/cnetz/main.c
index af1eaac..7a3f792 100644
--- a/src/cnetz/main.c
+++ b/src/cnetz/main.c
@@ -566,9 +566,9 @@ int main(int argc, char *argv[])
goto fail;
}
if ((kanal[i] & 1)) {
- printf("Base station on channel %d ready, please tune transmitter to %.3f MHz and receiver to %.3f MHz.\n", kanal[i], cnetz_kanal2freq(kanal[i], 0) / 1e6, cnetz_kanal2freq(kanal[i], 1) / 1e6);
+ printf("Base station on channel %d ready, please tune transmitter to %.3f MHz and receiver to %.3f MHz. (%.3f MHz offset)\n", kanal[i], cnetz_kanal2freq(kanal[i], 0) / 1e6, cnetz_kanal2freq(kanal[i], 1) / 1e6, cnetz_kanal2freq(kanal[i], 2) / 1e6);
} else {
- printf("Base station on channel %d ready, please tune transmitter to %.4f MHz and receiver to %.4f MHz.\n", kanal[i], cnetz_kanal2freq(kanal[i], 0) / 1e6, cnetz_kanal2freq(kanal[i], 1) / 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], cnetz_kanal2freq(kanal[i], 0) / 1e6, cnetz_kanal2freq(kanal[i], 1) / 1e6, cnetz_kanal2freq(kanal[i], 2) / 1e6);
}
}
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);
diff --git a/src/r2000/main.c b/src/r2000/main.c
index 684e893..422b4c1 100644
--- a/src/r2000/main.c
+++ b/src/r2000/main.c
@@ -381,7 +381,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], r2000_channel2freq(band, kanal[i], 0) / 1e6, r2000_channel2freq(band, kanal[i], 1) / 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], r2000_channel2freq(band, kanal[i], 0) / 1e6, r2000_channel2freq(band, kanal[i], 1) / 1e6, r2000_channel2freq(band, kanal[i], 2) / 1e6);
nconv = (nconv + 1) & 7;
}
diff --git a/src/r2000/r2000.c b/src/r2000/r2000.c
index 53ff4ae..8d14775 100644
--- a/src/r2000/r2000.c
+++ b/src/r2000/r2000.c
@@ -114,6 +114,9 @@ double r2000_channel2freq(int band, int channel, int uplink)
return 0.0;
}
+ if (uplink == 2)
+ return -r2000_bands[i].duplex * 1e6;
+
freq = r2000_bands[i].dl_f0 + CHANNEL_SPACING * (double)(channel);
if (uplink)
freq -= r2000_bands[i].duplex;