Merge pull request #79 from b3nn0/dev

Forward MLAT traffic to Stratux JSON output, marked with IsMlat:true in JSON
This commit is contained in:
Oliver Jowett 2020-09-11 21:16:01 -05:00 committed by GitHub
commit 774c3cdd55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -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;
@ -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)