diff --git a/src/dmr_csbk.c b/src/dmr_csbk.c index add3d5c..0780788 100644 --- a/src/dmr_csbk.c +++ b/src/dmr_csbk.c @@ -490,10 +490,30 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 fprintf (stderr, "\n"); fprintf (stderr, " Clear (P_CLEAR) %d", clear); + //check to see if this is a dummy csbk sent from link control to signal return to tscc + if (clear && csbk_fid == 255) fprintf (stderr, " No Encrypted Call Trunking; Return to CC; "); + if (!clear && csbk_fid == 255) fprintf (stderr, " No Encrypted Call Trunking; Other Slot Busy; "); + if (clear) { if (opts->p25_trunk == 1 && state->p25_cc_freq != 0 && opts->p25_is_tuned == 1) { + + //display/le bug fix when p_clear activated + // if (state->currentslot == 0) + // { + // state->payload_mi = 0; + // state->payload_algid = 0; + // state->payload_keyid = 0; + // state->dmr_so = 0; + // } + // if (state->currentslot == 1) + // { + // state->payload_miR = 0; + // state->payload_algidR = 0; + // state->payload_keyidR = 0; + // state->dmr_soR = 0; + // } //rigctl if (opts->use_rigctl == 1) diff --git a/src/dmr_flco.c b/src/dmr_flco.c index 84d729f..279d810 100644 --- a/src/dmr_flco.c +++ b/src/dmr_flco.c @@ -422,6 +422,45 @@ void dmr_flco (dsd_opts * opts, dsd_state * state, uint8_t lc_bits[], uint32_t C // strcat (state->call_string[slot], " Encrypted"); fprintf (stderr, "%s", KRED); fprintf(stderr, "Encrypted "); + + //experimental TG LO/B if ENC trunked following disabled //DMR -- LO Trunked Enc Calls WIP; #121 + if (opts->p25_trunk == 1 && opts->trunk_tune_enc_calls == 0) //&& type != 2 + { + int i, lo = 0; + uint32_t t = 0; char gm[8]; char gn[50]; + + //check to see if this group already exists, or has already been locked out, or is allowed + for (i = 0; i <= state->group_tally; i++) + { + t = (uint32_t)state->group_array[i].groupNumber; + if (target == t && t != 0) + { + lo = 1; + //write current mode and name to temp strings + sprintf (gm, "%s", state->group_array[i].groupMode); + sprintf (gn, "%s", state->group_array[i].groupName); + break; + } + } + + //if group doesn't exist, or isn't locked out, then do so now. + if (lo == 0) + { + state->group_array[state->group_tally].groupNumber = target; + sprintf (state->group_array[state->group_tally].groupMode, "%s", "DE"); + sprintf (state->group_array[state->group_tally].groupName, "%s", "ENC LO"); + sprintf (gm, "%s", "DE"); + sprintf (gn, "%s", "ENC LO"); + state->group_tally++; + } + + //Craft a fake CSBK pdu send it to run as a p_clear to return to CC if available + uint8_t dummy[12]; uint8_t* dbits; memset (dummy, 0, sizeof(dummy)); dummy[0] = 46; dummy[1] = 255; + if ( (strcmp(gm, "DE") == 0) && (strcmp(gn, "ENC LO") == 0) ) //&& (opts->trunk_tune_data_calls == 0) + dmr_cspdu (opts, state, dbits, dummy, 1, 0); + + } + } //REMUS! Uncomment Line Below if desired // else strcat (state->call_string[slot], " ");