Skip to content

Commit 774c3cd

Browse files
authored
Merge pull request MalcolmRobb#79 from b3nn0/dev
Forward MLAT traffic to Stratux JSON output, marked with IsMlat:true in JSON
2 parents 24e5876 + 6714148 commit 774c3cd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

net_io.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -803,10 +803,6 @@ static void modesSendStratuxOutput(struct modesMessage *mm, struct aircraft *a)
803803
if (mm->correctedbits >= 2)
804804
return;
805805

806-
// Don't ever forward mlat messages via Stratux output.
807-
if (mm->source == SOURCE_MLAT)
808-
return;
809-
810806
// Don't ever send unreliable messages via Stratux output
811807
if (!mm->reliable && !a->reliable)
812808
return;
@@ -827,17 +823,23 @@ static void modesSendStratuxOutput(struct modesMessage *mm, struct aircraft *a)
827823
cacf = mm->CF;
828824
}
829825

826+
const char* is_mlat_str = "false";
827+
if (mm->source == SOURCE_MLAT)
828+
is_mlat_str = "true";
829+
830830
p = safe_snprintf(p, end,
831831
"{\"Icao_addr\":%d,"
832832
"\"DF\":%d,\"CA\":%d,"
833833
"\"TypeCode\":%d,"
834834
"\"SubtypeCode\":%d,"
835-
"\"SignalLevel\":%f,",
835+
"\"SignalLevel\":%f,"
836+
"\"IsMlat\":%s,",
836837
mm->addr,
837838
mm->msgtype, cacf,
838839
mm->metype,
839840
mm->mesub,
840-
mm->signalLevel); // what precision and range is needed for RSSI?
841+
mm->signalLevel, // what precision and range is needed for RSSI?
842+
is_mlat_str);
841843

842844
//// callsign
843845
if (mm->callsign_valid)

0 commit comments

Comments
 (0)