From 6239b2449e3a834e88240e722190624c26f0aa3b Mon Sep 17 00:00:00 2001 From: tobo07 <39865951+tobo07@users.noreply.github.com> Date: Sat, 22 Sep 2018 22:04:34 +0200 Subject: [PATCH] Devel/flarm receiver (#8) * Add info to main status help page. Fixes #728. * Adds AU tail number decoding from ICAO addr. Contribution by @armeniki. #736. * update readme Remove line about dangerzone and added kwikEFIS to the list of apps that support Stratux * Revert 0d93623b94e73cc930a45f8e95219dac8b69b95b. * Add SoftRF udev rules and "ping" code hack (temporary). * Update gen_gdl90.go * Update flarm.go --- main/flarm.go | 4 +++- main/gen_gdl90.go | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/main/flarm.go b/main/flarm.go index 8618f7280..7c4563519 100644 --- a/main/flarm.go +++ b/main/flarm.go @@ -382,7 +382,9 @@ func processAprsData(aprsData string) { // set altitude ti.Alt = int32(data.Altitude) - ti.AltIsGNSS = true + ti.Alt = ti.Alt - int32(mySituation.GPSGeoidSep) // fix geoid sep + ti.Alt = ti.Alt - int32(mySituation.GPSAltitudeMSL) + int32(mySituation.BaroPressureAltitude) // calc traffic's baro alt + ti.AltIsGNSS = false ti.Last_alt = stratuxClock.Time // set vertical speed diff --git a/main/gen_gdl90.go b/main/gen_gdl90.go index b63f48191..d691e34c5 100644 --- a/main/gen_gdl90.go +++ b/main/gen_gdl90.go @@ -440,10 +440,10 @@ func makeOwnshipGeometricAltitudeReport() bool { } msg := make([]byte, 5) // See p.28. - msg[0] = 0x0B // Message type "Ownship Geo Alt". - alt := int16(mySituation.GPSAltitudeMSL / 5) // GPS Altitude, encoded to 16-bit int using 5-foot resolution - msg[1] = byte(alt >> 8) // Altitude. - msg[2] = byte(alt & 0x00FF) // Altitude. + msg[0] = 0x0B // Message type "Ownship Geo Alt". + alt := int16(mySituation.GPSHeightAboveEllipsoid / 5) // GPS Altitude, encoded to 16-bit int using 5-foot resolution + msg[1] = byte(alt >> 8) // Altitude. + msg[2] = byte(alt & 0x00FF) // Altitude. //TODO: "Figure of Merit". 0x7FFF "Not available". msg[3] = 0x00 @@ -671,7 +671,7 @@ func makeFFIDMessage() []byte { } copy(msg[19:], devLongName) - msg[38] = 0x01 // Capabilities mask. MSL altitude for Ownship Geometric report. + msg[38] = 0x00 // Capabilities mask. Altitude above the WGS84 ellipsoid for Ownship Geometric report. return prepareMessage(msg) }