diff --git a/net_io.c b/net_io.c index 49817a96..b72ff1ec 100644 --- a/net_io.c +++ b/net_io.c @@ -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; @@ -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); } @@ -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);