diff --git a/include/dsd.h b/include/dsd.h index ed157d5..dd5ea03 100644 --- a/include/dsd.h +++ b/include/dsd.h @@ -141,6 +141,7 @@ typedef struct int rtl_gain_value; int rtl_squelch_level; int rtl_volume_multiplier; + int rtl_udp_port; } dsd_opts; typedef struct diff --git a/src/dsd_main.c b/src/dsd_main.c index f6ff7d5..01e6354 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -187,8 +187,9 @@ initOpts (dsd_opts * opts) opts->unmute_encrypted_p25 = 0; opts->rtl_dev_index = 0; //choose which device we want by index number opts->rtl_gain_value = 0; //set actual gain and not automatic gain - opts->rtl_squelch_level = 100; //fully open by default, want to specify level for things like NXDN with false positives + opts->rtl_squelch_level = 0; //fully open by default, want to specify level for things like NXDN with false positives opts->rtl_volume_multiplier = 1; //set multipler from rtl sample to 'boost volume' + opts->rtl_udp_port = 6020; //set UDP port for RTL remote } void @@ -330,6 +331,7 @@ usage () printf (" -G RTL-SDR Device Gain (0-49) (default = 0 Auto Gain)\n"); printf (" -L RTL-SDR Squelch Level (0 - Open, 25 - Little, 50 - Higher)(Just have to guess really...)\n"); printf (" -V RTL-SDR Sample Gain Multiplier (default = 1)(2-3 recommended, still testing) \n"); + printf (" -U RTL-SDR UDP Remote Port (default = 6020)\n"); printf ("\n"); printf ("Scanner control options:\n"); printf (" -B Serial port baud rate (default=115200)\n"); @@ -364,7 +366,7 @@ usage () printf (" -M Min/Max buffer size for QPSK decision point tracking\n"); printf (" (default=15)\n"); printf ("\n"); - printf ("Report bugs to: Nobody Mwuhaha \n"); + printf ("Report bugs to: https://github.com/lwvmobile/dsd-fme/issues \n"); exit (0); } @@ -601,7 +603,7 @@ main (int argc, char **argv) exitflag = 0; signal (SIGINT, sigfun); - while ((c = getopt (argc, argv, "haep:P:qstv:z:i:o:d:c:g:nw:B:C:R:f:m:u:x:A:S:M:G:D:L:V:rl")) != -1) + while ((c = getopt (argc, argv, "haep:P:qstv:z:i:o:d:c:g:nw:B:C:R:f:m:u:x:A:S:M:G:D:L:V:U:rl")) != -1) { opterr = 0; switch (c) @@ -674,7 +676,12 @@ main (int argc, char **argv) break; case 'V': //Set rtl squelch level - sscanf (optarg, "%d", &opts.rtl_volume_multiplier); //set squelch by user to prevent false positives on NXDN and others + sscanf (optarg, "%d", &opts.rtl_volume_multiplier); //set 'volume' multiplier for rtl-sdr samples + //opts->audio_in_type = 3; + break; + + case 'U': //Set rtl squelch level + sscanf (optarg, "%d", &opts.rtl_udp_port); //set udp port number for RTL remote //opts->audio_in_type = 3; break; diff --git a/src/rtl_sdr_fm.cpp b/src/rtl_sdr_fm.cpp index a7cad1e..301889f 100644 --- a/src/rtl_sdr_fm.cpp +++ b/src/rtl_sdr_fm.cpp @@ -52,6 +52,7 @@ static int atan_lut_coef = 8; static pthread_t socket_freq; short int volume_multiplier; +short int port; // struct dongle_state { @@ -910,7 +911,7 @@ static unsigned int chars_to_int(unsigned char* buf) { static void *socket_thread_fn(void *arg) { //struct fm_state *fm = arg; struct demod_state *d = static_cast(arg); - int port = 6020; + //int port = 6020; int r, n; int sockfd, newsockfd, portno; socklen_t clilen; @@ -1061,6 +1062,7 @@ void open_rtlsdr_stream(dsd_opts *opts) dongle.dev_index = opts->rtl_dev_index; demod.squelch_level = opts->rtl_squelch_level; //adding user definable squelch level to prevent false positives on account of noise in NXDN etc fprintf(stderr, "Setting RTL Squelch Level to %d\n", demod.squelch_level); + port = opts->rtl_udp_port; } if (opts->rtl_gain_value > 0) {