Distinguish "unknown format" from "didn't even try to decode"
when decoding Comm-B messages
This commit is contained in:
parent
9f146fcb71
commit
c148fdca84
5
comm_b.c
5
comm_b.c
|
|
@ -47,12 +47,11 @@ static CommBDecoderFn comm_b_decoders[] = {
|
|||
|
||||
void decodeCommB(struct modesMessage *mm)
|
||||
{
|
||||
mm->commb_format = COMMB_UNKNOWN;
|
||||
|
||||
// If DR or UM are set, this message is _probably_ noise
|
||||
// as nothing really seems to use the multisite broadcast stuff?
|
||||
// Also skip anything that had errors corrected
|
||||
if (mm->DR != 0 || mm->UM != 0 || mm->correctedbits > 0) {
|
||||
mm->commb_format = COMMB_NOT_DECODED;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -79,6 +78,8 @@ void decodeCommB(struct modesMessage *mm)
|
|||
// decode it
|
||||
bestDecoder(mm, true);
|
||||
}
|
||||
} else {
|
||||
mm->commb_format = COMMB_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@ typedef enum {
|
|||
typedef enum {
|
||||
COMMB_UNKNOWN,
|
||||
COMMB_AMBIGUOUS,
|
||||
COMMB_NOT_DECODED,
|
||||
COMMB_EMPTY_RESPONSE,
|
||||
COMMB_DATALINK_CAPS,
|
||||
COMMB_GICB_CAPS,
|
||||
|
|
|
|||
2
mode_s.c
2
mode_s.c
|
|
@ -1681,6 +1681,8 @@ static const char *commb_format_to_string(commb_format_t format) {
|
|||
return "empty response";
|
||||
case COMMB_AMBIGUOUS:
|
||||
return "ambiguous format";
|
||||
case COMMB_NOT_DECODED:
|
||||
return "not decoded";
|
||||
case COMMB_DATALINK_CAPS:
|
||||
return "BDS1,0 Datalink capabilities";
|
||||
case COMMB_GICB_CAPS:
|
||||
|
|
|
|||
Loading…
Reference in New Issue