Skip to content

Commit

Permalink
Merge pull request MalcolmRobb#79 from b3nn0/dev
Browse files Browse the repository at this point in the history
Forward MLAT traffic to Stratux JSON output, marked with IsMlat:true in JSON
  • Loading branch information
mutability authored Sep 12, 2020
2 parents 24e5876 + 6714148 commit 774c3cd
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions net_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,10 +803,6 @@ static void modesSendStratuxOutput(struct modesMessage *mm, struct aircraft *a)
if (mm->correctedbits >= 2)
return;

// Don't ever forward mlat messages via Stratux output.
if (mm->source == SOURCE_MLAT)
return;

// Don't ever send unreliable messages via Stratux output
if (!mm->reliable && !a->reliable)
return;
Expand All @@ -827,17 +823,23 @@ static void modesSendStratuxOutput(struct modesMessage *mm, struct aircraft *a)
cacf = mm->CF;
}

const char* is_mlat_str = "false";
if (mm->source == SOURCE_MLAT)
is_mlat_str = "true";

p = safe_snprintf(p, end,
"{\"Icao_addr\":%d,"
"\"DF\":%d,\"CA\":%d,"
"\"TypeCode\":%d,"
"\"SubtypeCode\":%d,"
"\"SignalLevel\":%f,",
"\"SignalLevel\":%f,"
"\"IsMlat\":%s,",
mm->addr,
mm->msgtype, cacf,
mm->metype,
mm->mesub,
mm->signalLevel); // what precision and range is needed for RSSI?
mm->signalLevel, // what precision and range is needed for RSSI?
is_mlat_str);

//// callsign
if (mm->callsign_valid)
Expand Down

0 comments on commit 774c3cd

Please sign in to comment.