From 8d9cbb37201defc9aae5b3018f6bff8b44e76078 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Wed, 8 Mar 2023 02:04:09 -0500 Subject: [PATCH] XPT Trunking Tweak; --- src/dmr_csbk.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/dmr_csbk.c b/src/dmr_csbk.c index 0c92015..5a81e1a 100644 --- a/src/dmr_csbk.c +++ b/src/dmr_csbk.c @@ -1089,13 +1089,40 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 //assign to cc freq to follow during no sync //current theory is that user should set channel 0 as the 'home repeater' frequency //this can change if this is ever tested by anybody properly - if (state->trunk_chan_map[0] != 0) + long int ccfreq = 0; + + //if using rigctl we can set an unknown or updated cc frequency + //by polling rigctl for the current frequency + if (opts->use_rigctl == 1 ) //&& state->p25_cc_freq == 0 //&& opts->p25_is_tuned == 0 { - state->p25_cc_freq = state->trunk_chan_map[0]; - //set to always tuned - opts->p25_is_tuned = 1; + ccfreq = GetCurrentFreq (opts->rigctl_sockfd); + // if (ccfreq != 0) state->p25_cc_freq = ccfreq; + if (ccfreq != 0) + { + state->p25_cc_freq = ccfreq; + opts->p25_is_tuned = 1; + } } + //if using rtl input, we can ask for the current frequency tuned + if (opts->audio_in_type == 3 ) //&& state->p25_cc_freq == 0 //&& opts->p25_is_tuned == 0 + { + ccfreq = (long int)opts->rtlsdr_center_freq; + if (ccfreq != 0) + { + state->p25_cc_freq = ccfreq; + opts->p25_is_tuned = 1; + } + + } + + // if (state->trunk_chan_map[0] != 0) + // { + // state->p25_cc_freq = state->trunk_chan_map[0]; + // //set to always tuned + // opts->p25_is_tuned = 1; + // } + //Skip tuning calls if group calls are disabled if (opts->trunk_tune_group_calls == 0) goto SKIPXPT;