Skip to content

Commit

Permalink
json output: fix when input is sbs input
Browse files Browse the repository at this point in the history
json output wasn't emitting anything for positions coming in via SBS
fix that
  • Loading branch information
wiedehopf committed Aug 13, 2024
1 parent d0b4e71 commit a3a174c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions net_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -5787,6 +5787,9 @@ static void outputMessage(struct modesMessage *mm) {
if (Modes.filterDF && (mm->sbs_in || !(Modes.filterDFbitset & (1 << mm->msgtype)))) {
return;
}
if (!Modes.net) {
return;
}

struct aircraft *ac = mm->aircraft;

Expand All @@ -5802,15 +5805,11 @@ static void outputMessage(struct modesMessage *mm) {

// Suppress the first message when using an SDR
// messages with crc 0 have an explicit checksum and are more reliable, don't suppress them when there was no CRC fix performed
if (Modes.net && !mm->sbs_in
if (!mm->sbs_in
&& (Modes.net_only || Modes.net_verbatim || (mm->crc == 0 && mm->correctedbits == 0) || (ac && ac->messages > 1) || mm->msgtype == DFTYPE_MODEAC)
) {
int is_mlat = (mm->source == SOURCE_MLAT);

if (mm->jsonPositionOutputEmit && Modes.json_out.connections) {
jsonPositionOutput(mm, ac);
}

if (Modes.garbage_ports && (mm->garbage || mm->pos_bad) && !mm->pos_old && Modes.garbage_out.connections) {
modesSendBeastOutput(mm, &Modes.garbage_out);
}
Expand Down Expand Up @@ -5848,7 +5847,11 @@ static void outputMessage(struct modesMessage *mm) {
}
}

if (mm->sbs_in && Modes.net && ac) {
if (mm->jsonPositionOutputEmit && Modes.json_out.connections) {
jsonPositionOutput(mm, ac);
}

if (mm->sbs_in && ac) {
if (mm->reduce_forward || !Modes.sbsReduce) {
if (Modes.sbs_out.connections) {
modesSendSBSOutput(mm, ac, &Modes.sbs_out);
Expand Down

0 comments on commit a3a174c

Please sign in to comment.