mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-20 04:37:26 -05:00
P25 - Better Handling of Trunking ENC Call Lockout; Fix Duplicate Channel Listing in Multi Grant Updates;
This commit is contained in:
@@ -627,6 +627,47 @@ processLDU2 (dsd_opts * opts, dsd_state * state)
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
|
||||
|
||||
#define P25p1_ENC_LO //disable if this behavior is detremental
|
||||
#ifdef P25p1_ENC_LO
|
||||
//If trunking and tuning ENC calls is disabled, lock out and go back to CC
|
||||
int enc_lo = 1; int ttg = state->lasttg; //checking to a valid TG will help make sure we have a good LDU1 LCW or HDU first
|
||||
if (irrecoverable_errors == 0 && state->payload_algid != 0x80 && state->payload_algid != 0 && opts->p25_trunk == 1 && opts->p25_is_tuned == 1 && opts->trunk_tune_enc_calls == 0)
|
||||
{
|
||||
//NOTE: This may still cause an issue IF we havent' loaded the key yet from keyloader
|
||||
if (state->payload_algid == 0xAA && state->R != 0) enc_lo = 0;
|
||||
// else if (future condition) enc_lo = 0;
|
||||
// else if (future condition) enc_lo = 0;
|
||||
|
||||
//if this is locked out by conditions above, then write it into the TG mode if we have a TG value assigned
|
||||
if (enc_lo == 1 && ttg != 0)
|
||||
{
|
||||
int xx = 0; int enc_wr = 0;
|
||||
for (xx = 0; xx < state->group_tally; xx++)
|
||||
{
|
||||
if (state->group_array[xx].groupNumber == ttg)
|
||||
{
|
||||
enc_wr = 1; //already in there, so no need to assign it
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//if not already in there, so save it there now
|
||||
if (enc_wr == 0)
|
||||
{
|
||||
state->group_array[state->group_tally].groupNumber = ttg;
|
||||
sprintf (state->group_array[state->group_tally].groupMode, "%s", "DE");
|
||||
sprintf (state->group_array[state->group_tally].groupName, "%s", "ENC LO"); //was xx and not state->group_tally
|
||||
state->group_tally++;
|
||||
}
|
||||
|
||||
//return to the control channel
|
||||
fprintf (stderr, " No Enc Following on P25p1 Trunking; Return to CC; \n");
|
||||
return_to_cc (opts, state);
|
||||
}
|
||||
}
|
||||
#endif //P25p1_ENC_LO
|
||||
|
||||
}
|
||||
|
||||
//LFSR code courtesy of https://github.com/mattames/LFSR/
|
||||
|
||||
Reference in New Issue
Block a user