kopia lustrzana https://github.com/cyoung/stratux
Merge branch 'master' into newradio
commit
b10b1769d8
|
@ -24,16 +24,13 @@ Apps with stratux recognition/support:
|
|||
* AvPlan EFB.
|
||||
* iFly GPS 9.4+.
|
||||
* DroidEFB 2.1.1+.
|
||||
|
||||
* kwikEFIS
|
||||
|
||||
Tested weather/traffic displays:
|
||||
* Avare
|
||||
|
||||
Other EFBs? See the [app vendor integration guide](https://github.com/cyoung/stratux/blob/master/notes/app-vendor-integration.md).
|
||||
|
||||
Dangerzone builds (AHRS display):
|
||||
* ForeFlight 7+ - weather, traffic, AHRS.
|
||||
|
||||
Questions? [See the FAQ](https://github.com/cyoung/stratux/wiki/FAQ)
|
||||
|
||||
http://stratux.me/
|
||||
|
@ -47,6 +44,7 @@ Jet tests (high gain antennas):
|
|||
* Dassault Falcon 20
|
||||
* Embraer ERJ 145
|
||||
* Cessna Citation 501
|
||||
* Citation Sovereign+
|
||||
* Lear 35
|
||||
* Rockwell B-1b
|
||||
* Boeing C-17
|
||||
|
|
|
@ -33,3 +33,11 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="
|
|||
# --set-bus-powered=no
|
||||
|
||||
SUBSYSTEMS=="usb", ATTRS{interface}=="Stratux Serialout", SYMLINK+="serialout%n"
|
||||
|
||||
|
||||
# SoftRF.
|
||||
|
||||
# SoftRF Standalone (NodeMCU or DoIt ESP32 devkit with CP2102 chip)
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{product}=="DIY SoftRF", SYMLINK+="softrf"
|
||||
# TTGO T-Beam (ESP32 with OTP CP2104 chip)
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{product}=="CP2104 USB to UART Bridge Controller", SYMLINK+="softrf"
|
||||
|
|
12
main/gps.go
12
main/gps.go
|
@ -303,12 +303,12 @@ func initGPSSerial() bool {
|
|||
glonass := []byte{0x06, 0x04, 0x0E, 0x00, 0x00, 0x00, 0x01, 0x01} // this disables GLONASS
|
||||
galileo := []byte{0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x01, 0x01} // this disables Galileo
|
||||
|
||||
//if (globalStatus.GPS_detected_type == GPS_TYPE_UBX8) || (globalStatus.GPS_detected_type == GPS_TYPE_UART) { // assume that any GPS connected to serial GPIO is ublox8 (RY835/6AI)
|
||||
//log.Printf("UBX8 device detected on USB, or GPS serial connection in use. Attempting GLONASS and Galelio configuration.\n")
|
||||
// glonass = []byte{0x06, 0x08, 0x0E, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables GLONASS with 8-14 tracking channels
|
||||
// galileo = []byte{0x02, 0x04, 0x08, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables Galileo with 4-8 tracking channels
|
||||
// updatespeed = []byte{0x06, 0x00, 0xF4, 0x01, 0x01, 0x00} // Nav speed 2Hz
|
||||
// }
|
||||
if (globalStatus.GPS_detected_type == GPS_TYPE_UBX8) || (globalStatus.GPS_detected_type == GPS_TYPE_UART) { // assume that any GPS connected to serial GPIO is ublox8 (RY835/6AI)
|
||||
log.Printf("UBX8 device detected on USB, or GPS serial connection in use. Attempting GLONASS and Galelio configuration.\n")
|
||||
glonass = []byte{0x06, 0x08, 0x0E, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables GLONASS with 8-14 tracking channels
|
||||
galileo = []byte{0x02, 0x04, 0x08, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables Galileo with 4-8 tracking channels
|
||||
updatespeed = []byte{0x06, 0x00, 0xF4, 0x01, 0x01, 0x00} // Nav speed 2Hz
|
||||
}
|
||||
cfgGnss = append(cfgGnss, gps...)
|
||||
cfgGnss = append(cfgGnss, sbas...)
|
||||
cfgGnss = append(cfgGnss, beidou...)
|
||||
|
|
|
@ -40,6 +40,9 @@ func initPingSerial() bool {
|
|||
|
||||
if _, err := os.Stat("/dev/ping"); err == nil {
|
||||
device = "/dev/ping"
|
||||
} else if _, err := os.Stat("/dev/softrf"); err == nil {
|
||||
device = "/dev/softrf"
|
||||
baudrate = int(38400)
|
||||
} else {
|
||||
log.Printf("No suitable Ping device found.\n")
|
||||
return false
|
||||
|
|
|
@ -1164,11 +1164,13 @@ func updateDemoTraffic(icao uint32, tail string, relAlt float32, gs float64, off
|
|||
but are not used for aicraft on the civil registry. These could be
|
||||
military, other public aircraft, or future use.
|
||||
|
||||
|
||||
Values between C0CDF9 - C3FFFF are allocated to Canada,
|
||||
but are not used for aicraft on the civil registry. These could be
|
||||
military, other public aircraft, or future use.
|
||||
|
||||
Values between 7C0000 - 7FFFFF are allocated to Australia.
|
||||
|
||||
|
||||
Output:
|
||||
string: String containing the decoded tail number (if decoding succeeded),
|
||||
"NON-NA" (for non-US / non Canada allocation), and "US-MIL" or "CA-MIL" for non-civil US / Canada allocation.
|
||||
|
@ -1189,9 +1191,11 @@ func icao2reg(icao_addr uint32) (string, bool) {
|
|||
nation = "US"
|
||||
} else if (icao_addr >= 0xC00001) && (icao_addr <= 0xC3FFFF) {
|
||||
nation = "CA"
|
||||
} else if (icao_addr >= 0x7C0000) && (icao_addr <= 0x7FFFFF) {
|
||||
nation = "AU"
|
||||
} else {
|
||||
//TODO: future national decoding.
|
||||
return "NON-NA", false
|
||||
return "OTHER", false
|
||||
}
|
||||
|
||||
if nation == "CA" { // Canada decoding
|
||||
|
@ -1222,6 +1226,29 @@ func icao2reg(icao_addr uint32) (string, bool) {
|
|||
tail = fmt.Sprintf("C-%c%c%c%c", b_str[b], c+65, d+65, e+65)
|
||||
}
|
||||
|
||||
if nation == "AU" { // Australia decoding
|
||||
|
||||
nationalOffset := uint32(0x7C0000)
|
||||
offset := (icao_addr - nationalOffset)
|
||||
i1 := offset / 1296
|
||||
offset2 := offset % 1296
|
||||
i2 := offset2 / 36
|
||||
offset3 := offset2 % 36
|
||||
i3 := offset3
|
||||
|
||||
var a_char, b_char, c_char string
|
||||
|
||||
a_char = fmt.Sprintf("%c", i1+65)
|
||||
b_char = fmt.Sprintf("%c", i2+65)
|
||||
c_char = fmt.Sprintf("%c", i3+65)
|
||||
|
||||
if i1 < 0 || i1 > 25 || i2 < 0 || i2 > 25 || i3 < 0 || i3 > 25 {
|
||||
return "OTHER", false
|
||||
}
|
||||
|
||||
tail = "VH-" + a_char + b_char + c_char
|
||||
}
|
||||
|
||||
if nation == "US" { // FAA decoding
|
||||
// First, discard addresses that are not assigned to aircraft on the civil registry
|
||||
if icao_addr > 0xADF7C7 {
|
||||
|
|
Ładowanie…
Reference in New Issue