diff --git a/src/dsd_main.c b/src/dsd_main.c index 3eb704a..a6d9f38 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -132,7 +132,7 @@ { //always do these -- makes sense during scanning - state->nxdn_last_ran = -1; + state->nxdn_last_ran = -1; // state->nxdn_last_rid = 0; state->nxdn_last_tg = 0; @@ -289,9 +289,10 @@ sprintf (state->dmr_site_parms, "%s", ""); } - //zero out after x second hangtime when trunking to prevent premature zeroing on these variables - //mainly bugfix for ncurses and per call wavs (edacs) and also signal fade, etc - if (opts->p25_trunk == 1 && opts->p25_is_tuned == 1 && time(NULL) - state->last_cc_sync_time > opts->trunk_hangtime) + //The new event history should not require this, but revert if other random issues suddenly come up + //this was mainly for preventling numbers blipping out on signal fade, but also leaves stale values + //on occassion when carrier drops and return to control channel, doesn't close wav files in that instance + // if (opts->p25_trunk == 1 && opts->p25_is_tuned == 1 && time(NULL) - state->last_cc_sync_time > opts->trunk_hangtime) { state->lasttg = 0; state->lastsrc = 0; @@ -299,6 +300,9 @@ state->lastsrcR = 0; state->gi[0] = -1; state->gi[1] = -1; + // state->nxdn_last_ran = -1; // + state->nxdn_last_rid = 0; + state->nxdn_last_tg = 0; } diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index 22aaec1..015abe4 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -3885,6 +3885,10 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) sprintf (state->group_array[state->group_tally].groupName, "%s", "LOCKOUT"); state->group_tally++; + sprintf (state->event_history_s[0].Event_History_Items[0].internal_str, "Target: %d; has been locked out; User Lock Out.", state->lasttg); + watchdog_event_current(opts, state, 0); + sprintf (state->call_string[0], "%s", " "); //21 spaces + //if we have an opened group file, let's write a group lock out into it to make it permanent if (opts->group_in_file[0] != 0) //file is available { @@ -3924,13 +3928,20 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) //RIGCTL if (opts->p25_trunk == 1 && opts->use_rigctl == 1) { + //drop all items (failsafe) + noCarrier(opts, state); if (opts->setmod_bw != 0 ) SetModulation(opts->rigctl_sockfd, opts->setmod_bw); SetFreq(opts->rigctl_sockfd, state->p25_cc_freq); } //rtl #ifdef USE_RTLSDR - if (opts->p25_trunk == 1 && opts->audio_in_type == 3) rtl_dev_tune (opts, state->p25_cc_freq); + if (opts->p25_trunk == 1 && opts->audio_in_type == 3) + { + //drop all items (failsafe) + noCarrier(opts, state); + rtl_dev_tune (opts, state->p25_cc_freq); + } #endif state->last_cc_sync_time = time(NULL); @@ -3951,6 +3962,10 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) sprintf (state->group_array[state->group_tally].groupName, "%s", "LOCKOUT"); state->group_tally++; + sprintf (state->event_history_s[1].Event_History_Items[0].internal_str, "Target: %d; has been locked out; User Lock Out.", state->lasttgR); + watchdog_event_current(opts, state, 1); + sprintf (state->call_string[1], "%s", " "); //21 spaces + //if we have an opened group file, let's write a group lock out into it to make it permanent if (opts->group_in_file[0] != 0) //file is available { @@ -3990,13 +4005,20 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) //RIGCTL if (opts->p25_trunk == 1 && opts->use_rigctl == 1) { + //drop all items (failsafe) + noCarrier(opts, state); if (opts->setmod_bw != 0 ) SetModulation(opts->rigctl_sockfd, opts->setmod_bw); SetFreq(opts->rigctl_sockfd, state->p25_cc_freq); } //rtl #ifdef USE_RTLSDR - if (opts->p25_trunk == 1 && opts->audio_in_type == 3) rtl_dev_tune (opts, state->p25_cc_freq); + if (opts->p25_trunk == 1 && opts->audio_in_type == 3) + { + //drop all items (failsafe) + noCarrier(opts, state); + rtl_dev_tune (opts, state->p25_cc_freq); + } #endif state->last_cc_sync_time = time(NULL);