faup1090: Track Comm-B ACAS RA separately to ES ACAS RA as it's useful to see both reported.
Fix repeated reporting of ES ACAS RA reports.
This commit is contained in:
parent
2bcd0741c9
commit
14a003710e
4
net_io.c
4
net_io.c
|
@ -1754,10 +1754,10 @@ static void writeFATSVEvent(struct modesMessage *mm, struct aircraft *a)
|
||||||
case 17:
|
case 17:
|
||||||
case 18:
|
case 18:
|
||||||
// DF 17/18: extended squitter
|
// DF 17/18: extended squitter
|
||||||
if (mm->metype == 28 && mm->mesub == 2 && memcmp(&mm->ME[1], &a->fatsv_emitted_bds_30[1], 6) != 0) {
|
if (mm->metype == 28 && mm->mesub == 2 && memcmp(mm->ME, &a->fatsv_emitted_es_acas_ra, 7) != 0) {
|
||||||
// type 28 subtype 2: ACAS RA report
|
// type 28 subtype 2: ACAS RA report
|
||||||
// first byte has the type/subtype, remaining bytes match the BDS 3,0 format
|
// first byte has the type/subtype, remaining bytes match the BDS 3,0 format
|
||||||
memcpy(a->fatsv_emitted_bds_30, &mm->ME[1], 6);
|
memcpy(a->fatsv_emitted_es_acas_ra, mm->ME, 7);
|
||||||
writeFATSVEventMessage(mm, "es_acas_ra", mm->ME, 7);
|
writeFATSVEventMessage(mm, "es_acas_ra", mm->ME, 7);
|
||||||
} else if (mm->metype == 31 && (mm->mesub == 0 || mm->mesub == 1) && memcmp(mm->ME, a->fatsv_emitted_es_status, 7) != 0) {
|
} else if (mm->metype == 31 && (mm->mesub == 0 || mm->mesub == 1) && memcmp(mm->ME, a->fatsv_emitted_es_status, 7) != 0) {
|
||||||
// aircraft operational status
|
// aircraft operational status
|
||||||
|
|
4
track.c
4
track.c
|
@ -71,8 +71,10 @@ struct aircraft *trackCreateAircraft(struct modesMessage *mm) {
|
||||||
a->signalLevel[i] = 1e-5;
|
a->signalLevel[i] = 1e-5;
|
||||||
a->signalNext = 0;
|
a->signalNext = 0;
|
||||||
|
|
||||||
// start off with the "last emitted" ACAS RA being blank (just the BDS 3,0 code)
|
// start off with the "last emitted" ACAS RA being blank (just the BDS 3,0
|
||||||
|
// or ES type code)
|
||||||
a->fatsv_emitted_bds_30[0] = 0x30;
|
a->fatsv_emitted_bds_30[0] = 0x30;
|
||||||
|
a->fatsv_emitted_es_acas_ra[0] = 0xE2;
|
||||||
|
|
||||||
// mm->msgtype 32 is used to represent Mode A/C. These values can never change, so
|
// mm->msgtype 32 is used to represent Mode A/C. These values can never change, so
|
||||||
// set them once here during initialisation, and don't bother to set them every
|
// set them once here during initialisation, and don't bother to set them every
|
||||||
|
|
1
track.h
1
track.h
|
@ -150,6 +150,7 @@ struct aircraft {
|
||||||
unsigned char fatsv_emitted_bds_30[7]; // -"- BDS 3,0 message
|
unsigned char fatsv_emitted_bds_30[7]; // -"- BDS 3,0 message
|
||||||
unsigned char fatsv_emitted_es_status[7]; // -"- ES operational status message
|
unsigned char fatsv_emitted_es_status[7]; // -"- ES operational status message
|
||||||
unsigned char fatsv_emitted_es_target[7]; // -"- ES target status message
|
unsigned char fatsv_emitted_es_target[7]; // -"- ES target status message
|
||||||
|
unsigned char fatsv_emitted_es_acas_ra[7]; // -"- ES ACAS RA report message
|
||||||
|
|
||||||
uint64_t fatsv_last_emitted; // time (millis) aircraft was last FA emitted
|
uint64_t fatsv_last_emitted; // time (millis) aircraft was last FA emitted
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue