-
Notifications
You must be signed in to change notification settings - Fork 1
/
aprs_message.go
47 lines (43 loc) · 1.41 KB
/
aprs_message.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package models
type PacketType int
const (
LocationPacketType PacketType = iota
ObjectPacketType
ItemPacketType
MicePacketType
NMEAPacketType
WXPacketType
MessagePacketType
CapabilitiesPacketType
StatusPacketType
TelemetryPacketType
TelemetryMessagePacketType
DXSpotPacketType
ExperimentalPacketType
InvalidPacketType
)
type AprsMessage struct {
PacketType
Timestamp int32 `json:"timestamp"`
SourceCallsign string `json:"src_callsign"`
DestinationCallsign string `json:"dst_callsign"`
Status string `json:"status"`
Symbol string `json:"symbol"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
IncludesPosition bool `json:"includes_position"`
Altitude float64 `json:"altitude"`
Speed float64 `json:"speed"`
Course uint8 `json:"course"`
Weather *WeatherReport `json:"weather_report"`
RawMessage string `json:"raw_message"`
}
type WeatherReport struct {
Temperature float64 `json:"temp"`
InsideTemperature float64 `json:"temp_in"`
Humidity uint8 `json:"humidity"`
InsideHumidity uint8 `json:"humidity_in"`
WindGust float64 `json:"wind_gust"`
WindDirection uint8 `json:"wind_dir"`
WindSpeed float64 `json:"wind_speed"`
}