mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-15 02:07:24 -05:00
Direct all prints to STDERR
Direct all prints to STDERR Take 2
This commit is contained in:
300
src/dsd_main.c
300
src/dsd_main.c
@@ -39,14 +39,14 @@
|
||||
|
||||
int pretty_colors()
|
||||
{
|
||||
printf("%sred\n", KRED);
|
||||
printf("%sgreen\n", KGRN);
|
||||
printf("%syellow\n", KYEL);
|
||||
printf("%sblue\n", KBLU);
|
||||
printf("%smagenta\n", KMAG);
|
||||
printf("%scyan\n", KCYN);
|
||||
printf("%swhite\n", KWHT);
|
||||
printf("%snormal\n", KNRM);
|
||||
fprintf (stderr,"%sred\n", KRED);
|
||||
fprintf (stderr,"%sgreen\n", KGRN);
|
||||
fprintf (stderr,"%syellow\n", KYEL);
|
||||
fprintf (stderr,"%sblue\n", KBLU);
|
||||
fprintf (stderr,"%smagenta\n", KMAG);
|
||||
fprintf (stderr,"%scyan\n", KCYN);
|
||||
fprintf (stderr,"%swhite\n", KWHT);
|
||||
fprintf (stderr,"%snormal\n", KNRM);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -300,81 +300,81 @@ initState (dsd_state * state)
|
||||
void
|
||||
usage ()
|
||||
{
|
||||
printf ("\nFME build:%s", GIT_TAG);
|
||||
printf ("\n");
|
||||
printf ("Usage: dsd [options] Live scanner mode\n");
|
||||
printf (" or: dsd [options] -r <files> Read/Play saved mbe data from file(s)\n");
|
||||
printf (" or: dsd -h Show help\n");
|
||||
printf ("\n");
|
||||
printf ("Display Options:\n");
|
||||
printf (" -e Show Frame Info and errorbars (default)\n");
|
||||
printf (" -pe Show P25 encryption sync bits\n");
|
||||
printf (" -pl Show P25 link control bits\n");
|
||||
printf (" -ps Show P25 status bits and low speed data\n");
|
||||
printf (" -pt Show P25 talkgroup info\n");
|
||||
printf (" -q Don't show Frame Info/errorbars\n");
|
||||
printf (" -s Datascope (disables other display options)\n");
|
||||
printf (" -t Show symbol timing during sync\n");
|
||||
printf (" -v <num> Frame information Verbosity\n");
|
||||
printf (" -z <num> Frame rate for datascope\n");
|
||||
printf ("\n");
|
||||
printf ("Input/Output options:\n");
|
||||
//printf (" -i <device> Audio input device (default is /dev/audio, - for piped stdin, rtl for rtl device)\n");
|
||||
printf (" -i <device> Audio input device (default is pulse audio, - for piped stdin, rtl for rtl device)\n");
|
||||
//printf (" -o <device> Audio output device (default is /dev/audio)\n");
|
||||
printf (" -o <device> Audio output device (default is pulse audio)\n");
|
||||
printf (" -d <dir> Create mbe data files, use this directory\n");
|
||||
printf (" -r <files> Read/Play saved mbe data from file(s)\n");
|
||||
printf (" -g <num> Audio output gain (default = 0 = auto, disable = -1)\n");
|
||||
printf (" -n Do not send synthesized speech to audio output device\n");
|
||||
printf (" -w <file> Output synthesized speech to a .wav file\n");
|
||||
printf (" -a Display port audio devices\n");
|
||||
printf (" -W Monitor Source Audio When No Sync Detected (WIP!)\n");
|
||||
printf ("\n");
|
||||
printf ("RTL-SDR options:\n");
|
||||
printf (" -c <hertz> RTL-SDR Frequency\n");
|
||||
printf (" -P <num> RTL-SDR PPM Error (default = 0)\n");
|
||||
printf (" -D <num> RTL-SDR Device Index Number\n");
|
||||
printf (" -G <num> RTL-SDR Device Gain (0-49) (default = 0 Auto Gain)\n");
|
||||
printf (" -L <num> RTL-SDR Squelch Level (0 - Open, 25 - Little, 50 - Higher)(Just have to guess really...)\n");
|
||||
printf (" -V <num> RTL-SDR Sample Gain Multiplier (default = 1)(1-3 recommended, still testing) \n");
|
||||
printf (" -Y <num> RTL-SDR VFO Bandwidth kHz (default = 48)(6, 8, 12, 16, 24, 48) \n");
|
||||
printf (" -U <num> RTL-SDR UDP Remote Port (default = 6020)\n");
|
||||
printf ("\n");
|
||||
printf ("Scanner control options:\n");
|
||||
printf (" -B <num> Serial port baud rate (default=115200)\n");
|
||||
printf (" -C <device> Serial port for scanner control (default=/dev/ttyUSB0)\n");
|
||||
printf (" -R <num> Resume scan after <num> TDULC frames or any PDU or TSDU\n");
|
||||
printf ("\n");
|
||||
printf ("Decoder options:\n");
|
||||
printf (" -fa Auto-detect frame type (default)\n");
|
||||
printf (" -f1 Decode only P25 Phase 1\n");
|
||||
printf (" -fd Decode only D-STAR\n");
|
||||
printf (" -fi Decode only NXDN48* (6.25 kHz) / IDAS*\n");
|
||||
printf (" -fn Decode only NXDN96* (12.5 kHz)\n");
|
||||
printf (" -fp Decode only ProVoice*\n");
|
||||
printf (" -fr Decode only DMR/MOTOTRBO\n");
|
||||
printf (" -fx Decode only X2-TDMA\n");
|
||||
printf (" -l Disable DMR/MOTOTRBO and NXDN input filtering\n");
|
||||
printf (" -ma Auto-select modulation optimizations (default)\n");
|
||||
printf (" -mc Use only C4FM modulation optimizations\n");
|
||||
printf (" -mg Use only GFSK modulation optimizations\n");
|
||||
printf (" -mq Use only QPSK modulation optimizations\n");
|
||||
printf (" -pu Unmute Encrypted P25\n");
|
||||
printf (" -u <num> Unvoiced speech quality (default=3)\n");
|
||||
printf (" -xx Expect non-inverted X2-TDMA signal\n");
|
||||
printf (" -xr Expect inverted DMR/MOTOTRBO signal\n");
|
||||
printf ("\n");
|
||||
printf (" * denotes frame types that cannot be auto-detected.\n");
|
||||
printf ("\n");
|
||||
printf ("Advanced decoder options:\n");
|
||||
printf (" -A <num> QPSK modulation auto detection threshold (default=26)\n");
|
||||
printf (" -S <num> Symbol buffer size for QPSK decision point tracking\n");
|
||||
printf (" (default=36)\n");
|
||||
printf (" -M <num> Min/Max buffer size for QPSK decision point tracking\n");
|
||||
printf (" (default=15)\n");
|
||||
printf ("\n");
|
||||
printf ("Report bugs to: https://github.com/lwvmobile/dsd-fme/issues \n");
|
||||
fprintf (stderr, "\nFME build:%s", GIT_TAG);
|
||||
fprintf (stderr,"\n");
|
||||
fprintf (stderr,"Usage: dsd [options] Live scanner mode\n");
|
||||
fprintf (stderr," or: dsd [options] -r <files> Read/Play saved mbe data from file(s)\n");
|
||||
fprintf (stderr," or: dsd -h Show help\n");
|
||||
fprintf (stderr,"\n");
|
||||
fprintf (stderr,"Display Options:\n");
|
||||
fprintf (stderr," -e Show Frame Info and errorbars (default)\n");
|
||||
fprintf (stderr," -pe Show P25 encryption sync bits\n");
|
||||
fprintf (stderr," -pl Show P25 link control bits\n");
|
||||
fprintf (stderr," -ps Show P25 status bits and low speed data\n");
|
||||
fprintf (stderr," -pt Show P25 talkgroup info\n");
|
||||
fprintf (stderr," -q Don't show Frame Info/errorbars\n");
|
||||
fprintf (stderr," -s Datascope (disables other display options)\n");
|
||||
fprintf (stderr," -t Show symbol timing during sync\n");
|
||||
fprintf (stderr," -v <num> Frame information Verbosity\n");
|
||||
fprintf (stderr," -z <num> Frame rate for datascope\n");
|
||||
fprintf (stderr,"\n");
|
||||
fprintf (stderr,"Input/Output options:\n");
|
||||
//fprintf (stderr," -i <device> Audio input device (default is /dev/audio, - for piped stdin, rtl for rtl device)\n");
|
||||
fprintf (stderr," -i <device> Audio input device (default is pulse audio, - for piped stdin, rtl for rtl device)\n");
|
||||
//fprintf (stderr," -o <device> Audio output device (default is /dev/audio)\n");
|
||||
fprintf (stderr," -o <device> Audio output device (default is pulse audio)\n");
|
||||
fprintf (stderr," -d <dir> Create mbe data files, use this directory\n");
|
||||
fprintf (stderr," -r <files> Read/Play saved mbe data from file(s)\n");
|
||||
fprintf (stderr," -g <num> Audio output gain (default = 0 = auto, disable = -1)\n");
|
||||
fprintf (stderr," -n Do not send synthesized speech to audio output device\n");
|
||||
fprintf (stderr," -w <file> Output synthesized speech to a .wav file\n");
|
||||
fprintf (stderr," -a Display port audio devices\n");
|
||||
fprintf (stderr," -W Monitor Source Audio When No Sync Detected (WIP!)\n");
|
||||
fprintf (stderr,"\n");
|
||||
fprintf (stderr,"RTL-SDR options:\n");
|
||||
fprintf (stderr," -c <hertz> RTL-SDR Frequency\n");
|
||||
fprintf (stderr," -P <num> RTL-SDR PPM Error (default = 0)\n");
|
||||
fprintf (stderr," -D <num> RTL-SDR Device Index Number\n");
|
||||
fprintf (stderr," -G <num> RTL-SDR Device Gain (0-49) (default = 0 Auto Gain)\n");
|
||||
fprintf (stderr," -L <num> RTL-SDR Squelch Level (0 - Open, 25 - Little, 50 - Higher)(Just have to guess really...)\n");
|
||||
fprintf (stderr," -V <num> RTL-SDR Sample Gain Multiplier (default = 1)(1-3 recommended, still testing) \n");
|
||||
fprintf (stderr," -Y <num> RTL-SDR VFO Bandwidth kHz (default = 48)(6, 8, 12, 16, 24, 48) \n");
|
||||
fprintf (stderr," -U <num> RTL-SDR UDP Remote Port (default = 6020)\n");
|
||||
fprintf (stderr,"\n");
|
||||
fprintf (stderr,"Scanner control options:\n");
|
||||
fprintf (stderr," -B <num> Serial port baud rate (default=115200)\n");
|
||||
fprintf (stderr," -C <device> Serial port for scanner control (default=/dev/ttyUSB0)\n");
|
||||
fprintf (stderr," -R <num> Resume scan after <num> TDULC frames or any PDU or TSDU\n");
|
||||
fprintf (stderr,"\n");
|
||||
fprintf (stderr,"Decoder options:\n");
|
||||
fprintf (stderr," -fa Auto-detect frame type (default)\n");
|
||||
fprintf (stderr," -f1 Decode only P25 Phase 1\n");
|
||||
fprintf (stderr," -fd Decode only D-STAR\n");
|
||||
fprintf (stderr," -fi Decode only NXDN48* (6.25 kHz) / IDAS*\n");
|
||||
fprintf (stderr," -fn Decode only NXDN96* (12.5 kHz)\n");
|
||||
fprintf (stderr," -fp Decode only ProVoice*\n");
|
||||
fprintf (stderr," -fr Decode only DMR/MOTOTRBO\n");
|
||||
fprintf (stderr," -fx Decode only X2-TDMA\n");
|
||||
fprintf (stderr," -l Disable DMR/MOTOTRBO and NXDN input filtering\n");
|
||||
fprintf (stderr," -ma Auto-select modulation optimizations (default)\n");
|
||||
fprintf (stderr," -mc Use only C4FM modulation optimizations\n");
|
||||
fprintf (stderr," -mg Use only GFSK modulation optimizations\n");
|
||||
fprintf (stderr," -mq Use only QPSK modulation optimizations\n");
|
||||
fprintf (stderr," -pu Unmute Encrypted P25\n");
|
||||
fprintf (stderr," -u <num> Unvoiced speech quality (default=3)\n");
|
||||
fprintf (stderr," -xx Expect non-inverted X2-TDMA signal\n");
|
||||
fprintf (stderr," -xr Expect inverted DMR/MOTOTRBO signal\n");
|
||||
fprintf (stderr,"\n");
|
||||
fprintf (stderr," * denotes frame types that cannot be auto-detected.\n");
|
||||
fprintf (stderr,"\n");
|
||||
fprintf (stderr,"Advanced decoder options:\n");
|
||||
fprintf (stderr," -A <num> QPSK modulation auto detection threshold (default=26)\n");
|
||||
fprintf (stderr," -S <num> Symbol buffer size for QPSK decision point tracking\n");
|
||||
fprintf (stderr," (default=36)\n");
|
||||
fprintf (stderr," -M <num> Min/Max buffer size for QPSK decision point tracking\n");
|
||||
fprintf (stderr," (default=15)\n");
|
||||
fprintf (stderr,"\n");
|
||||
fprintf (stderr,"Report bugs to: https://github.com/lwvmobile/dsd-fme/issues \n");
|
||||
exit (0);
|
||||
}
|
||||
|
||||
@@ -388,9 +388,9 @@ liveScanner (dsd_opts * opts, dsd_state * state)
|
||||
PaError err = Pa_StartStream( opts->audio_in_pa_stream );
|
||||
if( err != paNoError )
|
||||
{
|
||||
//fprintf( stderr, "An error occured while starting the portaudio input stream\n" );
|
||||
//fprintf( stderr, "Error number: %d\n", err );
|
||||
//fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||
//fprintf (stderr, stderr, "An error occured while starting the portaudio input stream\n" );
|
||||
//fprintf (stderr, stderr, "Error number: %d\n", err );
|
||||
//fprintf (stderr, stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -452,16 +452,16 @@ cleanupAndExit (dsd_opts * opts, dsd_state * state)
|
||||
#ifdef USE_PORTAUDIO
|
||||
if((opts->audio_in_type == 2) || (opts->audio_out_type == 2))
|
||||
{
|
||||
printf("Terminating portaudio.\n");
|
||||
fprintf (stderr,"Terminating portaudio.\n");
|
||||
PaError err = paNoError;
|
||||
if(opts->audio_in_pa_stream != NULL)
|
||||
{
|
||||
err = Pa_CloseStream( opts->audio_in_pa_stream );
|
||||
if( err != paNoError )
|
||||
{
|
||||
//fprintf( stderr, "An error occured while closing the portaudio input stream\n" );
|
||||
//fprintf( stderr, "Error number: %d\n", err );
|
||||
//fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||
//fprintf (stderr, stderr, "An error occured while closing the portaudio input stream\n" );
|
||||
//fprintf (stderr, stderr, "Error number: %d\n", err );
|
||||
//fprintf (stderr, stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||
}
|
||||
}
|
||||
if(opts->audio_out_pa_stream != NULL)
|
||||
@@ -471,24 +471,24 @@ cleanupAndExit (dsd_opts * opts, dsd_state * state)
|
||||
err = Pa_StopStream( opts->audio_out_pa_stream );
|
||||
if( err != paNoError )
|
||||
{
|
||||
//fprintf( stderr, "An error occured while closing the portaudio output stream\n" );
|
||||
//fprintf( stderr, "Error number: %d\n", err );
|
||||
//fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||
//fprintf (stderr, stderr, "An error occured while closing the portaudio output stream\n" );
|
||||
//fprintf (stderr, stderr, "Error number: %d\n", err );
|
||||
//fprintf (stderr, stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||
}
|
||||
err = Pa_CloseStream( opts->audio_out_pa_stream );
|
||||
if( err != paNoError )
|
||||
{
|
||||
//fprintf( stderr, "An error occured while closing the portaudio output stream\n" );
|
||||
//fprintf( stderr, "Error number: %d\n", err );
|
||||
//fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||
//fprintf (stderr, stderr, "An error occured while closing the portaudio output stream\n" );
|
||||
//fprintf (stderr, stderr, "Error number: %d\n", err );
|
||||
//fprintf (stderr, stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||
}
|
||||
}
|
||||
err = Pa_Terminate();
|
||||
if( err != paNoError )
|
||||
{
|
||||
//fprintf( stderr, "An error occured while terminating portaudio\n" );
|
||||
//fprintf( stderr, "Error number: %d\n", err );
|
||||
//fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||
//fprintf (stderr, stderr, "An error occured while terminating portaudio\n" );
|
||||
//fprintf (stderr, stderr, "Error number: %d\n", err );
|
||||
//fprintf (stderr, stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -501,17 +501,17 @@ cleanupAndExit (dsd_opts * opts, dsd_state * state)
|
||||
}
|
||||
#endif
|
||||
|
||||
printf("\n");
|
||||
printf("Total audio errors: %i\n", state->debug_audio_errors);
|
||||
printf("Total header errors: %i\n", state->debug_header_errors);
|
||||
printf("Total irrecoverable header errors: %i\n", state->debug_header_critical_errors);
|
||||
fprintf (stderr,"\n");
|
||||
fprintf (stderr,"Total audio errors: %i\n", state->debug_audio_errors);
|
||||
fprintf (stderr,"Total header errors: %i\n", state->debug_header_errors);
|
||||
fprintf (stderr,"Total irrecoverable header errors: %i\n", state->debug_header_critical_errors);
|
||||
|
||||
//debug_print_heuristics(&(state->p25_heuristics));
|
||||
|
||||
printf("\n");
|
||||
printf("+P25 BER estimate: %.2f%%\n", get_P25_BER_estimate(&state->p25_heuristics));
|
||||
printf("-P25 BER estimate: %.2f%%\n", get_P25_BER_estimate(&state->inv_p25_heuristics));
|
||||
printf("\n");
|
||||
fprintf (stderr,"\n");
|
||||
fprintf (stderr,"+P25 BER estimate: %.2f%%\n", get_P25_BER_estimate(&state->p25_heuristics));
|
||||
fprintf (stderr,"-P25 BER estimate: %.2f%%\n", get_P25_BER_estimate(&state->inv_p25_heuristics));
|
||||
fprintf (stderr,"\n");
|
||||
|
||||
#ifdef TRACE_DSD
|
||||
if (state->debug_label_file != NULL) {
|
||||
@@ -528,7 +528,7 @@ cleanupAndExit (dsd_opts * opts, dsd_state * state)
|
||||
}
|
||||
#endif
|
||||
|
||||
printf ("Exiting.\n");
|
||||
fprintf (stderr,"Exiting.\n");
|
||||
exit (0);
|
||||
}
|
||||
|
||||
@@ -581,13 +581,13 @@ main (int argc, char **argv)
|
||||
|
||||
|
||||
for (short int i = 0; i < 7; i++) {
|
||||
printf("%s%s \n", FM_banner[i], KCYN);
|
||||
fprintf (stderr,"%s%s \n", FM_banner[i], KCYN);
|
||||
}
|
||||
printf("%s", KNRM); //change back to normal
|
||||
fprintf (stderr,"%s", KNRM); //change back to normal
|
||||
//pretty_colors();
|
||||
//printf ("Digital Speech Decoder 1.7.0-dev (build:%s)\n", GIT_TAG);
|
||||
printf ("Digital Speech Decoder: Florida Man Edition\n");
|
||||
printf ("mbelib version %s\n", versionstr);
|
||||
//fprintf (stderr,"Digital Speech Decoder 1.7.0-dev (build:%s)\n", GIT_TAG);
|
||||
fprintf (stderr,"Digital Speech Decoder: Florida Man Edition\n");
|
||||
fprintf (stderr,"mbelib version %s\n", versionstr);
|
||||
|
||||
initOpts (&opts);
|
||||
initState (&state);
|
||||
@@ -683,8 +683,8 @@ main (int argc, char **argv)
|
||||
|
||||
case 'W': //monitor_input_audio if no sync
|
||||
opts.monitor_input_audio = 0;
|
||||
//printf ("Monitor Source Audio if no sync detected (WIP!)\n");
|
||||
printf ("Monitor Source Audio Currently Disabled in Pulse Audio Builds.\n");
|
||||
//fprintf (stderr,"Monitor Source Audio if no sync detected (WIP!)\n");
|
||||
fprintf (stderr,"Monitor Source Audio Currently Disabled in Pulse Audio Builds.\n");
|
||||
break;
|
||||
|
||||
|
||||
@@ -697,12 +697,12 @@ main (int argc, char **argv)
|
||||
opts.p25tg = 0;
|
||||
opts.datascope = 1;
|
||||
opts.symboltiming = 0;
|
||||
printf ("Setting datascope frame rate to %i frame per second.\n", opts.scoperate);
|
||||
fprintf (stderr,"Setting datascope frame rate to %i frame per second.\n", opts.scoperate);
|
||||
break;
|
||||
case 'i':
|
||||
strncpy(opts.audio_in_dev, optarg, 1023);
|
||||
opts.audio_in_dev[1023] = '\0';
|
||||
//printf("audio_in_dev = %s\n", opts.audio_in_dev);
|
||||
//fprintf (stderr,"audio_in_dev = %s\n", opts.audio_in_dev);
|
||||
break;
|
||||
case 'o':
|
||||
strncpy(opts.audio_out_dev, optarg, 1023);
|
||||
@@ -711,37 +711,37 @@ main (int argc, char **argv)
|
||||
case 'd':
|
||||
strncpy(opts.mbe_out_dir, optarg, 1023);
|
||||
opts.mbe_out_dir[1023] = '\0';
|
||||
printf ("Writing mbe data files to directory %s\n", opts.mbe_out_dir);
|
||||
fprintf (stderr,"Writing mbe data files to directory %s\n", opts.mbe_out_dir);
|
||||
break;
|
||||
case 'c':
|
||||
opts.rtlsdr_center_freq = (uint32_t)atofs(optarg);
|
||||
printf("Tuning to frequency: %i Hz\n", opts.rtlsdr_center_freq);
|
||||
fprintf (stderr,"Tuning to frequency: %i Hz\n", opts.rtlsdr_center_freq);
|
||||
break;
|
||||
case 'g':
|
||||
sscanf (optarg, "%f", &opts.audio_gain);
|
||||
if (opts.audio_gain < (float) 0 )
|
||||
{
|
||||
printf ("Disabling audio out gain setting\n");
|
||||
fprintf (stderr,"Disabling audio out gain setting\n");
|
||||
}
|
||||
else if (opts.audio_gain == (float) 0)
|
||||
{
|
||||
opts.audio_gain = (float) 0;
|
||||
printf ("Enabling audio out auto-gain\n");
|
||||
fprintf (stderr,"Enabling audio out auto-gain\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("Setting audio out gain to %f\n", opts.audio_gain);
|
||||
fprintf (stderr,"Setting audio out gain to %f\n", opts.audio_gain);
|
||||
state.aout_gain = opts.audio_gain;
|
||||
}
|
||||
break;
|
||||
case 'n':
|
||||
opts.audio_out = 0;
|
||||
printf ("Disabling audio output to soundcard.\n");
|
||||
fprintf (stderr,"Disabling audio output to soundcard.\n");
|
||||
break;
|
||||
case 'w':
|
||||
strncpy(opts.wav_out_file, optarg, 1023);
|
||||
opts.wav_out_file[1023] = '\0';
|
||||
printf ("Writing audio to file %s\n", opts.wav_out_file);
|
||||
fprintf (stderr,"Writing audio to file %s\n", opts.wav_out_file);
|
||||
openWavOutFile (&opts, &state);
|
||||
break;
|
||||
case 'B':
|
||||
@@ -753,7 +753,7 @@ main (int argc, char **argv)
|
||||
break;
|
||||
case 'R':
|
||||
sscanf (optarg, "%d", &opts.resume);
|
||||
printf ("Enabling scan resume after %i TDULC frames\n", opts.resume);
|
||||
fprintf (stderr,"Enabling scan resume after %i TDULC frames\n", opts.resume);
|
||||
break;
|
||||
case 'f':
|
||||
if (optarg[0] == 'a')
|
||||
@@ -775,7 +775,7 @@ main (int argc, char **argv)
|
||||
opts.frame_nxdn96 = 0;
|
||||
opts.frame_dmr = 0;
|
||||
opts.frame_provoice = 0;
|
||||
printf ("Decoding only D-STAR frames.\n");
|
||||
fprintf (stderr,"Decoding only D-STAR frames.\n");
|
||||
}
|
||||
else if (optarg[0] == 'x')
|
||||
{
|
||||
@@ -786,7 +786,7 @@ main (int argc, char **argv)
|
||||
opts.frame_nxdn96 = 0;
|
||||
opts.frame_dmr = 0;
|
||||
opts.frame_provoice = 0;
|
||||
printf ("Decoding only X2-TDMA frames.\n");
|
||||
fprintf (stderr,"Decoding only X2-TDMA frames.\n");
|
||||
}
|
||||
else if (optarg[0] == 'p')
|
||||
{
|
||||
@@ -803,9 +803,9 @@ main (int argc, char **argv)
|
||||
opts.mod_qpsk = 0;
|
||||
opts.mod_gfsk = 1;
|
||||
state.rf_mod = 2;
|
||||
printf ("Setting symbol rate to 9600 / second\n");
|
||||
printf ("Enabling only GFSK modulation optimizations.\n");
|
||||
printf ("Decoding only ProVoice frames.\n");
|
||||
fprintf (stderr,"Setting symbol rate to 9600 / second\n");
|
||||
fprintf (stderr,"Enabling only GFSK modulation optimizations.\n");
|
||||
fprintf (stderr,"Decoding only ProVoice frames.\n");
|
||||
}
|
||||
else if (optarg[0] == '1')
|
||||
{
|
||||
@@ -816,7 +816,7 @@ main (int argc, char **argv)
|
||||
opts.frame_nxdn96 = 0;
|
||||
opts.frame_dmr = 0;
|
||||
opts.frame_provoice = 0;
|
||||
printf ("Decoding only P25 Phase 1 frames.\n");
|
||||
fprintf (stderr,"Decoding only P25 Phase 1 frames.\n");
|
||||
}
|
||||
else if (optarg[0] == 'i')
|
||||
{
|
||||
@@ -834,8 +834,8 @@ main (int argc, char **argv)
|
||||
opts.mod_gfsk = 1; //was 1 with others on zero
|
||||
state.rf_mod = 2; //was 2
|
||||
//opts.symboltiming = 2400; //NXDN48 uses 2400 symbol rate
|
||||
printf ("Setting symbol rate to 2400 / second\n");
|
||||
printf ("Decoding only NXDN 4800 baud frames.\n");
|
||||
fprintf (stderr,"Setting symbol rate to 2400 / second\n");
|
||||
fprintf (stderr,"Decoding only NXDN 4800 baud frames.\n");
|
||||
}
|
||||
else if (optarg[0] == 'n')
|
||||
{
|
||||
@@ -850,8 +850,8 @@ main (int argc, char **argv)
|
||||
opts.mod_qpsk = 0;
|
||||
opts.mod_gfsk = 1;
|
||||
state.rf_mod = 2;
|
||||
printf ("Enabling only GFSK modulation optimizations.\n");
|
||||
printf ("Decoding only NXDN 9600 baud frames.\n");
|
||||
fprintf (stderr,"Enabling only GFSK modulation optimizations.\n");
|
||||
fprintf (stderr,"Decoding only NXDN 9600 baud frames.\n");
|
||||
}
|
||||
else if (optarg[0] == 'r')
|
||||
{
|
||||
@@ -862,7 +862,7 @@ main (int argc, char **argv)
|
||||
opts.frame_nxdn96 = 0;
|
||||
opts.frame_dmr = 1;
|
||||
opts.frame_provoice = 0;
|
||||
printf ("Decoding only DMR/MOTOTRBO frames.\n");
|
||||
fprintf (stderr,"Decoding only DMR/MOTOTRBO frames.\n");
|
||||
}
|
||||
break;
|
||||
case 'm':
|
||||
@@ -879,7 +879,7 @@ main (int argc, char **argv)
|
||||
opts.mod_qpsk = 0;
|
||||
opts.mod_gfsk = 0;
|
||||
state.rf_mod = 0;
|
||||
printf ("Enabling only C4FM modulation optimizations.\n");
|
||||
fprintf (stderr,"Enabling only C4FM modulation optimizations.\n");
|
||||
}
|
||||
else if (optarg[0] == 'g')
|
||||
{
|
||||
@@ -887,7 +887,7 @@ main (int argc, char **argv)
|
||||
opts.mod_qpsk = 0;
|
||||
opts.mod_gfsk = 1;
|
||||
state.rf_mod = 2;
|
||||
printf ("Enabling only GFSK modulation optimizations.\n");
|
||||
fprintf (stderr,"Enabling only GFSK modulation optimizations.\n");
|
||||
}
|
||||
else if (optarg[0] == 'q')
|
||||
{
|
||||
@@ -895,7 +895,7 @@ main (int argc, char **argv)
|
||||
opts.mod_qpsk = 1;
|
||||
opts.mod_gfsk = 0;
|
||||
state.rf_mod = 1;
|
||||
printf ("Enabling only QPSK modulation optimizations.\n");
|
||||
fprintf (stderr,"Enabling only QPSK modulation optimizations.\n");
|
||||
}
|
||||
break;
|
||||
case 'u':
|
||||
@@ -908,23 +908,23 @@ main (int argc, char **argv)
|
||||
{
|
||||
opts.uvquality = 64;
|
||||
}
|
||||
printf ("Setting unvoice speech quality to %i waves per band.\n", opts.uvquality);
|
||||
fprintf (stderr,"Setting unvoice speech quality to %i waves per band.\n", opts.uvquality);
|
||||
break;
|
||||
case 'x':
|
||||
if (optarg[0] == 'x')
|
||||
{
|
||||
opts.inverted_x2tdma = 0;
|
||||
printf ("Expecting non-inverted X2-TDMA signals.\n");
|
||||
fprintf (stderr,"Expecting non-inverted X2-TDMA signals.\n");
|
||||
}
|
||||
else if (optarg[0] == 'r')
|
||||
{
|
||||
opts.inverted_dmr = 1;
|
||||
printf ("Expecting inverted DMR/MOTOTRBO signals.\n");
|
||||
fprintf (stderr,"Expecting inverted DMR/MOTOTRBO signals.\n");
|
||||
}
|
||||
break;
|
||||
case 'A':
|
||||
sscanf (optarg, "%i", &opts.mod_threshold);
|
||||
printf ("Setting C4FM/QPSK auto detection threshold to %i\n", opts.mod_threshold);
|
||||
fprintf (stderr,"Setting C4FM/QPSK auto detection threshold to %i\n", opts.mod_threshold);
|
||||
break;
|
||||
case 'S':
|
||||
sscanf (optarg, "%i", &opts.ssize);
|
||||
@@ -936,7 +936,7 @@ main (int argc, char **argv)
|
||||
{
|
||||
opts.ssize = 1;
|
||||
}
|
||||
printf ("Setting QPSK symbol buffer to %i\n", opts.ssize);
|
||||
fprintf (stderr,"Setting QPSK symbol buffer to %i\n", opts.ssize);
|
||||
break;
|
||||
case 'M':
|
||||
sscanf (optarg, "%i", &opts.msize);
|
||||
@@ -948,7 +948,7 @@ main (int argc, char **argv)
|
||||
{
|
||||
opts.msize = 1;
|
||||
}
|
||||
printf ("Setting QPSK Min/Max buffer to %i\n", opts.msize);
|
||||
fprintf (stderr,"Setting QPSK Min/Max buffer to %i\n", opts.msize);
|
||||
break;
|
||||
case 'r':
|
||||
opts.playfiles = 1;
|
||||
@@ -985,13 +985,13 @@ main (int argc, char **argv)
|
||||
if((strncmp(opts.audio_in_dev, "pa:", 3) == 0)
|
||||
|| (strncmp(opts.audio_out_dev, "pa:", 3) == 0))
|
||||
{
|
||||
printf("Initializing portaudio.\n");
|
||||
fprintf (stderr,"Initializing portaudio.\n");
|
||||
PaError err = Pa_Initialize();
|
||||
if( err != paNoError )
|
||||
{
|
||||
//fprintf( stderr, "An error occured while initializing portaudio\n" );
|
||||
//fprintf( stderr, "Error number: %d\n", err );
|
||||
//fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||
//fprintf (stderr, stderr, "An error occured while initializing portaudio\n" );
|
||||
//fprintf (stderr, stderr, "Error number: %d\n", err );
|
||||
//fprintf (stderr, stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||
exit(err);
|
||||
}
|
||||
}
|
||||
@@ -1044,7 +1044,7 @@ main (int argc, char **argv)
|
||||
attroff(COLOR_PAIR(4));
|
||||
refresh();
|
||||
*/
|
||||
printf("Press CTRL + C twice to close.\n"); //Kindly remind user to double tap CTRL + C
|
||||
fprintf (stderr,"Press CTRL + C twice to close.\n"); //Kindly remind user to double tap CTRL + C
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user