Changed command line options
* All lower case options define common options * All upper case options define network specific options
This commit is contained in:
parent
f911717aa4
commit
b1c452cf12
|
@ -201,7 +201,7 @@ Tune the transmitter to 162.050 MHz and the receiver to 157.550 MHz.
|
||||||
You should tune the receiver to 164.050 MHz first, to check if you hear the idle signal from the base station.
|
You should tune the receiver to 164.050 MHz first, to check if you hear the idle signal from the base station.
|
||||||
Then tune to actually up-link frequency 157.550 MHz.
|
Then tune to actually up-link frequency 157.550 MHz.
|
||||||
The actual level is not yet relevant.
|
The actual level is not yet relevant.
|
||||||
(You may check the quality using '-L 2' command line option and build a radio loop by tuning the receiver to the transmitter.)
|
(You may check the quality using '-l 2' or '--loopback' command line option and build a radio loop by tuning the receiver to the transmitter.)
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
@ -254,7 +254,7 @@ Be sure that the phone turns off the transmitter and indicates the (green) light
|
||||||
<p>
|
<p>
|
||||||
Level adjustment:
|
Level adjustment:
|
||||||
We see a receive level of around 140%.
|
We see a receive level of around 140%.
|
||||||
Then start the base station using '-L 2' option for loop-back and tune receiver to the transmitter.
|
Then start the base station using '-l 2' option for loop-back and tune receiver to the transmitter.
|
||||||
The base station generates a 1750 Hz test signal, just like the mobile phone.
|
The base station generates a 1750 Hz test signal, just like the mobile phone.
|
||||||
Use the variable resistor (connecting your transmitter) to adjust the volume until the received level matches the same level of your previously received signal.
|
Use the variable resistor (connecting your transmitter) to adjust the volume until the received level matches the same level of your previously received signal.
|
||||||
In my case I adjust the transmitter to match around 140%. (+- 10% is good)
|
In my case I adjust the transmitter to match around 140%. (+- 10% is good)
|
||||||
|
|
|
@ -86,7 +86,7 @@ Setup of a base station
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
# amps -k 334 -F yes -E -e
|
# amps -k 334 -F yes -p -d
|
||||||
...
|
...
|
||||||
Selected System ID (SID) 40 belongs to:
|
Selected System ID (SID) 40 belongs to:
|
||||||
Salinas, CA (GTE Mobile)
|
Salinas, CA (GTE Mobile)
|
||||||
|
@ -110,7 +110,7 @@ frame.c:3658 info : RX Level: 52% Quality: 60% Polarity: NEGATIVE
|
||||||
You should tune the receiver to 880.020 first, to check if you can hear and decode the idle signal from the base station.
|
You should tune the receiver to 880.020 first, to check if you can hear and decode the idle signal from the base station.
|
||||||
Then tune to actually uplink frequency 835.020 MHz.
|
Then tune to actually uplink frequency 835.020 MHz.
|
||||||
The actual level is not yet relevant.
|
The actual level is not yet relevant.
|
||||||
(You may check the quality using '-L 2' command line option and build a radio loop by tuning the receiver to the transmitter.)
|
(You may check the quality using '-l 2' or '--loopback 2' command line option and build a radio loop by tuning the receiver to the transmitter.)
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
|
@ -121,6 +121,7 @@ All digit starts with sync pattern ("0 1 1 1 0").
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|0 1 1 1 0|0 1 0 0 0|1|0 0 0 1 0| Funkwahl ohne Gebührenübermittlung
|
|0 1 1 1 0|0 1 0 0 0|1|0 0 0 1 0| Funkwahl ohne Gebührenübermittlung
|
||||||
|0 1 1 1 0|0 0 1 0 0|1|0 0 1 0 0| Funkwahl mit Gebührenübermittlung
|
|0 1 1 1 0|0 0 1 0 0|1|0 0 1 0 0| Funkwahl mit Gebührenübermittlung
|
||||||
|
|0 1 1 1 0|0 0 0 1 0|1|0 1 0 0 0| Funkwahl mit Gebührenübermittlung (Payphone)
|
||||||
|0 1 1 1 0|1 0 0 0 0|1|0 0 0 0 1| Funkwahlende
|
|0 1 1 1 0|1 0 0 0 0|1|0 0 0 0 1| Funkwahlende
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
|
||||||
|
@ -514,7 +515,7 @@ But you get a busy signal, that means there is no channel.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Now run your base station on channel 1.
|
Now run your base station on channel 1.
|
||||||
You may add '-g x' or '--gfs x' command line option to change the station ID from default to any value you like. (see help)
|
You may add '-G x' or '--gfs x' command line option to change the station ID from default to any value you like. (see help)
|
||||||
If you have a phone that supports GFS 19, please use this GFS 19 to reduce the transmit power of the phone to 100 mW instead of 15 Watts.
|
If you have a phone that supports GFS 19, please use this GFS 19 to reduce the transmit power of the phone to 100 mW instead of 15 Watts.
|
||||||
To see if your phone supports it, try to preselect GFS 19.
|
To see if your phone supports it, try to preselect GFS 19.
|
||||||
Tune the transmitter to 153.010 MHz and the receiver to 148.410 MHz.
|
Tune the transmitter to 153.010 MHz and the receiver to 148.410 MHz.
|
||||||
|
@ -698,7 +699,7 @@ Detecting loss of carrier signal:
|
||||||
We do not have any RSSI (Received Signal Strength Indicator) signal from our radio, so we cannot directly find out if the signal is lost.
|
We do not have any RSSI (Received Signal Strength Indicator) signal from our radio, so we cannot directly find out if the signal is lost.
|
||||||
But we have a constant noise level when the signal is lost.
|
But we have a constant noise level when the signal is lost.
|
||||||
Be sure to have squelch on your receiver all the way open, so that noise reaches the base station.
|
Be sure to have squelch on your receiver all the way open, so that noise reaches the base station.
|
||||||
In order to see this level, use command line option '-0 100 -D 0' or '--loss 100 --debug 0'.
|
In order to see this level, use command line option '-L 100 -v 0' or '--loss 100 --verbose 0'.
|
||||||
The noise level (relative to the sound card's input level) is shown:
|
The noise level (relative to the sound card's input level) is shown:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -710,8 +711,8 @@ loss.c:74 debug : Noise level = 22%
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Since we have a noise level of about 20%, we can use a threshold of 10%.
|
Since we have a noise level of about 20%, we can use a threshold of 10%.
|
||||||
Use command line option '-0 10' in this case.
|
Use command line option '-L 10' in this case.
|
||||||
To see the process, keep debugging on by using command line option '-D 0'.
|
To see the process, keep debugging on by using command line option '-v 0'.
|
||||||
Whenever the noise level is above the given percentage, loss of carrier is assumed, if the noise level is constant.
|
Whenever the noise level is above the given percentage, loss of carrier is assumed, if the noise level is constant.
|
||||||
If the noise level changes (due to speech), the noise is ignored and the loss counter is reset.
|
If the noise level changes (due to speech), the noise is ignored and the loss counter is reset.
|
||||||
After a system specific duration of signal loss, the call is released.
|
After a system specific duration of signal loss, the call is released.
|
||||||
|
|
|
@ -384,7 +384,7 @@ To run the base station I the following command line options:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
# cnetz -k 131 -E -e -S 19.25,19.25
|
# cnetz -k 131 -p -d -S 19.25,19.25
|
||||||
...
|
...
|
||||||
cnetz.c:142 notice : You selected channel 131 ('Orga-Kanal') for combined callin
|
cnetz.c:142 notice : You selected channel 131 ('Orga-Kanal') for combined callin
|
||||||
g + traffic channel. Some phones will reject this.
|
g + traffic channel. Some phones will reject this.
|
||||||
|
@ -409,7 +409,7 @@ After the call has been terminated, the control channel is restored and the othe
|
||||||
You should tune the receiver to 465.090 first, to check if you can hear and decode the idle signal from the base station.
|
You should tune the receiver to 465.090 first, to check if you can hear and decode the idle signal from the base station.
|
||||||
Then tune to actually up-link frequency 455.090 MHz.
|
Then tune to actually up-link frequency 455.090 MHz.
|
||||||
The actual level is not yet relevant.
|
The actual level is not yet relevant.
|
||||||
(You may check the quality using '-L 2' command line option and build a radio loop by tuning the receiver to the transmitter.)
|
(You may check the quality using '-l 2' or '--loopback 2' command line option and build a radio loop by tuning the receiver to the transmitter.)
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -64,7 +64,7 @@ To calibrate input level (microphone), run the B-Netz base station with loop-bac
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
# src/bnetz/bnetz -k 1 -L 3 -c hw:2,0
|
# src/bnetz/bnetz -k 1 -l 3 -c hw:2,0
|
||||||
bnetz.c:268 info : Entering IDLE state, sending 'Gruppenfreisignal' 2 on channel 1.
|
bnetz.c:268 info : Entering IDLE state, sending 'Gruppenfreisignal' 2 on channel 1.
|
||||||
Base station ready, please tune transmitter to 153.010 MHz and receiver to 148.410 MHz.
|
Base station ready, please tune transmitter to 153.010 MHz and receiver to 148.410 MHz.
|
||||||
To call phone, switch transmitter using pilot tone to 153.370 MHz
|
To call phone, switch transmitter using pilot tone to 153.370 MHz
|
||||||
|
|
|
@ -73,7 +73,7 @@ Implemented networks:
|
||||||
<center>
|
<center>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="a-netz.html">A-Netz</a> (Germany)</li>
|
<li><a href="a-netz.html">A-Netz</a> (Germany)</li>
|
||||||
<li><a href="b-netz.html">B-Netz</a> (Germany)</li>
|
<li><a href="b-netz.html">B-Netz</a> (Germany) ATF-1 (Netherlands)</li>
|
||||||
<li><a href="c-netz.html">C-Netz</a> (Germany)</li>
|
<li><a href="c-netz.html">C-Netz</a> (Germany)</li>
|
||||||
<li><a href="nmt.html">NMT - Nordic Mobile Telephone</a> (Scandinavia)</li>
|
<li><a href="nmt.html">NMT - Nordic Mobile Telephone</a> (Scandinavia)</li>
|
||||||
<li><a href="amps.html">AMPS - Advanced Mobile Phone Service</a> (USA)</li>
|
<li><a href="amps.html">AMPS - Advanced Mobile Phone Service</a> (USA)</li>
|
||||||
|
|
|
@ -51,7 +51,7 @@ Now you are ready for a quick test:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
# src/bnetz/bnetz -k 1 -L 2
|
# src/bnetz/bnetz -k 1 -l 2
|
||||||
bnetz.c:268 info : Entering IDLE state, sending 'Gruppenfreisignal' 2 on channel 1.
|
bnetz.c:268 info : Entering IDLE state, sending 'Gruppenfreisignal' 2 on channel 1.
|
||||||
Base station ready, please tune transmitter to 153.010 MHz and receiver to 148.410 MHz.
|
Base station ready, please tune transmitter to 153.010 MHz and receiver to 148.410 MHz.
|
||||||
To call phone, switch transmitter using pilot tone to 153.370 MHz
|
To call phone, switch transmitter using pilot tone to 153.370 MHz
|
||||||
|
|
|
@ -546,7 +546,7 @@ Check out what networks are available:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
# nmt -y list
|
# nmt -Y list
|
||||||
TA Short Country (Provider)
|
TA Short Country (Provider)
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
5 DK Denmark (Tele Danmark Mobile)
|
5 DK Denmark (Tele Danmark Mobile)
|
||||||
|
@ -563,7 +563,7 @@ TA Short Country (Provider)
|
||||||
<p>
|
<p>
|
||||||
In this example we select 'Sweden'.
|
In this example we select 'Sweden'.
|
||||||
You must set you phone to network 'Sweden' or 'SE'.
|
You must set you phone to network 'Sweden' or 'SE'.
|
||||||
Then use the command line parameter '-y SE,1' or '--traffic-area SE,1' to select cell area 1 in Sweden.
|
Then use the command line parameter '-Y SE,1' or '--traffic-area SE,1' to select cell area 1 in Sweden.
|
||||||
In this example we set the two digits 'traffic area' to 61.
|
In this example we set the two digits 'traffic area' to 61.
|
||||||
If the phone was not in this area recently, it will send roaming update, as soon as it finds our network.
|
If the phone was not in this area recently, it will send roaming update, as soon as it finds our network.
|
||||||
</p>
|
</p>
|
||||||
|
@ -583,7 +583,7 @@ Use a traffic are of 'SE,2', so the phone registers, if it was previously regist
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
nmt -k 1 -y SE,2
|
nmt -k 1 -Y SE,2
|
||||||
nmt.c:278 info : Selecting country code 6 of SE,Sweden (provider 'Telia Mobitel')
|
nmt.c:278 info : Selecting country code 6 of SE,Sweden (provider 'Telia Mobitel')
|
||||||
...
|
...
|
||||||
nmt.c:402 info : Entering IDLE state, sending idle frames on combined calling & traffic channel.
|
nmt.c:402 info : Entering IDLE state, sending idle frames on combined calling & traffic channel.
|
||||||
|
|
|
@ -55,12 +55,12 @@ To call phone, switch transmitter (using pilot signal) to 153.370 MHz.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Alternatively select a different sound adapter.
|
Alternatively select a different sound adapter.
|
||||||
If you prefer card 2, device 0, add '-d hw:2,0' or '--device hw:2,0' to the command line:
|
If you prefer card 2, device 0, add '-a hw:2,0' or '--audio-device hw:2,0' to the command line:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
# src/bnetz/bnetz -k 1 -d hw:2,0
|
# src/bnetz/bnetz -k 1 -a hw:2,0
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
@ -83,13 +83,13 @@ Do not use input gain on the microphone.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Now we want to calibrate transmitter and receiver audio level.
|
Now we want to calibrate transmitter and receiver audio level.
|
||||||
Run the B-Netz base station in loopback test mode (-L 2).
|
Run the B-Netz base station in loopback test mode (-l 2).
|
||||||
Even if you plan to setup A-Netz base station, use B-Netz base station for calibration.
|
Even if you plan to setup A-Netz base station, use B-Netz base station for calibration.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
# src/bnetz/bnetz -k 1 -L 2
|
# src/bnetz/bnetz -k 1 -l 2
|
||||||
bnetz.c:268 info : Entering IDLE state, sending 'Gruppenfreisignal' 2 on channel 1.
|
bnetz.c:268 info : Entering IDLE state, sending 'Gruppenfreisignal' 2 on channel 1.
|
||||||
Base station ready, please tune transmitter to 153.010 MHz and receiver to 148.410 MHz.
|
Base station ready, please tune transmitter to 153.010 MHz and receiver to 148.410 MHz.
|
||||||
To call phone, switch transmitter (using pilot signal) to 153.370 MHz.
|
To call phone, switch transmitter (using pilot signal) to 153.370 MHz.
|
||||||
|
@ -155,7 +155,7 @@ Use the command line option '-x' or '--cross':
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
# src/bnetz/bnetz -k 1 -x -L 2
|
# src/bnetz/bnetz -k 1 -x -l 2
|
||||||
bnetz.c:268 info : Entering IDLE state, sending 'Gruppenfreisignal' 2 on channel 1.
|
bnetz.c:268 info : Entering IDLE state, sending 'Gruppenfreisignal' 2 on channel 1.
|
||||||
Base station ready, please tune transmitter to 153.010 MHz and receiver to 148.410 MHz.
|
Base station ready, please tune transmitter to 153.010 MHz and receiver to 148.410 MHz.
|
||||||
To call phone, switch transmitter (using pilot signal) to 153.370 MHz.
|
To call phone, switch transmitter (using pilot signal) to 153.370 MHz.
|
||||||
|
@ -186,7 +186,7 @@ A frequency of 2000 Hz is lowered down to half of it's amplitude (-6 db), so it
|
||||||
<p>
|
<p>
|
||||||
Generally a transmitter is doing pre-emphasis for you.
|
Generally a transmitter is doing pre-emphasis for you.
|
||||||
If you are connected directly to the PLL of your transmitter, you will also not have pre-emphasis.
|
If you are connected directly to the PLL of your transmitter, you will also not have pre-emphasis.
|
||||||
In this case you need to do it inside the base station software. Use the command line option '-E' or '--pre-emphasis':
|
In this case you need to do it inside the base station software. Use the command line option '-p' or '--pre-emphasis':
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
@ -198,7 +198,7 @@ In this case you need to do it inside the base station software. Use the command
|
||||||
<p>
|
<p>
|
||||||
The receiver is doing the de-emphasis for you.
|
The receiver is doing the de-emphasis for you.
|
||||||
If you are connected directly to the discriminator of your receiver, you will also not have de-emphasis.
|
If you are connected directly to the discriminator of your receiver, you will also not have de-emphasis.
|
||||||
In this case you need to do it inside the base station software. Use the command line option '-e' or '--de-emphasis':
|
In this case you need to do it inside the base station software. Use the command line option '-d' or '--de-emphasis':
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
@ -216,13 +216,13 @@ Especially if you use discriminator output, you might have low output voltage.
|
||||||
In my experiments it helps to amplify the amplitude by factor two in order adjust a received signal to 100%.
|
In my experiments it helps to amplify the amplitude by factor two in order adjust a received signal to 100%.
|
||||||
A gain of 6 dB will amplify the amplitude by factor two.
|
A gain of 6 dB will amplify the amplitude by factor two.
|
||||||
Also the noise of the sound adapter will be amplified by factor two, but this is not relevant at 16 bit resolution.
|
Also the noise of the sound adapter will be amplified by factor two, but this is not relevant at 16 bit resolution.
|
||||||
Use the command line option '-G 6' or '--rx-gain 6'.
|
Use the command line option '-g 6' or '--rx-gain 6'.
|
||||||
In this example I use both, transmitter and receiver without emphasis (so software must do it) and add extra 6 dB gain to the input from the receiver:
|
In this example I use both, transmitter and receiver without emphasis (so software must do it) and add extra 6 dB gain to the input from the receiver:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
# src/bnetz/bnetz -k 1 -E -e -G 6
|
# src/bnetz/bnetz -k 1 -p -d -g 6
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ As used before, the loop-back test can be used to verify the signal process, suc
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
If command line option '-L 1' or '--loopback 1' is given, a loop-back inside the software is performed.
|
If command line option '-l 1' or '--loopback 1' is given, a loop-back inside the software is performed.
|
||||||
Also the audio signal is sent to the audio adapter, but not received from it.
|
Also the audio signal is sent to the audio adapter, but not received from it.
|
||||||
This test is used to debug the software.
|
This test is used to debug the software.
|
||||||
It can be used to see what the output of an external loop would look like.
|
It can be used to see what the output of an external loop would look like.
|
||||||
|
@ -243,7 +243,7 @@ It can be used to see what the output of an external loop would look like.
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
./bnetz/bnetz -k 1 -L 1
|
./bnetz/bnetz -k 1 -l 1
|
||||||
bnetz.c:351 info : Entering IDLE state, sending 'Gruppenfreisignal' 2.
|
bnetz.c:351 info : Entering IDLE state, sending 'Gruppenfreisignal' 2.
|
||||||
Base station for channel 1 ready, please tune transmitter to 153.010 MHz and receiver to 148.410 MHz.
|
Base station for channel 1 ready, please tune transmitter to 153.010 MHz and receiver to 148.410 MHz.
|
||||||
To call phone, switch transmitter (using pilot signal) to 153.370 MHz.
|
To call phone, switch transmitter (using pilot signal) to 153.370 MHz.
|
||||||
|
@ -266,13 +266,13 @@ bnetz.c:528 notice : Round trip delay is 0.001 seconds
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
If command line option '-L 2' or '--loopback 2' is given, an external loop-back is performed.
|
If command line option '-l 2' or '--loopback 2' is given, an external loop-back is performed.
|
||||||
The receiver needs to be tuned to transmitter, so the software receives its own signal.
|
The receiver needs to be tuned to transmitter, so the software receives its own signal.
|
||||||
The received quality level is relevant. It should be not less than 90 for B-Netz.
|
The received quality level is relevant. It should be not less than 90 for B-Netz.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
If command line option '-L 3' or '--loopback 3' is given, the audio from the input is sent back to the output.
|
If command line option '-l 3' or '--loopback 3' is given, the audio from the input is sent back to the output.
|
||||||
It can be used to check a headset.
|
It can be used to check a headset.
|
||||||
Everything that is spoken into the microphone should appear on the headphone.
|
Everything that is spoken into the microphone should appear on the headphone.
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -356,7 +356,7 @@ static amps_t *search_pc(void)
|
||||||
static void amps_go_idle(amps_t *amps);
|
static void amps_go_idle(amps_t *amps);
|
||||||
|
|
||||||
/* Create transceiver instance and link to a list. */
|
/* Create transceiver instance and link to a list. */
|
||||||
int amps_create(int channel, enum amps_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int tolerant, int loopback)
|
int amps_create(int channel, enum amps_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int tolerant, int loopback)
|
||||||
{
|
{
|
||||||
sender_t *sender;
|
sender_t *sender;
|
||||||
amps_t *amps;
|
amps_t *amps;
|
||||||
|
@ -422,7 +422,7 @@ int amps_create(int channel, enum amps_chan_type chan_type, const char *sounddev
|
||||||
PDEBUG(DAMPS, DEBUG_DEBUG, "Creating 'AMPS' instance for channel = %d (sample rate %d).\n", channel, samplerate);
|
PDEBUG(DAMPS, DEBUG_DEBUG, "Creating 'AMPS' instance for channel = %d (sample rate %d).\n", channel, samplerate);
|
||||||
|
|
||||||
/* init general part of transceiver */
|
/* init general part of transceiver */
|
||||||
rc = sender_create(&s->sender, channel, sounddev, samplerate, cross_channels, rx_gain, 0, 0, write_wave, read_wave, loopback, 0, PILOT_SIGNAL_NONE);
|
rc = sender_create(&s->sender, channel, sounddev, samplerate, cross_channels, rx_gain, 0, 0, write_rx_wave, write_tx_wave, read_rx_wave, loopback, 0, PILOT_SIGNAL_NONE);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
PDEBUG(DAMPS, DEBUG_ERROR, "Failed to init transceiver process!\n");
|
PDEBUG(DAMPS, DEBUG_ERROR, "Failed to init transceiver process!\n");
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -163,7 +163,7 @@ const char *amps_min12number(uint32_t min1);
|
||||||
void amps_number2min(const char *number, uint32_t *min1, uint16_t *min2);
|
void amps_number2min(const char *number, uint32_t *min1, uint16_t *min2);
|
||||||
const char *amps_min2number(uint32_t min1, uint16_t min2);
|
const char *amps_min2number(uint32_t min1, uint16_t min2);
|
||||||
const char *amps_scm(uint8_t scm);
|
const char *amps_scm(uint8_t scm);
|
||||||
int amps_create(int channel, enum amps_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int tolerant, int loopback);
|
int amps_create(int channel, enum amps_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int tolerant, int loopback);
|
||||||
void amps_destroy(sender_t *sender);
|
void amps_destroy(sender_t *sender);
|
||||||
void amps_rx_signaling_tone(amps_t *amps, int tone, double quality);
|
void amps_rx_signaling_tone(amps_t *amps, int tone, double quality);
|
||||||
void amps_rx_sat(amps_t *amps, int tone, double quality);
|
void amps_rx_sat(amps_t *amps, int tone, double quality);
|
||||||
|
|
|
@ -47,9 +47,9 @@ int tolerant = 0;
|
||||||
|
|
||||||
void print_help(const char *arg0)
|
void print_help(const char *arg0)
|
||||||
{
|
{
|
||||||
print_help_common(arg0, "-E -e -F yes | no ");
|
print_help_common(arg0, "-p -d -F yes | no ");
|
||||||
/* - - */
|
/* - - */
|
||||||
printf(" -t --channel-type <channel type> | list\n");
|
printf(" -T --channel-type <channel type> | list\n");
|
||||||
printf(" Give channel type, use 'list' to get a list. (default = '%s')\n", chan_type_short_name(chan_type[0]));
|
printf(" Give channel type, use 'list' to get a list. (default = '%s')\n", chan_type_short_name(chan_type[0]));
|
||||||
printf(" -F --flip-polarity no | yes\n");
|
printf(" -F --flip-polarity no | yes\n");
|
||||||
printf(" Flip polarity of transmitted FSK signal. If yes, the sound card\n");
|
printf(" Flip polarity of transmitted FSK signal. If yes, the sound card\n");
|
||||||
|
@ -85,7 +85,7 @@ void print_help(const char *arg0)
|
||||||
printf(" -S --sysinfo bis=0 | bis=1\n");
|
printf(" -S --sysinfo bis=0 | bis=1\n");
|
||||||
printf(" If 0, phone ignores BUSY/IDLE bit on FOCC (default = '%d')\n", bis);
|
printf(" If 0, phone ignores BUSY/IDLE bit on FOCC (default = '%d')\n", bis);
|
||||||
printf(" If 1, be sure to have a round-trip delay (latency) not more than 5 ms\n");
|
printf(" If 1, be sure to have a round-trip delay (latency) not more than 5 ms\n");
|
||||||
printf(" -T --tolerant\n");
|
printf(" -O --tolerant\n");
|
||||||
printf(" Be more tolerant when hunting for sync sequence\n");
|
printf(" Be more tolerant when hunting for sync sequence\n");
|
||||||
printf("\nstation-id: Give 10 digit station-id, you don't need to enter it for every\n");
|
printf("\nstation-id: Give 10 digit station-id, you don't need to enter it for every\n");
|
||||||
printf(" start of this program.\n");
|
printf(" start of this program.\n");
|
||||||
|
@ -98,15 +98,15 @@ static int handle_options(int argc, char **argv)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
static struct option long_options_special[] = {
|
static struct option long_options_special[] = {
|
||||||
{"channel-type", 1, 0, 't'},
|
{"channel-type", 1, 0, 'T'},
|
||||||
{"flip-polarity", 1, 0, 'F'},
|
{"flip-polarity", 1, 0, 'F'},
|
||||||
{"ms-power", 1, 0, 'P'},
|
{"ms-power", 1, 0, 'P'},
|
||||||
{"sysinfo", 1, 0, 'S'},
|
{"sysinfo", 1, 0, 'S'},
|
||||||
{"tolerant", 0, 0, 'T'},
|
{"tolerant", 0, 0, 'O'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
set_options_common("t:F:P:S:T", long_options_special);
|
set_options_common("T:F:P:S:O", long_options_special);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
int option_index = 0, c;
|
int option_index = 0, c;
|
||||||
|
@ -117,7 +117,7 @@ static int handle_options(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 't':
|
case 'T':
|
||||||
if (!strcmp(optarg, "list")) {
|
if (!strcmp(optarg, "list")) {
|
||||||
amps_channel_list();
|
amps_channel_list();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
@ -209,7 +209,7 @@ static int handle_options(int argc, char **argv)
|
||||||
}
|
}
|
||||||
skip_args += 2;
|
skip_args += 2;
|
||||||
break;
|
break;
|
||||||
case 'T':
|
case 'O':
|
||||||
tolerant = 1;
|
tolerant = 1;
|
||||||
skip_args += 1;
|
skip_args += 1;
|
||||||
break;
|
break;
|
||||||
|
@ -326,7 +326,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
if (!do_pre_emphasis || !do_de_emphasis) {
|
if (!do_pre_emphasis || !do_de_emphasis) {
|
||||||
fprintf(stderr, "*******************************************************************************\n");
|
fprintf(stderr, "*******************************************************************************\n");
|
||||||
fprintf(stderr, "I strongly suggest to let me do pre- and de-emphasis (options -E -e)!\n");
|
fprintf(stderr, "I strongly suggest to let me do pre- and de-emphasis (options -p -d)!\n");
|
||||||
fprintf(stderr, "Use a transmitter/receiver without emphasis and let me do that!\n");
|
fprintf(stderr, "Use a transmitter/receiver without emphasis and let me do that!\n");
|
||||||
fprintf(stderr, "Because carrier FSK signaling does not use emphasis, I like to control\n");
|
fprintf(stderr, "Because carrier FSK signaling does not use emphasis, I like to control\n");
|
||||||
fprintf(stderr, "emphasis by myself for best results.\n");
|
fprintf(stderr, "emphasis by myself for best results.\n");
|
||||||
|
@ -347,7 +347,7 @@ int main(int argc, char *argv[])
|
||||||
amps_si si;
|
amps_si si;
|
||||||
|
|
||||||
init_sysinfo(&si, ms_power, ms_power, dcc, sid >> 1, regh, regr, pureg, pdreg, locaid, regincr, bis);
|
init_sysinfo(&si, ms_power, ms_power, dcc, sid >> 1, regh, regr, pureg, pdreg, locaid, regincr, bis);
|
||||||
rc = amps_create(kanal[i], chan_type[i], sounddev[i], samplerate, cross_channels, rx_gain, do_pre_emphasis, do_de_emphasis, write_wave, read_wave, &si, sid, scc, polarity, tolerant, loopback);
|
rc = amps_create(kanal[i], chan_type[i], sounddev[i], samplerate, cross_channels, rx_gain, do_pre_emphasis, do_de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, &si, sid, scc, polarity, tolerant, loopback);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
|
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
@ -137,7 +137,7 @@ static void anetz_timeout(struct timer *timer);
|
||||||
static void anetz_go_idle(anetz_t *anetz);
|
static void anetz_go_idle(anetz_t *anetz);
|
||||||
|
|
||||||
/* Create transceiver instance and link to a list. */
|
/* Create transceiver instance and link to a list. */
|
||||||
int anetz_create(int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int page_sequence, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, int loopback, double loss_volume)
|
int anetz_create(int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int page_sequence, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, int loopback, double loss_volume)
|
||||||
{
|
{
|
||||||
anetz_t *anetz;
|
anetz_t *anetz;
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -156,7 +156,7 @@ int anetz_create(int kanal, const char *sounddev, int samplerate, int cross_chan
|
||||||
PDEBUG(DANETZ, DEBUG_DEBUG, "Creating 'A-Netz' instance for 'Kanal' = %d (sample rate %d).\n", kanal, samplerate);
|
PDEBUG(DANETZ, DEBUG_DEBUG, "Creating 'A-Netz' instance for 'Kanal' = %d (sample rate %d).\n", kanal, samplerate);
|
||||||
|
|
||||||
/* init general part of transceiver */
|
/* init general part of transceiver */
|
||||||
rc = sender_create(&anetz->sender, kanal, sounddev, samplerate, cross_channels, rx_gain, pre_emphasis, de_emphasis, write_wave, read_wave, loopback, loss_volume, PILOT_SIGNAL_NONE);
|
rc = sender_create(&anetz->sender, kanal, sounddev, samplerate, cross_channels, rx_gain, pre_emphasis, de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, loopback, loss_volume, PILOT_SIGNAL_NONE);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
PDEBUG(DANETZ, DEBUG_ERROR, "Failed to init 'Sender' processing!\n");
|
PDEBUG(DANETZ, DEBUG_ERROR, "Failed to init 'Sender' processing!\n");
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -44,7 +44,7 @@ typedef struct anetz {
|
||||||
|
|
||||||
double anetz_kanal2freq(int kanal, int unterband);
|
double anetz_kanal2freq(int kanal, int unterband);
|
||||||
int anetz_init(void);
|
int anetz_init(void);
|
||||||
int anetz_create(int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int page_sequence, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, int loopback, double loss_volume);
|
int anetz_create(int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int page_sequence, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, int loopback, double loss_volume);
|
||||||
void anetz_destroy(sender_t *sender);
|
void anetz_destroy(sender_t *sender);
|
||||||
void anetz_loss_indication(anetz_t *anetz);
|
void anetz_loss_indication(anetz_t *anetz);
|
||||||
void anetz_receive_tone(anetz_t *anetz, int bit);
|
void anetz_receive_tone(anetz_t *anetz, int bit);
|
||||||
|
|
|
@ -42,14 +42,14 @@ void print_help(const char *arg0)
|
||||||
{
|
{
|
||||||
print_help_common(arg0, "");
|
print_help_common(arg0, "");
|
||||||
/* - - */
|
/* - - */
|
||||||
printf(" -g --geo <lat>,<lon>\n");
|
printf(" -G --geo <lat>,<lon>\n");
|
||||||
printf(" Give your coordinates of your location, to find closest base station.\n");
|
printf(" Give your coordinates of your location, to find closest base station.\n");
|
||||||
printf(" (e.g. '--geo 51.186959,7.080194') Or use '--geo list' to get a list of\n");
|
printf(" (e.g. '--geo 51.186959,7.080194') Or use '--geo list' to get a list of\n");
|
||||||
printf(" all base station locations.\n");
|
printf(" all base station locations.\n");
|
||||||
printf(" -P --page-sequence 0 | <ms>\n");
|
printf(" -P --page-sequence 0 | <ms>\n");
|
||||||
printf(" Cycle paging tones, rather than sending simultaniously.\n");
|
printf(" Cycle paging tones, rather than sending simultaniously.\n");
|
||||||
printf(" (default = '%d')\n", page_sequence);
|
printf(" (default = '%d')\n", page_sequence);
|
||||||
printf(" -0 --loss <volume>\n");
|
printf(" -L --loss <volume>\n");
|
||||||
printf(" Detect loss of carrier by detecting steady noise above given volume in\n");
|
printf(" Detect loss of carrier by detecting steady noise above given volume in\n");
|
||||||
printf(" percent. (disabled by default)\n");
|
printf(" percent. (disabled by default)\n");
|
||||||
printf("\nstation-id: Give (last) 5 digits of station-id, you don't need to enter it\n");
|
printf("\nstation-id: Give (last) 5 digits of station-id, you don't need to enter it\n");
|
||||||
|
@ -62,13 +62,13 @@ static int handle_options(int argc, char **argv)
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
static struct option long_options_special[] = {
|
static struct option long_options_special[] = {
|
||||||
{"geo", 1, 0, 'g'},
|
{"geo", 1, 0, 'G'},
|
||||||
{"page-sequence", 1, 0, 'P'},
|
{"page-sequence", 1, 0, 'P'},
|
||||||
{"loss", 1, 0, '0'},
|
{"loss", 1, 0, 'L'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
set_options_common("g:P:0:", long_options_special);
|
set_options_common("G:P:L:", long_options_special);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
int option_index = 0, c;
|
int option_index = 0, c;
|
||||||
|
@ -79,7 +79,7 @@ static int handle_options(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'g':
|
case 'G':
|
||||||
if (!strcasecmp(optarg, "list")) {
|
if (!strcasecmp(optarg, "list")) {
|
||||||
station_list();
|
station_list();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
@ -95,7 +95,7 @@ static int handle_options(int argc, char **argv)
|
||||||
page_sequence = atoi(optarg);
|
page_sequence = atoi(optarg);
|
||||||
skip_args += 2;
|
skip_args += 2;
|
||||||
break;
|
break;
|
||||||
case '0':
|
case 'L':
|
||||||
lossdetect = atoi(optarg);
|
lossdetect = atoi(optarg);
|
||||||
skip_args += 2;
|
skip_args += 2;
|
||||||
break;
|
break;
|
||||||
|
@ -167,7 +167,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* create transceiver instance */
|
/* create transceiver instance */
|
||||||
for (i = 0; i < num_kanal; i++) {
|
for (i = 0; i < num_kanal; i++) {
|
||||||
rc = anetz_create(kanal[i], sounddev[i], samplerate, cross_channels, rx_gain, page_sequence, do_pre_emphasis, do_de_emphasis, write_wave, read_wave, loopback, lossdetect / 100.0);
|
rc = anetz_create(kanal[i], sounddev[i], samplerate, cross_channels, rx_gain, page_sequence, do_pre_emphasis, do_de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, loopback, lossdetect / 100.0);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
|
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
@ -99,7 +99,7 @@ static void bnetz_timeout(struct timer *timer);
|
||||||
static void bnetz_go_idle(bnetz_t *bnetz);
|
static void bnetz_go_idle(bnetz_t *bnetz);
|
||||||
|
|
||||||
/* Create transceiver instance and link to a list. */
|
/* Create transceiver instance and link to a list. */
|
||||||
int bnetz_create(int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int gfs, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, int loopback, double loss_factor, const char *pilot)
|
int bnetz_create(int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int gfs, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, int loopback, double loss_factor, const char *pilot)
|
||||||
{
|
{
|
||||||
bnetz_t *bnetz;
|
bnetz_t *bnetz;
|
||||||
enum pilot_signal pilot_signal = PILOT_SIGNAL_NONE;
|
enum pilot_signal pilot_signal = PILOT_SIGNAL_NONE;
|
||||||
|
@ -160,7 +160,7 @@ error_pilot:
|
||||||
PDEBUG(DBNETZ, DEBUG_DEBUG, "Creating 'B-Netz' instance for 'Kanal' = %d 'Gruppenfreisignal' = %d (sample rate %d).\n", kanal, gfs, samplerate);
|
PDEBUG(DBNETZ, DEBUG_DEBUG, "Creating 'B-Netz' instance for 'Kanal' = %d 'Gruppenfreisignal' = %d (sample rate %d).\n", kanal, gfs, samplerate);
|
||||||
|
|
||||||
/* init general part of transceiver */
|
/* init general part of transceiver */
|
||||||
rc = sender_create(&bnetz->sender, kanal, sounddev, samplerate, cross_channels, rx_gain, pre_emphasis, de_emphasis, write_wave, read_wave, loopback, loss_factor, pilot_signal);
|
rc = sender_create(&bnetz->sender, kanal, sounddev, samplerate, cross_channels, rx_gain, pre_emphasis, de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, loopback, loss_factor, pilot_signal);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
PDEBUG(DBNETZ, DEBUG_ERROR, "Failed to init transceiver process!\n");
|
PDEBUG(DBNETZ, DEBUG_ERROR, "Failed to init transceiver process!\n");
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -99,7 +99,7 @@ typedef struct bnetz {
|
||||||
|
|
||||||
double bnetz_kanal2freq(int kanal, int unterband);
|
double bnetz_kanal2freq(int kanal, int unterband);
|
||||||
int bnetz_init(void);
|
int bnetz_init(void);
|
||||||
int bnetz_create(int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int gfs, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, int loopback, double loss_factor, const char *pilot);
|
int bnetz_create(int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int gfs, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, int loopback, double loss_factor, const char *pilot);
|
||||||
void bnetz_destroy(sender_t *sender);
|
void bnetz_destroy(sender_t *sender);
|
||||||
void bnetz_loss_indication(bnetz_t *bnetz);
|
void bnetz_loss_indication(bnetz_t *bnetz);
|
||||||
void bnetz_receive_tone(bnetz_t *bnetz, int bit);
|
void bnetz_receive_tone(bnetz_t *bnetz, int bit);
|
||||||
|
|
|
@ -44,12 +44,12 @@ void print_help(const char *arg0)
|
||||||
{
|
{
|
||||||
print_help_common(arg0, "");
|
print_help_common(arg0, "");
|
||||||
/* - - */
|
/* - - */
|
||||||
printf(" -g --gfs <gruppenfreisignal> | <lat>,<lon>\n");
|
printf(" -G --gfs <gruppenfreisignal> | <lat>,<lon>\n");
|
||||||
printf(" Gruppenfreisignal\" 1..9 | 19 | 10..18 (default = '%d')\n", gfs);
|
printf(" Gruppenfreisignal\" 1..9 | 19 | 10..18 (default = '%d')\n", gfs);
|
||||||
printf(" Alternative give your coordinates of your location, to find closest\n");
|
printf(" Alternative give your coordinates of your location, to find closest\n");
|
||||||
printf(" base station. (e.g. '--gfs 54.487291,9.069993') Or use '--gfs list' to\n");
|
printf(" base station. (e.g. '--gfs 54.487291,9.069993') Or use '--gfs list' to\n");
|
||||||
printf(" get a list of all base station locations.\n");
|
printf(" get a list of all base station locations.\n");
|
||||||
printf(" -g --gfs 19\n");
|
printf(" -G --gfs 19\n");
|
||||||
printf(" Set to 19 in order to make the phone transmit at 100 mW instead of\n");
|
printf(" Set to 19 in order to make the phone transmit at 100 mW instead of\n");
|
||||||
printf(" full 15 Watts. If supported, the phone uses the channel with low power\n");
|
printf(" full 15 Watts. If supported, the phone uses the channel with low power\n");
|
||||||
printf(" (Kanal kleiner Leistung).\n");
|
printf(" (Kanal kleiner Leistung).\n");
|
||||||
|
@ -64,7 +64,7 @@ void print_help(const char *arg0)
|
||||||
printf(" Example: /sys/class/gpio/gpio17/value=1:0 writes a '1' to\n");
|
printf(" Example: /sys/class/gpio/gpio17/value=1:0 writes a '1' to\n");
|
||||||
printf(" /sys/class/gpio/gpio17/value to switching to channel 19 and a '0' to\n");
|
printf(" /sys/class/gpio/gpio17/value to switching to channel 19 and a '0' to\n");
|
||||||
printf(" switch back. (default = %s)\n", pilot[0]);
|
printf(" switch back. (default = %s)\n", pilot[0]);
|
||||||
printf(" -0 --loss <volume>\n");
|
printf(" -L --loss <volume>\n");
|
||||||
printf(" Detect loss of carrier by detecting steady noise above given volume in\n");
|
printf(" Detect loss of carrier by detecting steady noise above given volume in\n");
|
||||||
printf(" percent. (disabled by default)\n");
|
printf(" percent. (disabled by default)\n");
|
||||||
printf("\nstation-id: Give 5 digit station-id, you don't need to enter it for every\n");
|
printf("\nstation-id: Give 5 digit station-id, you don't need to enter it for every\n");
|
||||||
|
@ -77,13 +77,13 @@ static int handle_options(int argc, char **argv)
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
static struct option long_options_special[] = {
|
static struct option long_options_special[] = {
|
||||||
{"gfs", 1, 0, 'g'},
|
{"gfs", 1, 0, 'G'},
|
||||||
{"pilot", 1, 0, 'P'},
|
{"pilot", 1, 0, 'P'},
|
||||||
{"loss", 1, 0, '0'},
|
{"loss", 1, 0, 'L'},
|
||||||
{0, 0, 0, 0},
|
{0, 0, 0, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
set_options_common("g:P:0:", long_options_special);
|
set_options_common("G:P:L:", long_options_special);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
int option_index = 0, c;
|
int option_index = 0, c;
|
||||||
|
@ -94,7 +94,7 @@ static int handle_options(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'g':
|
case 'G':
|
||||||
if (!strcasecmp(optarg, "list")) {
|
if (!strcasecmp(optarg, "list")) {
|
||||||
station_list();
|
station_list();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
@ -111,7 +111,7 @@ static int handle_options(int argc, char **argv)
|
||||||
OPT_ARRAY(num_pilot, pilot, strdup(optarg))
|
OPT_ARRAY(num_pilot, pilot, strdup(optarg))
|
||||||
skip_args += 2;
|
skip_args += 2;
|
||||||
break;
|
break;
|
||||||
case '0':
|
case 'L':
|
||||||
lossdetect = atoi(optarg);
|
lossdetect = atoi(optarg);
|
||||||
skip_args += 2;
|
skip_args += 2;
|
||||||
break;
|
break;
|
||||||
|
@ -186,7 +186,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* create transceiver instance */
|
/* create transceiver instance */
|
||||||
for (i = 0; i < num_kanal; i++) {
|
for (i = 0; i < num_kanal; i++) {
|
||||||
rc = bnetz_create(kanal[i], sounddev[i], samplerate, cross_channels, rx_gain, gfs, do_pre_emphasis, do_de_emphasis, write_wave, read_wave, loopback, (double)lossdetect / 100.0, pilot[i]);
|
rc = bnetz_create(kanal[i], sounddev[i], samplerate, cross_channels, rx_gain, gfs, do_pre_emphasis, do_de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, loopback, (double)lossdetect / 100.0, pilot[i]);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
|
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
@ -178,7 +178,7 @@ int cnetz_init(void)
|
||||||
static void cnetz_go_idle(cnetz_t *cnetz);
|
static void cnetz_go_idle(cnetz_t *cnetz);
|
||||||
|
|
||||||
/* Create transceiver instance and link to a list. */
|
/* Create transceiver instance and link to a list. */
|
||||||
int cnetz_create(int kanal, enum cnetz_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int auth, int ms_power, int measure_speed, double clock_speed[2], int polarity, double noise, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, int loopback)
|
int cnetz_create(int kanal, enum cnetz_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int auth, int ms_power, int measure_speed, double clock_speed[2], int polarity, double noise, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, int loopback)
|
||||||
{
|
{
|
||||||
sender_t *sender;
|
sender_t *sender;
|
||||||
cnetz_t *cnetz;
|
cnetz_t *cnetz;
|
||||||
|
@ -237,7 +237,7 @@ int cnetz_create(int kanal, enum cnetz_chan_type chan_type, const char *sounddev
|
||||||
|
|
||||||
/* init general part of transceiver */
|
/* init general part of transceiver */
|
||||||
/* do not enable emphasis, since it is done by cnetz code, not by common sender code */
|
/* do not enable emphasis, since it is done by cnetz code, not by common sender code */
|
||||||
rc = sender_create(&cnetz->sender, kanal, sounddev, samplerate, cross_channels, rx_gain, 0, 0, write_wave, read_wave, loopback, 0, PILOT_SIGNAL_NONE);
|
rc = sender_create(&cnetz->sender, kanal, sounddev, samplerate, cross_channels, rx_gain, 0, 0, write_rx_wave, write_tx_wave, read_rx_wave, loopback, 0, PILOT_SIGNAL_NONE);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
PDEBUG(DCNETZ, DEBUG_ERROR, "Failed to init transceiver process!\n");
|
PDEBUG(DCNETZ, DEBUG_ERROR, "Failed to init transceiver process!\n");
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -121,7 +121,7 @@ int cnetz_channel_by_short_name(const char *short_name);
|
||||||
const char *chan_type_short_name(enum cnetz_chan_type chan_type);
|
const char *chan_type_short_name(enum cnetz_chan_type chan_type);
|
||||||
const char *chan_type_long_name(enum cnetz_chan_type chan_type);
|
const char *chan_type_long_name(enum cnetz_chan_type chan_type);
|
||||||
int cnetz_init(void);
|
int cnetz_init(void);
|
||||||
int cnetz_create(int kanal, enum cnetz_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int auth, int ms_power, int measure_speed, double clock_speed[2], int polarity, double noise, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, int loopback);
|
int cnetz_create(int kanal, enum cnetz_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int auth, int ms_power, int measure_speed, double clock_speed[2], int polarity, double noise, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, int loopback);
|
||||||
void cnetz_destroy(sender_t *sender);
|
void cnetz_destroy(sender_t *sender);
|
||||||
void cnetz_sync_frame(cnetz_t *cnetz, double sync, int ts);
|
void cnetz_sync_frame(cnetz_t *cnetz, double sync, int ts);
|
||||||
int cnetz_meldeaufruf(uint8_t futln_nat, uint8_t futln_fuvst, uint16_t futln_rest);
|
int cnetz_meldeaufruf(uint8_t futln_nat, uint8_t futln_fuvst, uint16_t futln_rest);
|
||||||
|
|
|
@ -51,9 +51,9 @@ int voice_deviation = 1;
|
||||||
|
|
||||||
void print_help(const char *arg0)
|
void print_help(const char *arg0)
|
||||||
{
|
{
|
||||||
print_help_common(arg0, "-S <rx ppm>,<tx ppm> -E -e ");
|
print_help_common(arg0, "-S <rx ppm>,<tx ppm> -p -d ");
|
||||||
/* - - */
|
/* - - */
|
||||||
printf(" -t --channel-type <channel type> | list\n");
|
printf(" -T --channel-type <channel type> | list\n");
|
||||||
printf(" Give channel type, use 'list' to get a list. (default = '%s')\n", chan_type_short_name(chan_type[0]));
|
printf(" Give channel type, use 'list' to get a list. (default = '%s')\n", chan_type_short_name(chan_type[0]));
|
||||||
printf(" -M --measure-speed\n");
|
printf(" -M --measure-speed\n");
|
||||||
printf(" Measures clock speed. THIS IS REQUIRED! See documentation!\n");
|
printf(" Measures clock speed. THIS IS REQUIRED! See documentation!\n");
|
||||||
|
@ -93,7 +93,7 @@ static int handle_options(int argc, char **argv)
|
||||||
const char *p;
|
const char *p;
|
||||||
|
|
||||||
static struct option long_options_special[] = {
|
static struct option long_options_special[] = {
|
||||||
{"channel-type", 1, 0, 't'},
|
{"channel-type", 1, 0, 'T'},
|
||||||
{"measure-speed", 0, 0, 'M'},
|
{"measure-speed", 0, 0, 'M'},
|
||||||
{"clock-speed", 1, 0, 'S'},
|
{"clock-speed", 1, 0, 'S'},
|
||||||
{"flip-polarity", 1, 0, 'F'},
|
{"flip-polarity", 1, 0, 'F'},
|
||||||
|
@ -104,7 +104,7 @@ static int handle_options(int argc, char **argv)
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
set_options_common("t:MS:F:N:P:AV", long_options_special);
|
set_options_common("T:MS:F:N:P:AV", long_options_special);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
int option_index = 0, c;
|
int option_index = 0, c;
|
||||||
|
@ -115,7 +115,7 @@ static int handle_options(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 't':
|
case 'T':
|
||||||
if (!strcmp(optarg, "list")) {
|
if (!strcmp(optarg, "list")) {
|
||||||
cnetz_channel_list();
|
cnetz_channel_list();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
@ -286,7 +286,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
if (!do_pre_emphasis || !do_de_emphasis) {
|
if (!do_pre_emphasis || !do_de_emphasis) {
|
||||||
fprintf(stderr, "*******************************************************************************\n");
|
fprintf(stderr, "*******************************************************************************\n");
|
||||||
fprintf(stderr, "I strongly suggest to let me do pre- and de-emphasis (options -E -e)!\n");
|
fprintf(stderr, "I strongly suggest to let me do pre- and de-emphasis (options -p -d)!\n");
|
||||||
fprintf(stderr, "Use a transmitter/receiver without emphasis and let me do that!\n");
|
fprintf(stderr, "Use a transmitter/receiver without emphasis and let me do that!\n");
|
||||||
fprintf(stderr, "Because carrier FSK signaling and scrambled voice (default) does not use\n");
|
fprintf(stderr, "Because carrier FSK signaling and scrambled voice (default) does not use\n");
|
||||||
fprintf(stderr, "emphasis, I like to control emphasis by myself for best results.\n");
|
fprintf(stderr, "emphasis, I like to control emphasis by myself for best results.\n");
|
||||||
|
@ -301,7 +301,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* create transceiver instance */
|
/* create transceiver instance */
|
||||||
for (i = 0; i < num_kanal; i++) {
|
for (i = 0; i < num_kanal; i++) {
|
||||||
rc = cnetz_create(kanal[i], chan_type[i], sounddev[i], samplerate, cross_channels, rx_gain, auth, ms_power, (i == 0) ? measure_speed : 0, clock_speed, polarity, noise, do_pre_emphasis, do_de_emphasis, write_wave, read_wave, loopback);
|
rc = cnetz_create(kanal[i], chan_type[i], sounddev[i], samplerate, cross_channels, rx_gain, auth, ms_power, (i == 0) ? measure_speed : 0, clock_speed, polarity, noise, do_pre_emphasis, do_de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, loopback);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
|
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
@ -15,8 +15,9 @@ extern int use_mncc_sock;
|
||||||
extern int send_patterns;
|
extern int send_patterns;
|
||||||
extern int loopback;
|
extern int loopback;
|
||||||
extern int rt_prio;
|
extern int rt_prio;
|
||||||
extern const char *read_wave;
|
extern const char *write_rx_wave;
|
||||||
extern const char *write_wave;
|
extern const char *write_tx_wave;
|
||||||
|
extern const char *read_rx_wave;
|
||||||
|
|
||||||
void print_help(const char *arg0);
|
void print_help(const char *arg0);
|
||||||
void print_help_common(const char *arg0, const char *ext_usage);
|
void print_help_common(const char *arg0, const char *ext_usage);
|
||||||
|
|
|
@ -51,8 +51,9 @@ int send_patterns = 1;
|
||||||
int release_on_disconnect = 1;
|
int release_on_disconnect = 1;
|
||||||
int loopback = 0;
|
int loopback = 0;
|
||||||
int rt_prio = 0;
|
int rt_prio = 0;
|
||||||
const char *read_wave = NULL;
|
const char *write_rx_wave = NULL;
|
||||||
const char *write_wave = NULL;
|
const char *write_tx_wave = NULL;
|
||||||
|
const char *read_rx_wave = NULL;
|
||||||
|
|
||||||
void print_help_common(const char *arg0, const char *ext_usage)
|
void print_help_common(const char *arg0, const char *ext_usage)
|
||||||
{
|
{
|
||||||
|
@ -61,14 +62,15 @@ void print_help_common(const char *arg0, const char *ext_usage)
|
||||||
/* - - */
|
/* - - */
|
||||||
printf(" -h --help\n");
|
printf(" -h --help\n");
|
||||||
printf(" This help\n");
|
printf(" This help\n");
|
||||||
printf(" -D --debug <level> | <level>,<category>[,<category>[,...]] | list\n");
|
printf(" -v --verbose <level> | <level>,<category>[,<category>[,...]] | list\n");
|
||||||
printf(" Use 'list' to get a list of all levels and categories\n");
|
printf(" Use 'list' to get a list of all levels and categories\n");
|
||||||
printf(" Debug level: digit of debug level (default = '%d')\n", debuglevel);
|
printf(" Verbose level: digit of debug level (default = '%d')\n", debuglevel);
|
||||||
printf(" Debug level+category: level digit followed by one or more categories\n");
|
printf(" Verbose level+category: level digit followed by one or more categories\n");
|
||||||
printf(" -> If no category is specified, all categories are selected\n");
|
printf(" -> If no category is specified, all categories are selected\n");
|
||||||
printf(" -k --kanal <channel>\n");
|
printf(" -k --kanal <channel>\n");
|
||||||
printf(" Channel number of \"Sender\"\n");
|
printf(" -k --channel <channel>\n");
|
||||||
printf(" -d --device hw:<card>,<device>\n");
|
printf(" Channel (German = Kanal) number of \"Sender\" (German = Transceiver)\n");
|
||||||
|
printf(" -a --audio-device hw:<card>,<device>\n");
|
||||||
printf(" Sound card and device number (default = '%s')\n", sounddev[0]);
|
printf(" Sound card and device number (default = '%s')\n", sounddev[0]);
|
||||||
printf(" -s --samplerate <rate>\n");
|
printf(" -s --samplerate <rate>\n");
|
||||||
printf(" Sample rate of sound device (default = '%d')\n", samplerate);
|
printf(" Sample rate of sound device (default = '%d')\n", samplerate);
|
||||||
|
@ -76,18 +78,18 @@ void print_help_common(const char *arg0, const char *ext_usage)
|
||||||
printf(" Interval of processing loop in ms (default = '%d' ms)\n", interval);
|
printf(" Interval of processing loop in ms (default = '%d' ms)\n", interval);
|
||||||
printf(" Use 25 to drastically reduce CPU usage. In case of buffer underrun,\n");
|
printf(" Use 25 to drastically reduce CPU usage. In case of buffer underrun,\n");
|
||||||
printf(" increase latency accordingly.\n");
|
printf(" increase latency accordingly.\n");
|
||||||
printf(" -l --latency <delay>\n");
|
printf(" -b --buffer <ms>\n");
|
||||||
printf(" How many milliseconds processed in advance (default = '%d')\n", latency);
|
printf(" How many milliseconds are processed in advance (default = '%d')\n", latency);
|
||||||
printf(" -x --cross\n");
|
printf(" -x --cross\n");
|
||||||
printf(" Cross channels on sound card. 1st channel (right) is swapped with\n");
|
printf(" Cross channels on sound card. 1st channel (right) is swapped with\n");
|
||||||
printf(" second channel (left)\n");
|
printf(" second channel (left)\n");
|
||||||
printf(" -E --pre-emphasis\n");
|
printf(" -p --pre-emphasis\n");
|
||||||
printf(" Enable pre-emphasis, if you directly connect to the oscillator of the\n");
|
printf(" Enable pre-emphasis, if you directly connect to the oscillator of the\n");
|
||||||
printf(" transmitter. (No pre-emphasis done by the transmitter.)\n");
|
printf(" transmitter. (No pre-emphasis done by the transmitter.)\n");
|
||||||
printf(" -e --de-emphasis\n");
|
printf(" -d --de-emphasis\n");
|
||||||
printf(" Enable de-emphasis, if you directly connect to the discriminator of\n");
|
printf(" Enable de-emphasis, if you directly connect to the discriminator of\n");
|
||||||
printf(" the receiver. (No de-emphasis done by the receiver.)\n");
|
printf(" the receiver. (No de-emphasis done by the receiver.)\n");
|
||||||
printf(" -G --rx-gain <dB>\n");
|
printf(" -g --rx-gain <dB>\n");
|
||||||
printf(" Raise receiver RX level by given gain in dB. This is useful if input\n");
|
printf(" Raise receiver RX level by given gain in dB. This is useful if input\n");
|
||||||
printf(" level of the sound device is too low, even after setting maximum level\n");
|
printf(" level of the sound device is too low, even after setting maximum level\n");
|
||||||
printf(" with the mixer settings.\n");
|
printf(" with the mixer settings.\n");
|
||||||
|
@ -95,55 +97,80 @@ void print_help_common(const char *arg0, const char *ext_usage)
|
||||||
printf(" Disable built-in call contol and offer socket (to LCR)\n");
|
printf(" Disable built-in call contol and offer socket (to LCR)\n");
|
||||||
printf(" -c --call-device hw:<card>,<device>\n");
|
printf(" -c --call-device hw:<card>,<device>\n");
|
||||||
printf(" Sound card and device number for headset (default = '%s')\n", call_sounddev);
|
printf(" Sound card and device number for headset (default = '%s')\n", call_sounddev);
|
||||||
printf(" -p --send-patterns 0 | 1\n");
|
printf(" -t --tones 0 | 1\n");
|
||||||
printf(" Connect call on setup/release to provide classic tones towards fixed\n");
|
printf(" Connect call on setup/release to provide classic tones towards fixed\n");
|
||||||
printf(" network (default = '%d')\n", send_patterns);
|
printf(" network (default = '%d')\n", send_patterns);
|
||||||
printf(" -L --loopback <type>\n");
|
printf(" -l --loopback <type>\n");
|
||||||
printf(" Loopback test: 1 = internal | 2 = external | 3 = echo\n");
|
printf(" Loopback test: 1 = internal | 2 = external | 3 = echo\n");
|
||||||
printf(" -r --realtime <prio>\n");
|
printf(" -r --realtime <prio>\n");
|
||||||
printf(" Set prio: 0 to diable, 99 for maximum (default = %d)\n", rt_prio);
|
printf(" Set prio: 0 to diable, 99 for maximum (default = %d)\n", rt_prio);
|
||||||
printf(" -W --write-wave <file>\n");
|
printf(" --write-rx-wave <file>\n");
|
||||||
printf(" Write received audio to given wav audio file.\n");
|
printf(" Write received audio to given wav audio file.\n");
|
||||||
printf(" -R --read-wave <file>\n");
|
printf(" --write-tx-wave <file>\n");
|
||||||
|
printf(" Write transmitted audio to given wav audio file.\n");
|
||||||
|
printf(" --read-rx-wave <file>\n");
|
||||||
printf(" Replace received audio by given wav audio file.\n");
|
printf(" Replace received audio by given wav audio file.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define OPT_CHANNEL 1000
|
||||||
|
#define OPT_WRITE_RX_WAVE 1001
|
||||||
|
#define OPT_WRITE_TX_WAVE 1002
|
||||||
|
#define OPT_READ_RX_WAVE 1003
|
||||||
|
|
||||||
static struct option long_options_common[] = {
|
static struct option long_options_common[] = {
|
||||||
{"help", 0, 0, 'h'},
|
{"help", 0, 0, 'h'},
|
||||||
{"debug", 1, 0, 'D'},
|
{"debug", 1, 0, 'v'},
|
||||||
{"kanal", 1, 0, 'k'},
|
{"kanal", 1, 0, 'k'},
|
||||||
{"device", 1, 0, 'd'},
|
{"channel", 1, 0, OPT_CHANNEL},
|
||||||
{"call-device", 1, 0, 'c'},
|
{"call-device", 1, 0, 'a'},
|
||||||
{"samplerate", 1, 0, 's'},
|
{"samplerate", 1, 0, 's'},
|
||||||
{"interval", 1, 0, 'i'},
|
{"interval", 1, 0, 'i'},
|
||||||
{"latency", 1, 0, 'l'},
|
{"buffer", 1, 0, 'b'},
|
||||||
{"cross", 0, 0, 'x'},
|
{"cross", 0, 0, 'x'},
|
||||||
{"pre-emphasis", 0, 0, 'E'},
|
{"pre-emphasis", 0, 0, 'p'},
|
||||||
{"de-emphasis", 0, 0, 'e'},
|
{"de-emphasis", 0, 0, 'd'},
|
||||||
{"rx-gain", 0, 0, 'G'},
|
{"rx-gain", 0, 0, 'g'},
|
||||||
{"mncc-sock", 0, 0, 'm'},
|
{"mncc-sock", 0, 0, 'm'},
|
||||||
{"send-patterns", 0, 0, 'p'},
|
{"call-device", 1, 0, 'c'},
|
||||||
{"loopback", 1, 0, 'L'},
|
{"tones", 0, 0, 't'},
|
||||||
|
{"loopback", 1, 0, 'l'},
|
||||||
{"realtime", 1, 0, 'r'},
|
{"realtime", 1, 0, 'r'},
|
||||||
{"write-wave", 1, 0, 'W'},
|
{"write-rx-wave", 1, 0, OPT_WRITE_RX_WAVE},
|
||||||
{"read-wave", 1, 0, 'R'},
|
{"write-tx-wave", 1, 0, OPT_WRITE_TX_WAVE},
|
||||||
|
{"read-rx-wave", 1, 0, OPT_READ_RX_WAVE},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *optstring_common = "hD:k:d:s:c:i:l:xEeG:mp:L:r:W:R:";
|
const char *optstring_common = "hv:k:a:s:i:b:xpdg:mc:t:l:r:";
|
||||||
|
|
||||||
struct option *long_options;
|
struct option *long_options;
|
||||||
char *optstring;
|
char *optstring;
|
||||||
|
|
||||||
|
static void check_duplicate_option(int num, struct option *option)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < num; i++) {
|
||||||
|
if (long_options[i].val == option->val) {
|
||||||
|
fprintf(stderr, "Duplicate option %d. Please fix!\n", option->val);
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void set_options_common(const char *optstring_special, struct option *long_options_special)
|
void set_options_common(const char *optstring_special, struct option *long_options_special)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
long_options = calloc(sizeof(*long_options), 100);
|
long_options = calloc(sizeof(*long_options), 100);
|
||||||
for (i = 0; long_options_common[i].name; i++)
|
for (i = 0; long_options_common[i].name; i++) {
|
||||||
|
check_duplicate_option(i, &long_options_common[i]);
|
||||||
memcpy(&long_options[i], &long_options_common[i], sizeof(*long_options));
|
memcpy(&long_options[i], &long_options_common[i], sizeof(*long_options));
|
||||||
for (; long_options_special->name; i++)
|
}
|
||||||
|
for (; long_options_special->name; i++) {
|
||||||
|
check_duplicate_option(i, long_options_special);
|
||||||
memcpy(&long_options[i], long_options_special++, sizeof(*long_options));
|
memcpy(&long_options[i], long_options_special++, sizeof(*long_options));
|
||||||
|
}
|
||||||
|
|
||||||
optstring = calloc(strlen(optstring_common) + strlen(optstring_special) + 1, 1);
|
optstring = calloc(strlen(optstring_common) + strlen(optstring_special) + 1, 1);
|
||||||
strcpy(optstring, optstring_common);
|
strcpy(optstring, optstring_common);
|
||||||
|
@ -158,7 +185,7 @@ void opt_switch_common(int c, char *arg0, int *skip_args)
|
||||||
case 'h':
|
case 'h':
|
||||||
print_help(arg0);
|
print_help(arg0);
|
||||||
exit(0);
|
exit(0);
|
||||||
case 'D':
|
case 'v':
|
||||||
if (!strcasecmp(optarg, "list")) {
|
if (!strcasecmp(optarg, "list")) {
|
||||||
debug_list_cat();
|
debug_list_cat();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
@ -170,10 +197,11 @@ void opt_switch_common(int c, char *arg0, int *skip_args)
|
||||||
*skip_args += 2;
|
*skip_args += 2;
|
||||||
break;
|
break;
|
||||||
case 'k':
|
case 'k':
|
||||||
|
case OPT_CHANNEL:
|
||||||
OPT_ARRAY(num_kanal, kanal, atoi(optarg))
|
OPT_ARRAY(num_kanal, kanal, atoi(optarg))
|
||||||
*skip_args += 2;
|
*skip_args += 2;
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'a':
|
||||||
OPT_ARRAY(num_sounddev, sounddev, strdup(optarg))
|
OPT_ARRAY(num_sounddev, sounddev, strdup(optarg))
|
||||||
*skip_args += 2;
|
*skip_args += 2;
|
||||||
break;
|
break;
|
||||||
|
@ -181,10 +209,6 @@ void opt_switch_common(int c, char *arg0, int *skip_args)
|
||||||
samplerate = atoi(optarg);
|
samplerate = atoi(optarg);
|
||||||
*skip_args += 2;
|
*skip_args += 2;
|
||||||
break;
|
break;
|
||||||
case 'c':
|
|
||||||
call_sounddev = strdup(optarg);
|
|
||||||
*skip_args += 2;
|
|
||||||
break;
|
|
||||||
case 'i':
|
case 'i':
|
||||||
interval = atoi(optarg);
|
interval = atoi(optarg);
|
||||||
*skip_args += 2;
|
*skip_args += 2;
|
||||||
|
@ -193,7 +217,7 @@ void opt_switch_common(int c, char *arg0, int *skip_args)
|
||||||
if (interval > 25)
|
if (interval > 25)
|
||||||
interval = 25;
|
interval = 25;
|
||||||
break;
|
break;
|
||||||
case 'l':
|
case 'b':
|
||||||
latency = atoi(optarg);
|
latency = atoi(optarg);
|
||||||
*skip_args += 2;
|
*skip_args += 2;
|
||||||
break;
|
break;
|
||||||
|
@ -201,15 +225,15 @@ void opt_switch_common(int c, char *arg0, int *skip_args)
|
||||||
cross_channels = 1;
|
cross_channels = 1;
|
||||||
*skip_args += 1;
|
*skip_args += 1;
|
||||||
break;
|
break;
|
||||||
case 'E':
|
case 'p':
|
||||||
do_pre_emphasis = 1;
|
do_pre_emphasis = 1;
|
||||||
*skip_args += 1;
|
*skip_args += 1;
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'd':
|
||||||
do_de_emphasis = 1;
|
do_de_emphasis = 1;
|
||||||
*skip_args += 1;
|
*skip_args += 1;
|
||||||
break;
|
break;
|
||||||
case 'G':
|
case 'g':
|
||||||
gain_db = atof(optarg);
|
gain_db = atof(optarg);
|
||||||
if (gain_db < 0.0) {
|
if (gain_db < 0.0) {
|
||||||
fprintf(stderr, "Given gain is below 0. Tto reduce RX signal, use sound card's mixer (or resistor net)!\n");
|
fprintf(stderr, "Given gain is below 0. Tto reduce RX signal, use sound card's mixer (or resistor net)!\n");
|
||||||
|
@ -222,11 +246,15 @@ void opt_switch_common(int c, char *arg0, int *skip_args)
|
||||||
use_mncc_sock = 1;
|
use_mncc_sock = 1;
|
||||||
*skip_args += 1;
|
*skip_args += 1;
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'c':
|
||||||
|
call_sounddev = strdup(optarg);
|
||||||
|
*skip_args += 2;
|
||||||
|
break;
|
||||||
|
case 't':
|
||||||
send_patterns = atoi(optarg);
|
send_patterns = atoi(optarg);
|
||||||
*skip_args += 2;
|
*skip_args += 2;
|
||||||
break;
|
break;
|
||||||
case 'L':
|
case 'l':
|
||||||
loopback = atoi(optarg);
|
loopback = atoi(optarg);
|
||||||
*skip_args += 2;
|
*skip_args += 2;
|
||||||
break;
|
break;
|
||||||
|
@ -234,12 +262,16 @@ void opt_switch_common(int c, char *arg0, int *skip_args)
|
||||||
rt_prio = atoi(optarg);
|
rt_prio = atoi(optarg);
|
||||||
*skip_args += 2;
|
*skip_args += 2;
|
||||||
break;
|
break;
|
||||||
case 'W':
|
case OPT_WRITE_RX_WAVE:
|
||||||
write_wave = strdup(optarg);
|
write_rx_wave = strdup(optarg);
|
||||||
*skip_args += 2;
|
*skip_args += 2;
|
||||||
break;
|
break;
|
||||||
case 'R':
|
case OPT_WRITE_TX_WAVE:
|
||||||
read_wave = strdup(optarg);
|
write_tx_wave = strdup(optarg);
|
||||||
|
*skip_args += 2;
|
||||||
|
break;
|
||||||
|
case OPT_READ_RX_WAVE:
|
||||||
|
read_rx_wave = strdup(optarg);
|
||||||
*skip_args += 2;
|
*skip_args += 2;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -17,9 +17,6 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Uncomment this for writing TX as wave (For debug purpose) */
|
|
||||||
//#define WAVE_WRITE_TX
|
|
||||||
|
|
||||||
#define CHAN sender->kanal
|
#define CHAN sender->kanal
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -35,7 +32,7 @@ static sender_t **sender_tailp = &sender_head;
|
||||||
int cant_recover = 0;
|
int cant_recover = 0;
|
||||||
|
|
||||||
/* Init transceiver instance and link to list of transceivers. */
|
/* Init transceiver instance and link to list of transceivers. */
|
||||||
int sender_create(sender_t *sender, int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, int loopback, double loss_volume, enum pilot_signal pilot_signal)
|
int sender_create(sender_t *sender, int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, int loopback, double loss_volume, enum pilot_signal pilot_signal)
|
||||||
{
|
{
|
||||||
sender_t *master;
|
sender_t *master;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
@ -115,15 +112,22 @@ int sender_create(sender_t *sender, int kanal, const char *sounddev, int sampler
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (write_wave) {
|
if (write_rx_wave) {
|
||||||
rc = wave_create_record(&sender->wave_rec, write_wave, samplerate);
|
rc = wave_create_record(&sender->wave_rx_rec, write_rx_wave, samplerate);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
PDEBUG(DSENDER, DEBUG_ERROR, "Failed to create WAVE recoding instance!\n");
|
PDEBUG(DSENDER, DEBUG_ERROR, "Failed to create WAVE recoding instance!\n");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (read_wave) {
|
if (write_tx_wave) {
|
||||||
rc = wave_create_playback(&sender->wave_play, read_wave, samplerate);
|
rc = wave_create_record(&sender->wave_tx_rec, write_tx_wave, samplerate);
|
||||||
|
if (rc < 0) {
|
||||||
|
PDEBUG(DSENDER, DEBUG_ERROR, "Failed to create WAVE recoding instance!\n");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (read_rx_wave) {
|
||||||
|
rc = wave_create_playback(&sender->wave_rx_play, read_rx_wave, samplerate);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
PDEBUG(DSENDER, DEBUG_ERROR, "Failed to create WAVE playback instance!\n");
|
PDEBUG(DSENDER, DEBUG_ERROR, "Failed to create WAVE playback instance!\n");
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -169,8 +173,9 @@ void sender_destroy(sender_t *sender)
|
||||||
sender->sound = NULL;
|
sender->sound = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wave_destroy_record(&sender->wave_rec);
|
wave_destroy_record(&sender->wave_rx_rec);
|
||||||
wave_destroy_playback(&sender->wave_play);
|
wave_destroy_record(&sender->wave_tx_rec);
|
||||||
|
wave_destroy_playback(&sender->wave_rx_play);
|
||||||
|
|
||||||
jitter_destroy(&sender->audio);
|
jitter_destroy(&sender->audio);
|
||||||
}
|
}
|
||||||
|
@ -239,18 +244,14 @@ cant_recover:
|
||||||
jitter_load(&sender->audio, samples, count);
|
jitter_load(&sender->audio, samples, count);
|
||||||
else
|
else
|
||||||
sender_send(sender, samples, count);
|
sender_send(sender, samples, count);
|
||||||
#ifdef WAVE_WRITE_TX
|
if (sender->wave_tx_rec.fp)
|
||||||
if (sender->wave_rec.fp)
|
wave_write(&sender->wave_tx_rec, samples, count);
|
||||||
wave_write(&sender->wave_rec, samples, count);
|
|
||||||
#endif
|
|
||||||
/* internal loopback: loop back TX audio to RX */
|
/* internal loopback: loop back TX audio to RX */
|
||||||
if (sender->loopback == 1) {
|
if (sender->loopback == 1) {
|
||||||
#ifndef WAVE_WRITE_TX
|
if (sender->wave_rx_rec.fp)
|
||||||
if (sender->wave_rec.fp)
|
wave_write(&sender->wave_rx_rec, samples, count);
|
||||||
wave_write(&sender->wave_rec, samples, count);
|
|
||||||
display_wave(sender, samples, count);
|
display_wave(sender, samples, count);
|
||||||
sender_receive(sender, samples, count);
|
sender_receive(sender, samples, count);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
/* do pre emphasis towards radio, not wave_write */
|
/* do pre emphasis towards radio, not wave_write */
|
||||||
if (sender->pre_emphasis)
|
if (sender->pre_emphasis)
|
||||||
|
@ -261,16 +262,12 @@ cant_recover:
|
||||||
jitter_load(&slave->audio, slave_samples, count);
|
jitter_load(&slave->audio, slave_samples, count);
|
||||||
else
|
else
|
||||||
sender_send(slave, slave_samples, count);
|
sender_send(slave, slave_samples, count);
|
||||||
#ifdef WAVE_WRITE_TX
|
if (sender->wave_tx_rec.fp)
|
||||||
if (sender->wave_rec.fp)
|
wave_write(&slave->wave_tx_rec, slave_samples, count);
|
||||||
wave_write(&slave->wave_rec, slave_samples, count);
|
|
||||||
#endif
|
|
||||||
/* internal loopback, if audio slave is set */
|
/* internal loopback, if audio slave is set */
|
||||||
if (slave && slave->loopback == 1) {
|
if (slave && slave->loopback == 1) {
|
||||||
#ifndef WAVE_WRITE_TX
|
if (slave->wave_rx_rec.fp)
|
||||||
if (slave->wave_rec.fp)
|
wave_write(&slave->wave_rx_rec, slave_samples, count);
|
||||||
wave_write(&slave->wave_rec, slave_samples, count);
|
|
||||||
#endif
|
|
||||||
display_wave(slave, slave_samples, count);
|
display_wave(slave, slave_samples, count);
|
||||||
sender_receive(slave, slave_samples, count);
|
sender_receive(slave, slave_samples, count);
|
||||||
}
|
}
|
||||||
|
@ -371,13 +368,11 @@ cant_recover:
|
||||||
/* do de emphasis from radio (then write_wave/wave_read), receive audio, process echo test */
|
/* do de emphasis from radio (then write_wave/wave_read), receive audio, process echo test */
|
||||||
if (sender->de_emphasis)
|
if (sender->de_emphasis)
|
||||||
de_emphasis(&sender->estate, samples, count);
|
de_emphasis(&sender->estate, samples, count);
|
||||||
if (sender->wave_play.fp)
|
if (sender->wave_rx_play.fp)
|
||||||
wave_read(&sender->wave_play, samples, count);
|
wave_read(&sender->wave_rx_play, samples, count);
|
||||||
if (sender->loopback != 1) {
|
if (sender->loopback != 1) {
|
||||||
#ifndef WAVE_WRITE_TX
|
if (sender->wave_rx_rec.fp)
|
||||||
if (sender->wave_rec.fp)
|
wave_write(&sender->wave_rx_rec, samples, count);
|
||||||
wave_write(&sender->wave_rec, samples, count);
|
|
||||||
#endif
|
|
||||||
display_wave(sender, samples, count);
|
display_wave(sender, samples, count);
|
||||||
sender_receive(sender, samples, count);
|
sender_receive(sender, samples, count);
|
||||||
}
|
}
|
||||||
|
@ -389,13 +384,11 @@ cant_recover:
|
||||||
gain_samples(slave_samples, count, slave->rx_gain);
|
gain_samples(slave_samples, count, slave->rx_gain);
|
||||||
if (slave->de_emphasis)
|
if (slave->de_emphasis)
|
||||||
de_emphasis(&slave->estate, slave_samples, count);
|
de_emphasis(&slave->estate, slave_samples, count);
|
||||||
if (slave->wave_play.fp)
|
if (slave->wave_rx_play.fp)
|
||||||
wave_read(&slave->wave_play, slave_samples, count);
|
wave_read(&slave->wave_rx_play, slave_samples, count);
|
||||||
if (slave->loopback != 1) {
|
if (slave->loopback != 1) {
|
||||||
#ifndef WAVE_WRITE_TX
|
if (slave->wave_rx_rec.fp)
|
||||||
if (slave->wave_rec.fp)
|
wave_write(&slave->wave_rx_rec, slave_samples, count);
|
||||||
wave_write(&slave->wave_rec, slave_samples, count);
|
|
||||||
#endif
|
|
||||||
display_wave(slave, slave_samples, count);
|
display_wave(slave, slave_samples, count);
|
||||||
sender_receive(slave, slave_samples, count);
|
sender_receive(slave, slave_samples, count);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,9 @@ typedef struct sender {
|
||||||
int loopback; /* 0 = off, 1 = internal, 2 = external */
|
int loopback; /* 0 = off, 1 = internal, 2 = external */
|
||||||
|
|
||||||
/* record and playback */
|
/* record and playback */
|
||||||
wave_rec_t wave_rec; /* wave recording */
|
wave_rec_t wave_rx_rec; /* wave recording (from rx) */
|
||||||
wave_play_t wave_play; /* wave playback */
|
wave_rec_t wave_tx_rec; /* wave recording (from tx) */
|
||||||
|
wave_play_t wave_rx_play; /* wave playback (as rx) */
|
||||||
|
|
||||||
/* audio buffer for audio to send to transmitter (also used as loopback buffer) */
|
/* audio buffer for audio to send to transmitter (also used as loopback buffer) */
|
||||||
jitter_t audio;
|
jitter_t audio;
|
||||||
|
@ -69,7 +70,7 @@ typedef struct sender {
|
||||||
extern sender_t *sender_head;
|
extern sender_t *sender_head;
|
||||||
extern int cant_recover;
|
extern int cant_recover;
|
||||||
|
|
||||||
int sender_create(sender_t *sender, int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, int loopback, double loss_volume, enum pilot_signal pilot_signal);
|
int sender_create(sender_t *sender, int kanal, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, int loopback, double loss_volume, enum pilot_signal pilot_signal);
|
||||||
void sender_destroy(sender_t *sender);
|
void sender_destroy(sender_t *sender);
|
||||||
void process_sender_audio(sender_t *sender, int *quit, int latspl);
|
void process_sender_audio(sender_t *sender, int *quit, int latspl);
|
||||||
void sender_send(sender_t *sender, int16_t *samples, int count);
|
void sender_send(sender_t *sender, int16_t *samples, int count);
|
||||||
|
|
|
@ -56,12 +56,12 @@ void print_help(const char *arg0)
|
||||||
{
|
{
|
||||||
print_help_common(arg0, "-y <traffic area> | list [-I]");
|
print_help_common(arg0, "-y <traffic area> | list [-I]");
|
||||||
/* - - */
|
/* - - */
|
||||||
printf(" -t --channel-type <channel type> | list\n");
|
printf(" -T --channel-type <channel type> | list\n");
|
||||||
printf(" Give channel type, use 'list' to get a list. (default = '%s')\n", chan_type_short_name(chan_type[0]));
|
printf(" Give channel type, use 'list' to get a list. (default = '%s')\n", chan_type_short_name(chan_type[0]));
|
||||||
printf(" -P --ms-power <power level>\n");
|
printf(" -P --ms-power <power level>\n");
|
||||||
printf(" Give power level of the mobile station 1..3. (default = '%d')\n", ms_power);
|
printf(" Give power level of the mobile station 1..3. (default = '%d')\n", ms_power);
|
||||||
printf(" 3 = 15 W / 7 W (handheld), 2 = 1.5 W, 1 = 150 mW\n");
|
printf(" 3 = 15 W / 7 W (handheld), 2 = 1.5 W, 1 = 150 mW\n");
|
||||||
printf(" -y --traffic-area <traffic area> | list\n");
|
printf(" -Y --traffic-area <traffic area> | list\n");
|
||||||
printf(" NOTE: MUST MATCH WITH YOUR ROAMING SETTINGS IN THE PHONE!\n");
|
printf(" NOTE: MUST MATCH WITH YOUR ROAMING SETTINGS IN THE PHONE!\n");
|
||||||
printf(" Your phone will not connect, if country code is different!\n");
|
printf(" Your phone will not connect, if country code is different!\n");
|
||||||
printf(" Give two digits of traffic area, the first digit defines the country\n");
|
printf(" Give two digits of traffic area, the first digit defines the country\n");
|
||||||
|
@ -69,7 +69,7 @@ void print_help(const char *arg0)
|
||||||
printf(" Alternatively you can give the short code for country and the cell\n");
|
printf(" Alternatively you can give the short code for country and the cell\n");
|
||||||
printf(" area seperated by comma. (Example: SE,1 = Sweden, cell 1)\n");
|
printf(" area seperated by comma. (Example: SE,1 = Sweden, cell 1)\n");
|
||||||
printf(" Use 'list' to get a list of available short country code names\n");
|
printf(" Use 'list' to get a list of available short country code names\n");
|
||||||
printf(" -a --area-number <area no> | 0\n");
|
printf(" -A --area-number <area no> | 0\n");
|
||||||
printf(" Give area number 1..4 or 0 for no area number. (default = '%d')\n", area_no);
|
printf(" Give area number 1..4 or 0 for no area number. (default = '%d')\n", area_no);
|
||||||
printf(" -C --compandor 1 | 0\n");
|
printf(" -C --compandor 1 | 0\n");
|
||||||
printf(" Make use of the compandor to reduce noise during call. (default = '%d')\n", compandor);
|
printf(" Make use of the compandor to reduce noise during call. (default = '%d')\n", compandor);
|
||||||
|
@ -91,10 +91,10 @@ static int handle_options(int argc, char **argv)
|
||||||
int skip_args = 0;
|
int skip_args = 0;
|
||||||
|
|
||||||
static struct option long_options_special[] = {
|
static struct option long_options_special[] = {
|
||||||
{"channel-type", 1, 0, 't'},
|
{"channel-type", 1, 0, 'T'},
|
||||||
{"ms-power", 1, 0, 'P'},
|
{"ms-power", 1, 0, 'P'},
|
||||||
{"area-number", 1, 0, 'a'},
|
{"traffic-area", 1, 0, 'Y'},
|
||||||
{"traffic-area", 1, 0, 'y'},
|
{"area-number", 1, 0, 'A'},
|
||||||
{"compandor", 1, 0, 'C'},
|
{"compandor", 1, 0, 'C'},
|
||||||
{"supervisory", 1, 0, '0'},
|
{"supervisory", 1, 0, '0'},
|
||||||
{"smsc-number", 1, 0, 'S'},
|
{"smsc-number", 1, 0, 'S'},
|
||||||
|
@ -102,7 +102,7 @@ static int handle_options(int argc, char **argv)
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
set_options_common("t:P:a:y:C:0:S:I:", long_options_special);
|
set_options_common("T:P:Y:A:C:0:S:I:", long_options_special);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
int option_index = 0, c, rc;
|
int option_index = 0, c, rc;
|
||||||
|
@ -113,7 +113,7 @@ static int handle_options(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 't':
|
case 'T':
|
||||||
if (!strcmp(optarg, "list")) {
|
if (!strcmp(optarg, "list")) {
|
||||||
nmt_channel_list();
|
nmt_channel_list();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
@ -134,15 +134,7 @@ static int handle_options(int argc, char **argv)
|
||||||
ms_power = 1;
|
ms_power = 1;
|
||||||
skip_args += 2;
|
skip_args += 2;
|
||||||
break;
|
break;
|
||||||
case 'a':
|
case 'Y':
|
||||||
area_no = optarg[0] - '0';
|
|
||||||
if (area_no > 4) {
|
|
||||||
fprintf(stderr, "Area number '%s' out of range, please use 1..4 or 0 for no area\n", optarg);
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
skip_args += 2;
|
|
||||||
break;
|
|
||||||
case 'y':
|
|
||||||
|
|
||||||
if (!strcmp(optarg, "list")) {
|
if (!strcmp(optarg, "list")) {
|
||||||
nmt_country_list();
|
nmt_country_list();
|
||||||
|
@ -178,6 +170,14 @@ error_ta:
|
||||||
}
|
}
|
||||||
skip_args += 2;
|
skip_args += 2;
|
||||||
break;
|
break;
|
||||||
|
case 'A':
|
||||||
|
area_no = optarg[0] - '0';
|
||||||
|
if (area_no > 4) {
|
||||||
|
fprintf(stderr, "Area number '%s' out of range, please use 1..4 or 0 for no area\n", optarg);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
skip_args += 2;
|
||||||
|
break;
|
||||||
case 'C':
|
case 'C':
|
||||||
compandor = atoi(optarg);
|
compandor = atoi(optarg);
|
||||||
skip_args += 2;
|
skip_args += 2;
|
||||||
|
@ -342,7 +342,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* create transceiver instance */
|
/* create transceiver instance */
|
||||||
for (i = 0; i < num_kanal; i++) {
|
for (i = 0; i < num_kanal; i++) {
|
||||||
rc = nmt_create(kanal[i], (loopback) ? CHAN_TYPE_TEST : chan_type[i], sounddev[i], samplerate, cross_channels, rx_gain, do_pre_emphasis, do_de_emphasis, write_wave, read_wave, ms_power, nmt_digits2value(traffic_area, 2), area_no, compandor, supervisory, smsc_number, send_callerid, loopback);
|
rc = nmt_create(kanal[i], (loopback) ? CHAN_TYPE_TEST : chan_type[i], sounddev[i], samplerate, cross_channels, rx_gain, do_pre_emphasis, do_de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, ms_power, nmt_digits2value(traffic_area, 2), area_no, compandor, supervisory, smsc_number, send_callerid, loopback);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
fprintf(stderr, "Failed to create transceiver instance. Quitting!\n");
|
fprintf(stderr, "Failed to create transceiver instance. Quitting!\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
@ -303,7 +303,7 @@ uint8_t nmt_country_by_short_name(const char *short_name)
|
||||||
static void nmt_timeout(struct timer *timer);
|
static void nmt_timeout(struct timer *timer);
|
||||||
|
|
||||||
/* Create transceiver instance and link to a list. */
|
/* Create transceiver instance and link to a list. */
|
||||||
int nmt_create(int channel, enum nmt_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compandor, int supervisory, const char *smsc_number, int send_callerid, int loopback)
|
int nmt_create(int channel, enum nmt_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compandor, int supervisory, const char *smsc_number, int send_callerid, int loopback)
|
||||||
{
|
{
|
||||||
nmt_t *nmt;
|
nmt_t *nmt;
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -334,7 +334,7 @@ int nmt_create(int channel, enum nmt_chan_type chan_type, const char *sounddev,
|
||||||
PDEBUG(DNMT, DEBUG_DEBUG, "Creating 'NMT' instance for channel = %d (sample rate %d).\n", channel, samplerate);
|
PDEBUG(DNMT, DEBUG_DEBUG, "Creating 'NMT' instance for channel = %d (sample rate %d).\n", channel, samplerate);
|
||||||
|
|
||||||
/* init general part of transceiver */
|
/* init general part of transceiver */
|
||||||
rc = sender_create(&nmt->sender, channel, sounddev, samplerate, cross_channels, rx_gain, pre_emphasis, de_emphasis, write_wave, read_wave, loopback, 0, PILOT_SIGNAL_NONE);
|
rc = sender_create(&nmt->sender, channel, sounddev, samplerate, cross_channels, rx_gain, pre_emphasis, de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, loopback, 0, PILOT_SIGNAL_NONE);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
PDEBUG(DNMT, DEBUG_ERROR, "Failed to init transceiver process!\n");
|
PDEBUG(DNMT, DEBUG_ERROR, "Failed to init transceiver process!\n");
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -140,7 +140,7 @@ const char *chan_type_long_name(enum nmt_chan_type chan_type);
|
||||||
double nmt_channel2freq(int channel, int uplink);
|
double nmt_channel2freq(int channel, int uplink);
|
||||||
void nmt_country_list(void);
|
void nmt_country_list(void);
|
||||||
uint8_t nmt_country_by_short_name(const char *short_name);
|
uint8_t nmt_country_by_short_name(const char *short_name);
|
||||||
int nmt_create(int channel, enum nmt_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compandor, int supervisory, const char *smsc_number, int send_callerid, int loopback);
|
int nmt_create(int channel, enum nmt_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compandor, int supervisory, const char *smsc_number, int send_callerid, int loopback);
|
||||||
void nmt_check_channels(void);
|
void nmt_check_channels(void);
|
||||||
void nmt_destroy(sender_t *sender);
|
void nmt_destroy(sender_t *sender);
|
||||||
void nmt_go_idle(nmt_t *nmt);
|
void nmt_go_idle(nmt_t *nmt);
|
||||||
|
|
Loading…
Reference in New Issue