DMR: RAS Implementation; #369

RAS Implementation includes converting RAS 6-24 character passwords into 56-bit RAS Effective Key Values and Performing RAS Permutations on RAS Enabled Burst Types to Calculate the Correct MAC attachment to validate messages;

Better Handling for RAS indicators found in BPTC 196,96 Reserved Bits and handling for RAS indicator bits found in embedded link control opcode byte;

Users may either enter the RAS password with the -$ option, or the 56-bit effective key value with the -y option.

Users will no longer need to use the -F option to bypass CRC errors on RAS enabled payloads when FEC does not explicitely fail.

Removed the old float audio -y option.
This commit is contained in:
lwvmobile
2026-09-01 13:29:55 -04:00
parent 198f0eacb5
commit cc6711fe4d
11 changed files with 815 additions and 107 deletions

View File

@@ -314,3 +314,28 @@ rs_12_9_checksum_t *rs_12_9_calc_checksum(rs_12_9_codeword_t *codeword) {
}
return &rs_12_9_checksum;
}
//This will run a RS 12,9 encode on 9 bytes of input
//input is an array of 12 bytes or more
void rs_12_9_encode(uint8_t * input)
{
rs_12_9_codeword_t cw;
rs_12_9_checksum_t *cs;
//init cw
memset(cw.data, 0, 12*sizeof(uint8_t));
//init cs
memset(cs->bytes, 0, 3*sizeof(uint8_t));
//Copy 9 bytes of data input
memcpy(cw.data, input, 9);
//Calculate the 3 parity / checksum bytes
cs = rs_12_9_calc_checksum(&cw);
//Build the final 12-byte codeword
input[9] = cs->bytes[0];
input[10] = cs->bytes[1];
input[11] = cs->bytes[2];
}