Display channel offset with TX and RX channel frequencies on startup
This commit is contained in:
@@ -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;
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user