From c404f3c48c197dede8257ee602a58464a8cf2e9a Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Fri, 22 Mar 2024 02:01:09 -0400 Subject: [PATCH] EDACS: Ncurses Display Working Mode Tweaks; --- src/dsd_ncurses.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++ src/edacs-fme.c | 7 +++++- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index d2e1c93..f6f45f5 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -2505,6 +2505,65 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) else printw (" - Black List Mode\n"); } #endif + //print additional information for EDACS modes and toggles + #ifdef PRETTY_COLORS + if (opts->p25_trunk == 1 && opts->frame_provoice == 1) + { + printw ("| \\--EDACS -"); + if (state->ea_mode == -1) + { + attron(COLOR_PAIR(2)); + printw (" Standard/Network"); + printw (" Extended Address"); + attron(COLOR_PAIR(4)); + } + else if (state->ea_mode == 0) + { + printw (" Standard/Network"); + attron(COLOR_PAIR(2)); + printw (" Extended Address"); + attron(COLOR_PAIR(4)); + } + else if (state->ea_mode == 1) + { + attron(COLOR_PAIR(2)); + printw (" Standard/Network"); + attron(COLOR_PAIR(4)); + printw (" Extended Address"); + } + printw (" (S) Mode;"); + + printw(" ESK Mask: %02X", state->esk_mask); + printw (" (A); "); + + attron(COLOR_PAIR(4)); + printw ("\n"); + } + #else //set on to UPPER CASE, off to lower case + if (opts->p25_trunk == 1 && opts->frame_provoice == 1) + { + printw ("| \\--EDACS -"); + if (state->ea_mode == -1) + { + printw (" standard/network"); + printw (" extended address"); + } + else if (state->ea_mode == 0) + { + printw (" STANDARD/NETWORK"); + printw (" extended address"); + } + else if (state->ea_mode == 1) + { + printw (" standard/network"); + printw (" EXTENDED ADDRESS"); + } + printw (" (S) Mode (Toggle);"); + + printw(" ESK Mask: %02X", state->esk_mask); + printw (" (A) Toggle; "); + printw ("\n"); + #endif // if (opts->aggressive_framesync == 0) printw ("| Selective CRC ERR Bypass Enabled (RAS) \n"); if (state->M == 1) { diff --git a/src/edacs-fme.c b/src/edacs-fme.c index 9a7c40a..0c9b861 100644 --- a/src/edacs-fme.c +++ b/src/edacs-fme.c @@ -504,7 +504,12 @@ void edacs(dsd_opts * opts, dsd_state * state) -fH Decode only EDACS Standard/ProVoice with ESK 0xA0*\n"); -fe Decode only EDACS EA/ProVoice*\n"); -fE Decode only EDACS EA/ProVoice with ESK 0xA0*\n"); + + (A) key toggles mode; (S) key toggles mask value in ncurses */ + + //TODO: Consider re-adding the auto code to make a suggestion to users + //as to which mode to proceed in? //Start Extended Addressing Mode if (state->ea_mode == 1) @@ -1062,7 +1067,7 @@ void edacs(dsd_opts * opts, dsd_state * state) } //end Standard or Networked - //supply user warning to use -9 switch if decoding doesn't start shortly + //let users know they need to select an operational mode with the switches below else fprintf (stderr, " Detected: Use -fh, -fH, -fe, or -fE for std, esk, ea, or ea-esk;"); }