mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-19 20:27:26 -05:00
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:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user