Skip to content

Commit

Permalink
Devel/flarm receiver (#8)
Browse files Browse the repository at this point in the history
* Add info to main status help page.

Fixes cyoung#728.

* Adds AU tail number decoding from ICAO addr.

Contribution by @armeniki. cyoung#736.

* update readme

Remove line about dangerzone and added kwikEFIS to the list of apps that support Stratux

* Revert 0d93623.

* Add SoftRF udev rules and "ping" code hack (temporary).

* Update gen_gdl90.go

* Update flarm.go
  • Loading branch information
tobo07 authored Sep 22, 2018
1 parent 3af934b commit 6239b24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion main/flarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions main/gen_gdl90.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 6239b24

Please sign in to comment.