kopia lustrzana https://github.com/cyoung/stratux
Use "N" or "C" regs derived from Mode-S identifier, or default to "Stratux".
rodzic
99ac28b104
commit
915391fa91
|
@ -408,14 +408,27 @@ func makeOwnshipReport() bool {
|
||||||
msg[19+i] = tail[i]
|
msg[19+i] = tail[i]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Create callsign "Stratux".
|
|
||||||
msg[19] = 0x53
|
myReg := "Stratux" // Default callsign.
|
||||||
msg[20] = 0x74
|
// Use icao2reg() results for ownship tail number, if available.
|
||||||
msg[21] = 0x72
|
if len(code) == 3 {
|
||||||
msg[22] = 0x61
|
uintIcao := uint32(code[0])<<16 | uint32(code[1])<<8 | uint32(code[2])
|
||||||
msg[23] = 0x74
|
regFromIcao, regFromIcaoValid := icao2reg(uintIcao)
|
||||||
msg[24] = 0x75
|
if regFromIcaoValid {
|
||||||
msg[25] = 0x78
|
// Valid "decoded" registration. Use this for the reg.
|
||||||
|
myReg = regFromIcao
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Truncate registration to 8 characters.
|
||||||
|
if len(myReg) > 8 {
|
||||||
|
myReg = myReg[:8]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write the callsign.
|
||||||
|
for i := 0; i < len(myReg); i++ {
|
||||||
|
msg[19+i] = myReg[i]
|
||||||
|
}
|
||||||
|
|
||||||
sendGDL90(prepareMessage(msg), false)
|
sendGDL90(prepareMessage(msg), false)
|
||||||
return true
|
return true
|
||||||
|
|
Ładowanie…
Reference in New Issue