Refactored protocol and radio interfaces
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user