From 129af0ba9e387e254373012b23ee6fbdddb4c311 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Mon, 8 Apr 2024 18:04:39 -0400 Subject: [PATCH] M17: Misc Handling / Display Tweaks; --- src/dsd_main.c | 9 +++++++++ src/dsd_ncurses.c | 13 ++++++------- src/m17.c | 5 +++++ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/dsd_main.c b/src/dsd_main.c index 12599be..cea6ab5 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -2735,6 +2735,7 @@ main (int argc, char **argv) opts.pulse_digi_rate_out = 8000; opts.pulse_digi_out_channels = 1; sprintf (opts.output_name, "M17 IP Frame"); + fprintf (stderr, "Decoding M17 UDP/IP Frames.\n"); } break; //don't mess with the modulations unless you really need to @@ -3343,6 +3344,14 @@ main (int argc, char **argv) if (state.m17_can_en > 15) state.m17_can_en = 15; + //if vox is greater than 1, assume user meant 'yes' and set to one + if (state.m17_vox > 1) + state.m17_vox = 1; + + //if use_ip is greater than 1, assume user meant 'yes' and set to one + if (opts.m17_use_ip > 1) + opts.m17_use_ip = 1; + //debug print m17dat string // fprintf (stderr, " %s;", state.m17dat); diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index 84a2591..e9d2ba7 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -2481,17 +2481,14 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) } } - // if (opts->monitor_input_audio == 1) - // { - // printw ("| Monitoring Source Audio when Carrier Present and No Sync Detected (WIP)\n"); - // } + if (opts->m17_use_ip == 1) + printw ("| M17 UDP IP Frame Output: 127.0.0.1:17000\n"); if (opts->mbe_out_dir[0] != 0 && opts->dmr_stereo == 0) { printw ("| Writing MBE data files to directory %s\n", opts->mbe_out_dir); } - if (opts->wav_out_raw) { printw ("| Raw Audio Output: %s\n", opts->wav_out_file_raw); @@ -2663,8 +2660,10 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) if (opts->mod_gfsk == 1) printw ("[GFSK]"); printw ( "[%d] \n", (48000*opts->wav_interpolator)/state->samplesPerSymbol); if (opts->m17encoder == 1) printw ("| Encoding: [%s] ", opts->output_name); - if (opts->m17encoder == 1) printw (" Toggle (\\); "); - if (opts->m17encoder == 1) printw (" Mic Gain (/|*): %02.0f%% ", opts->audio_gainA); + if (opts->m17encoder == 1 && state->m17encoder_tx == 1 && state->m17_vox == 0) printw (" TX (\\) ON ;"); + if (opts->m17encoder == 1 && state->m17encoder_tx == 0 && state->m17_vox == 0) printw (" TX (\\) OFF;"); + if (opts->m17encoder == 1 && state->m17_vox == 1) printw (" Vox Mode;"); + if (opts->m17encoder == 1) printw (" Input Gain (/|*): %02.0f%% ", opts->audio_gainA); if (opts->m17encoder == 1) { if (opts->use_lpf == 1) printw ("F: |LP|"); else printw ("F: | |"); diff --git a/src/m17.c b/src/m17.c index 326a481..3b638a9 100644 --- a/src/m17.c +++ b/src/m17.c @@ -1451,6 +1451,10 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) if (opts->use_ncurses_terminal == 1) ncursesOpen(opts, state); + //if using the ncurses terminal, disable TX on startup until user toggles it with the '\' key, if not vox enabled + if (opts->use_ncurses_terminal == 1 && state->m17encoder_tx == 1 && state->m17_vox == 0) + state->m17encoder_tx = 0; + //User Defined Variables int use_ip = 0; //1 to enable IP Frame Broadcast over UDP int udpport = 17000; //port number for M17 IP Frmae (default is 17000) @@ -1503,6 +1507,7 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state) { fprintf (stderr, "Error Configuring UDP Socket for M17 IP Frame :( \n"); use_ip = 0; + opts->m17_use_ip = 0; } else use_ip = 1; }