Forward MLAT traffic to Stratux JSON output, marked with IsMlat:true value in JSON
This commit is contained in:
parent
6a4a239d0f
commit
6714148c45
14
net_io.c
14
net_io.c
|
|
@ -803,10 +803,6 @@ static void modesSendStratuxOutput(struct modesMessage *mm, struct aircraft *a)
|
||||||
if (mm->correctedbits >= 2)
|
if (mm->correctedbits >= 2)
|
||||||
return;
|
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
|
// Don't ever send unreliable messages via Stratux output
|
||||||
if (!mm->reliable && !a->reliable)
|
if (!mm->reliable && !a->reliable)
|
||||||
return;
|
return;
|
||||||
|
|
@ -827,17 +823,23 @@ static void modesSendStratuxOutput(struct modesMessage *mm, struct aircraft *a)
|
||||||
cacf = mm->CF;
|
cacf = mm->CF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* is_mlat_str = "false";
|
||||||
|
if (mm->source == SOURCE_MLAT)
|
||||||
|
is_mlat_str = "true";
|
||||||
|
|
||||||
p = safe_snprintf(p, end,
|
p = safe_snprintf(p, end,
|
||||||
"{\"Icao_addr\":%d,"
|
"{\"Icao_addr\":%d,"
|
||||||
"\"DF\":%d,\"CA\":%d,"
|
"\"DF\":%d,\"CA\":%d,"
|
||||||
"\"TypeCode\":%d,"
|
"\"TypeCode\":%d,"
|
||||||
"\"SubtypeCode\":%d,"
|
"\"SubtypeCode\":%d,"
|
||||||
"\"SignalLevel\":%f,",
|
"\"SignalLevel\":%f,"
|
||||||
|
"\"IsMlat\":%s,",
|
||||||
mm->addr,
|
mm->addr,
|
||||||
mm->msgtype, cacf,
|
mm->msgtype, cacf,
|
||||||
mm->metype,
|
mm->metype,
|
||||||
mm->mesub,
|
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
|
//// callsign
|
||||||
if (mm->callsign_valid)
|
if (mm->callsign_valid)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue