From 2f2eecddfc662816962fa691fae4712a9db79b6e Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Tue, 6 Dec 2022 08:47:46 -0500 Subject: [PATCH] Various Trunking Tweaks; --- src/dsd_main.c | 10 +++++++++- src/p25p2_vpdu.c | 14 ++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/dsd_main.c b/src/dsd_main.c index 0ff845e..e0fec38 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -147,9 +147,18 @@ noCarrier (dsd_opts * opts, dsd_state * state) state->lastsrc = 0; state->lasttgR = 0; state->lastsrcR = 0; + //zero out vc frequencies? state->p25_vc_freq[0] = 0; state->p25_vc_freq[1] = 0; + + //only reset cap+ rest channel if not trunking + state->dmr_rest_channel = -1; + + //zero out nxdn site/srv/cch info if not trunking + state->nxdn_location_site_code = 0; + state->nxdn_location_sys_code = 0; + sprintf (state->nxdn_location_category, "%s", " "); } //zero out after x second hangtime when trunking to prevent premature zeroing on these variables @@ -266,7 +275,6 @@ noCarrier (dsd_opts * opts, dsd_state * state) memset (state->nxdn_alias_block_segment, 0, sizeof(state->nxdn_alias_block_segment)); sprintf (state->nxdn_call_type, "%s", ""); - state->dmr_rest_channel = -1; //init on -1 sprintf(state->dmr_branding_sub, "%s", ""); sprintf(state->dmr_branding, "%s", ""); sprintf (state->dmr_site_parms, "%s", ""); //may not zero this out diff --git a/src/p25p2_vpdu.c b/src/p25p2_vpdu.c index 99e7097..1a36b4f 100644 --- a/src/p25p2_vpdu.c +++ b/src/p25p2_vpdu.c @@ -288,6 +288,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon //probably best to only set these when really tuning state->p25_vc_freq[0] = state->p25_vc_freq[1] = tunable_freq; opts->p25_is_tuned = 1; //set to 1 to set as currently tuned so we don't keep tuning nonstop + j = 8; //break loop } //rtl_udp @@ -296,6 +297,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon rtl_udp_tune (opts, state, tunable_freq); state->p25_vc_freq[0] = state->p25_vc_freq[1] = tunable_freq; opts->p25_is_tuned = 1; + j = 8; //break loop } } } @@ -530,6 +532,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon SetFreq(opts->rigctl_sockfd, tunable_freq); state->p25_vc_freq[0] = state->p25_vc_freq[1] = tunable_freq; opts->p25_is_tuned = 1; //set to 1 to set as currently tuned so we don't keep tuning nonstop + j = 8; //break loop } //rtl_udp else if (opts->audio_in_type == 3) @@ -537,6 +540,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon rtl_udp_tune (opts, state, tunable_freq); state->p25_vc_freq[0] = state->p25_vc_freq[1] = tunable_freq; opts->p25_is_tuned = 1; + j = 8; //break loop } } } @@ -638,7 +642,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon //probably best to only set these when really tuning state->p25_vc_freq[0] = state->p25_vc_freq[1] = tunable_freq; opts->p25_is_tuned = 1; //set to 1 to set as currently tuned so we don't keep tuning nonstop - + j = 8; //break loop } //rtl_udp else if (opts->audio_in_type == 3) @@ -647,6 +651,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon //probably best to only set these when really tuning state->p25_vc_freq[0] = state->p25_vc_freq[1] = tunable_freq; opts->p25_is_tuned = 1; + j = 8; //break loop } } } @@ -736,7 +741,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon //probably best to only set these when really tuning state->p25_vc_freq[0] = state->p25_vc_freq[1] = tunable_freq; opts->p25_is_tuned = 1; //set to 1 to set as currently tuned so we don't keep tuning nonstop - + j = 8; //break loop } //rtl_udp else if (opts->audio_in_type == 3) @@ -745,6 +750,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon //probably best to only set these when really tuning state->p25_vc_freq[0] = state->p25_vc_freq[1] = tunable_freq; opts->p25_is_tuned = 1; + j = 8; //break loop } } } @@ -1274,7 +1280,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon if (1 == 1) //state->p2_is_lcch == 1 { fprintf (stderr, "\n Adjacent Status Broadcast - Abbreviated\n"); - fprintf (stderr, " LRA [%02X] RFSS[%03d] SYSID [%03X] CHAN-T [%04X] SSC [%02X]", lra, rfssid, lsysid, channelt, sysclass); + fprintf (stderr, " LRA [%02X] RFSS[%03d] SYSID [%03X] SITE [%03X] CHAN-T [%04X] SSC [%02X]", lra, rfssid, lsysid, siteid, channelt, sysclass); process_channel_to_freq (opts, state, channelt); } @@ -1293,7 +1299,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon if (1 == 1) //state->p2_is_lcch == 1 { fprintf (stderr, "\n Adjacent Status Broadcast - Extended\n"); - fprintf (stderr, " LRA [%02X] RFSS[%03d] SYSID [%03X] CHAN-T [%04X] CHAN-R [%04X] SSC [%02X]", lra, rfssid, lsysid, channelt, channelr, sysclass); + fprintf (stderr, " LRA [%02X] RFSS[%03d] SYSID [%03X] SITE [%03X] CHAN-T [%04X] CHAN-R [%04X] SSC [%02X]", lra, rfssid, lsysid, siteid, channelt, channelr, sysclass); process_channel_to_freq (opts, state, channelt); process_channel_to_freq (opts, state, channelr); }