Add some testing code that looks for ambiguous syndromes that
could confuse the partial correction used in DF11. That code shows that yes, there are ambiguous syndromes in the 2-bit correction case only, so disable corrections of more than 1 bit in DF11.
This commit is contained in:
parent
5ac90e30a8
commit
26feb1d078
2 changed files with 127 additions and 6 deletions
9
mode_s.c
9
mode_s.c
|
|
@ -301,13 +301,10 @@ static int correct_aa_field(uint32_t *addr, struct errorinfo *ei)
|
|||
// 1600: DF11 with IID==0, good CRC and an address matching a known aircraft
|
||||
// 800: DF11 with IID==0, 1-bit error and an address matching a known aircraft
|
||||
// 750: DF11 with IID==0, good CRC and an address not matching a known aircraft
|
||||
// 400: DF11 with IID==0, 2-bit error and an address matching a known aircraft
|
||||
// 375: DF11 with IID==0, 1-bit error and an address not matching a known aircraft
|
||||
// 187: DF11 with IID==0, 2-bit error and an address not matching a known aircraft
|
||||
|
||||
// 1000: DF11 with IID!=0, good CRC and an address matching a known aircraft
|
||||
// 500: DF11 with IID!=0, 1-bit error and an address matching a known aircraft
|
||||
// 250: DF11 with IID!=0, 2-bit error and an address matching a known aircraft
|
||||
|
||||
// 1000: DF20/21 with a CRC-derived address matching a known aircraft
|
||||
// 500: DF20/21 with a CRC-derived address matching a known aircraft (bottom 16 bits only - overlay control in use)
|
||||
|
|
@ -349,6 +346,12 @@ int scoreModesMessage(unsigned char *msg, int validbits)
|
|||
if (!ei)
|
||||
return -2; // can't correct errors
|
||||
|
||||
// see crc.c comments: we do not attempt to fix
|
||||
// more than single-bit errors, as two-bit
|
||||
// errors are ambiguous in DF11.
|
||||
if (ei->errors > 1)
|
||||
return -2; // can't correct errors
|
||||
|
||||
// fix any errors in the address field
|
||||
correct_aa_field(&addr, ei);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue