Refactored protocol and radio interfaces

This commit is contained in:
2026-02-18 10:08:11 +01:00
parent 74a517a22a
commit 71b4f3734c
5 changed files with 223 additions and 62 deletions

View File

@@ -55,6 +55,12 @@ func decodeFrequency(b []byte) float64 {
return float64(int64(binary.LittleEndian.Uint32(b))) / 1e3
}
func decodeLatLon(b []byte) (lat float64, lng float64) {
lat = float64(int64(binary.LittleEndian.Uint32(b[0:]))) / 1e6
lng = float64(int64(binary.LittleEndian.Uint32(b[4:]))) / 1e6
return
}
func decodeCString(b []byte) string {
if i := bytes.IndexByte(b, 0x00); i > -1 {
return string(b[:i])