diff --git a/dump1090.h b/dump1090.h index 30b29a7..15aed5b 100644 --- a/dump1090.h +++ b/dump1090.h @@ -141,6 +141,7 @@ #define MODES_ACFLAGS_FS_VALID (1<<13) // Aircraft Flight Status is known #define MODES_ACFLAGS_NSEWSPD_VALID (1<<14) // Aircraft EW and NS Speed is known #define MODES_ACFLAGS_LATLON_REL_OK (1<<15) // Indicates it's OK to do a relative CPR +#define MODES_ACFLAGS_MLAT (1<<16) // Position is from mlat #define MODES_ACFLAGS_LLEITHER_VALID (MODES_ACFLAGS_LLEVEN_VALID | MODES_ACFLAGS_LLODD_VALID) #define MODES_ACFLAGS_LLBOTH_VALID (MODES_ACFLAGS_LLEVEN_VALID | MODES_ACFLAGS_LLODD_VALID) diff --git a/interactive.c b/interactive.c index f9d8724..b9829c0 100644 --- a/interactive.c +++ b/interactive.c @@ -371,6 +371,10 @@ struct aircraft *interactiveReceiveData(struct modesMessage *mm, struct client * //If we sucessfully decoded, back copy the results to mm so that we can print them in list output if (location_ok) { mm->bFlags |= MODES_ACFLAGS_LATLON_VALID; + if (mm->timestampMsg == 0xFF004D4C4154) // Magic mlat timestamp + mm->bFlags |= MODES_ACFLAGS_MLAT; + else + a->bFlags &= ~MODES_ACFLAGS_MLAT; mm->fLat = a->lat; mm->fLon = a->lon; } diff --git a/net_io.c b/net_io.c index 7a701e4..58e0ed6 100644 --- a/net_io.c +++ b/net_io.c @@ -681,9 +681,10 @@ char *aircraftsToJson(int *len) { l = snprintf(p,buflen, "{\"hex\":\"%06x\", \"squawk\":\"%04x\", \"flight\":\"%s\", \"lat\":%f, " "\"lon\":%f, \"validposition\":%d, \"altitude\":%d, \"vert_rate\":%d,\"track\":%d, \"validtrack\":%d," - "\"speed\":%d, \"messages\":%ld, \"seen\":%d},\n", + "\"speed\":%d, \"messages\":%ld, \"seen\":%d, \"mlat\":%s},\n", a->addr, a->modeA, a->flight, a->lat, a->lon, position, a->altitude, a->vert_rate, a->track, track, - a->speed, a->messages, (int)(now - a->seen)); + a->speed, a->messages, (int)(now - a->seen), + (a->bFlags & MODES_ACFLAGS_MLAT) ? "true" : "false"); p += l; buflen -= l; //Resize if needed diff --git a/public_html/planeObject.js b/public_html/planeObject.js index dfb0130..2b5ef8b 100644 --- a/public_html/planeObject.js +++ b/public_html/planeObject.js @@ -23,6 +23,7 @@ var planeObject = { // Vaild... vPosition : false, vTrack : false, + mlat : false, // GMap Details marker : null, @@ -142,6 +143,7 @@ var planeObject = { this.icao = data.hex; this.messages = data.messages; this.seen = data.seen; + this.mlat = data.mlat; // If no packet in over 58 seconds, consider the plane reapable // This way we can hold it, but not show it just in case the plane comes back diff --git a/public_html/script.js b/public_html/script.js index accf1f0..931b4bf 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -326,6 +326,9 @@ function refreshSelected() { html += '