SBS Output Format changes
Bug fixes in the SBS output code as a result of an EMAIL from Liviu Some software gets upset if null fields are output where the software is expecting a valid value. This was being caused by DF0's outputting and SBS MSG5. MSG5 needs Atert and SPI flags, which are derived from the FS field. DF0 doesn't have an FS field, so cannot output a MSG5. Change so that DF0 results in an SBS MSG7. Also DF17/DF18 metypes 5 to 18 contain raw Lat/Lon data. However they cannot be decoded into real Lat/Lon values unless both even and odd parts are available Therefore, when we receive a DF17/DF18 we need to check that we have successfully decoded the Lat/Lon before we attempt to send an SBS MSG2 or MSG3. If we don't have a decoded Lat/Lon, send a MSG7 instead.
This commit is contained in:
parent
4c0ed6d5f1
commit
ee742cf8db
18
dump1090.c
18
dump1090.c
|
@ -3534,22 +3534,28 @@ void modesSendSBSOutput(struct modesMessage *mm) {
|
||||||
//
|
//
|
||||||
|
|
||||||
// Decide on the basic SBS Message Type
|
// Decide on the basic SBS Message Type
|
||||||
if ((mm->msgtype == 0) || (mm->msgtype == 4) || (mm->msgtype == 20)) {
|
if ((mm->msgtype == 4) || (mm->msgtype == 20)) {
|
||||||
msgType = 5;
|
msgType = 5;
|
||||||
} else if ((mm->msgtype == 5) || (mm->msgtype == 21)) {
|
} else if ((mm->msgtype == 5) || (mm->msgtype == 21)) {
|
||||||
msgType = 6;
|
msgType = 6;
|
||||||
} else if (mm->msgtype == 16) {
|
} else if ((mm->msgtype == 0) || (mm->msgtype == 16)) {
|
||||||
msgType = 7;
|
msgType = 7;
|
||||||
} else if (mm->msgtype == 11) {
|
} else if (mm->msgtype == 11) {
|
||||||
msgType = 8;
|
msgType = 8;
|
||||||
} else if (mm->msgtype != 17) {
|
} else if ((mm->msgtype != 17) && (mm->msgtype != 18)) {
|
||||||
return;
|
return;
|
||||||
} else if (mm->metype == 4) {
|
} else if ((mm->metype >= 1) && (mm->metype <= 4)) {
|
||||||
msgType = 1;
|
msgType = 1;
|
||||||
} else if ((mm->metype >= 5) && (mm->metype <= 8)) {
|
} else if ((mm->metype >= 5) && (mm->metype <= 8)) {
|
||||||
msgType = 2;
|
if (mm->bFlags & MODES_ACFLAGS_LATLON_VALID)
|
||||||
|
{msgType = 2;}
|
||||||
|
else
|
||||||
|
{msgType = 7;}
|
||||||
} else if ((mm->metype >= 9) && (mm->metype <= 18)) {
|
} else if ((mm->metype >= 9) && (mm->metype <= 18)) {
|
||||||
msgType = 3;
|
if (mm->bFlags & MODES_ACFLAGS_LATLON_VALID)
|
||||||
|
{msgType = 3;}
|
||||||
|
else
|
||||||
|
{msgType = 7;}
|
||||||
} else if (mm->metype != 19) {
|
} else if (mm->metype != 19) {
|
||||||
return;
|
return;
|
||||||
} else if ((mm->mesub == 1) || (mm->mesub == 2)) {
|
} else if ((mm->mesub == 1) || (mm->mesub == 2)) {
|
||||||
|
|
Loading…
Reference in a new issue