Removed ForeFlight GDL90 parsing bug workaround.
604.
@@ -268,23 +268,23 @@ func makeOwnshipReport() bool {
}
// This is **PRESSURE ALTITUDE**
- //FIXME: Temporarily removing "invalid altitude" when pressure altitude not available - using GPS altitude instead.
- // alt := uint16(0xFFF) // 0xFFF "invalid altitude."
+ alt := uint16(0xFFF) // 0xFFF "invalid altitude."
+ validAltf := false
- var alt uint16
var altf float64
if selfOwnshipValid {
altf = float64(curOwnship.Alt)
+ validAltf = true
} else if isTempPressValid() {
altf = float64(mySituation.Pressure_alt)
- } else {
- altf = float64(mySituation.Alt) //FIXME: Pass GPS altitude if PA not available. **WORKAROUND FOR FF**
+ validAltf = true
}
+ if validAltf {
altf = (altf + 1000) / 25
-
alt = uint16(altf) & 0xFFF // Should fit in 12 bits.
+ }
msg[11] = byte((alt & 0xFF0) >> 4) // Altitude.
msg[12] = byte((alt & 0x00F) << 4)
