DMR: Add -M option to allow forcing any algid value;

Remove Setting from DMR_LE and place in MBE section instead;

Change state->M to state->forced_alg_id to make it easier to find later;
This commit is contained in:
lwvmobile
2025-10-31 09:41:10 -04:00
parent 14edf325bc
commit eb76ea2039
11 changed files with 68 additions and 62 deletions

View File

@@ -189,7 +189,7 @@ void NXDN_Elements_Content_decode(dsd_opts * opts, dsd_state * state,
state->nxdn_last_rid = 0;
state->nxdn_last_tg = 0;
if (state->M == 0)
if (state->forced_alg_id == 0)
state->nxdn_cipher_type = 0;
sprintf (state->nxdn_call_type, "%s", "");
@@ -207,7 +207,7 @@ void NXDN_Elements_Content_decode(dsd_opts * opts, dsd_state * state,
state->nxdn_last_rid = 0;
state->nxdn_last_tg = 0;
if (state->M == 0)
if (state->forced_alg_id == 0)
state->nxdn_cipher_type = 0;
sprintf (state->nxdn_call_type, "%s", "");
#endif
@@ -689,7 +689,7 @@ void NXDN_decode_VCALL_ASSGN(dsd_opts * opts, dsd_state * state, uint8_t * Messa
fprintf (stderr, " Key Loaded: %lld", state->rkey_array[DestinationID]);
state->payload_miN = state->R; //should be okay to load here, will test
}
if (state->M == 1) state->nxdn_cipher_type = 0x1;
if (state->forced_alg_id == 1) state->nxdn_cipher_type = 0x1;
}
//rtl
else if (opts->audio_in_type == 3)
@@ -737,7 +737,7 @@ void NXDN_decode_VCALL_ASSGN(dsd_opts * opts, dsd_state * state, uint8_t * Messa
fprintf (stderr, " Key Loaded: %lld", state->rkey_array[DestinationID]);
state->payload_miN = state->R; //should be okay to load here, will test
}
if (state->M == 1) state->nxdn_cipher_type = 0x1;
if (state->forced_alg_id == 1) state->nxdn_cipher_type = 0x1;
#endif
}
@@ -1760,7 +1760,7 @@ void NXDN_decode_scch(dsd_opts * opts, dsd_state * state, uint8_t * Message, uin
//check the rkey array for a scrambler key value
//TGT ID and Key ID could clash though if csv or system has both with different keys
if (state->rkey_array[id] != 0) state->R = state->rkey_array[id];
if (state->M == 1) state->nxdn_cipher_type = 0x1;
if (state->forced_alg_id == 1) state->nxdn_cipher_type = 0x1;
}
//rtl
else if (opts->audio_in_type == 3)
@@ -1779,7 +1779,7 @@ void NXDN_decode_scch(dsd_opts * opts, dsd_state * state, uint8_t * Message, uin
//check the rkey array for a scrambler key value
//TGT ID and Key ID could clash though if csv or system has both with different keys
if (state->rkey_array[id] != 0) state->R = state->rkey_array[id];
if (state->M == 1) state->nxdn_cipher_type = 0x1;
if (state->forced_alg_id == 1) state->nxdn_cipher_type = 0x1;
#endif
}