From a02f992a258b87aea7c7bd1449ddccece1d9115a Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Sat, 4 Feb 2023 04:34:09 -0500 Subject: [PATCH] NCurses Compiler Warning and Call Alert Fix; --- src/dsd_ncurses.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index 8561a31..d492565 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -1890,7 +1890,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) openWavOutFileL (opts, state); //testing for now, will want to move to per call later } - if (opts->call_alert == 1) + if (opts->call_alert == 1 && rd != 0 && tg != 0) { //fprintf (stderr, "BEEP 0 MS LEFT\n"); beeper (opts, state, 0); @@ -1933,7 +1933,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) openWavOutFileL (opts, state); //testing for now, will want to move to per call later } - if (opts->call_alert == 1) + if (opts->call_alert == 1 && rd != 0 && tg != 0) { //fprintf (stderr, "BEEP 0 BS LEFT\n"); beeper (opts, state, 0); @@ -1975,7 +1975,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) openWavOutFileR (opts, state); //testing for now, will want to move to per call later } - if (opts->call_alert == 1) + if (opts->call_alert == 1 && rdR != 0 && tgR != 0) { //fprintf (stderr, "BEEP 1 BS RIGHT\n"); beeper (opts, state, 1); @@ -2030,11 +2030,19 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) // { // beeper (opts, state, 0); // state->dmr_end_alert[0] = 1; //don't play again until new voice frames + // state->lasttg = 0; + // state->lastsrc = 0; + // rd = 0; + // tg = 0; // } // if (state->dmrburstR == 2 && state->dmr_end_alert[1] == 0) //if TLC and flag not tripped // { // beeper (opts, state, 1); // state->dmr_end_alert[1] = 1; //don't play again until new voice frames + // state->lasttgR = 0; + // state->lastsrcR = 0; + // rdR = 0; + // tgR = 0; // } // } @@ -2344,7 +2352,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) else if (lls == 0 || lls == 1) //P1 { // printw ("P25 P1 - WACN: [%05llX] SYS: [%03llX] NAC: [%03llX] ", state->p2_wacn, state->p2_sysid, state->p2_cc); - printw ("P25 P1 - [%05llX][%03llX][%03llX] RFSS: [%X] SITE: [%X] ", state->p2_wacn, state->p2_sysid, state->p2_cc, state->p2_rfssid, state->p2_siteid); + printw ("P25 P1 - [%05llX][%03llX][%03llX] RFSS: [%llX] SITE: [%llX] ", state->p2_wacn, state->p2_sysid, state->p2_cc, state->p2_rfssid, state->p2_siteid); if (state->p25_cc_freq != 0) { printw ("Freq: [%.06lf] MHz", (double)state->p25_cc_freq/1000000); @@ -2353,7 +2361,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) else if (lls == 35 || lls == 36) //P2 { // printw ("P25 P2 - WACN: [%05llX] SYS: [%03llX] NAC: [%03llX] ", state->p2_wacn, state->p2_sysid, state->p2_cc); - printw ("P25 P2 - [%05llX][%03llX][%03llX] RFSS: [%X] SITE: [%X] ", state->p2_wacn, state->p2_sysid, state->p2_cc, state->p2_rfssid, state->p2_siteid); + printw ("P25 P2 - [%05llX][%03llX][%03llX] RFSS: [%llX] SITE: [%llX] ", state->p2_wacn, state->p2_sysid, state->p2_cc, state->p2_rfssid, state->p2_siteid); if (state->p2_wacn == 0 || state->p2_sysid == 0 || state->p2_cc == 0) { attron(COLOR_PAIR(2)); @@ -2891,8 +2899,8 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) printw ("--Call History----------------------------------------------------------------\n"); for (short int j = 0; j < 10; j++) { - //only print if a valid time was assigned to the matrix, and not EDACS/PV - if ( ((time(NULL) - call_matrix[9-j][5]) < 999999) && call_matrix[9-j][0] != 14 && call_matrix[9-j][0] != 15 && call_matrix[9-j][0] != 37 && call_matrix[9-j][0] != 38 ) + //only print if a valid time was assigned to the matrix, and not EDACS/PV, and source is not zero + if ( ((time(NULL) - call_matrix[9-j][5]) < 999999) && call_matrix[9-j][0] != 14 && call_matrix[9-j][0] != 15 && call_matrix[9-j][0] != 37 && call_matrix[9-j][0] != 38 && call_matrix[9-j][2] != 0) // { printw ("| %s ", SyncTypes[call_matrix[9-j][0]]); if (lls == 28 || lls == 29)