-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstructs.go
237 lines (205 loc) · 6.27 KB
/
structs.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
package gpsd
import "time"
// Report is a grouping interface for all types of reports.
type Report interface {
class() string
}
type TPV struct {
Class string `json:"class"`
Device string `json:"device,omitempty"`
Status float64 `json:"status,omitempty"`
Mode float64 `json:"mode"`
Time time.Time `json:"time,omitempty"`
Ept float64 `json:"ept,omitempty"`
Lat float64 `json:"lat,omitempty"`
Lon float64 `json:"lon,omitempty"`
Alt float64 `json:"alt,omitempty"`
Eph float64 `json:"eph,omitempty"`
Epx float64 `json:"epx,omitempty"`
Epy float64 `json:"epy,omitempty"`
Epv float64 `json:"epv,omitempty"`
Track float64 `json:"track,omitempty"`
Speed float64 `json:"speed,omitempty"`
Climb float64 `json:"climb,omitempty"`
Epd float64 `json:"epd,omitempty"`
Eps float64 `json:"eps,omitempty"`
Epc float64 `json:"epc,omitempty"`
}
func (r *TPV) class() string {
return r.Class
}
type SKY struct {
Class string `json:"class"`
Device string `json:"device,omitempty"`
Time time.Time `json:"time,omitempty"`
Xdop float64 `json:"xdop,omitempty"`
Ydop float64 `json:"ydop,omitempty"`
Vdop float64 `json:"vdop,omitempty"`
Tdop float64 `json:"tdop,omitempty"`
Hdop float64 `json:"hdop,omitempty"`
Pdop float64 `json:"pdop,omitempty"`
Gdop float64 `json:"gdop,omitempty"`
Satellites []Satellite `json:"satellites"`
}
func (r *SKY) class() string {
return r.Class
}
type Satellite struct {
PRN float64 `json:"PRN"`
Az float64 `json:"az"`
El float64 `json:"el"`
Ss float64 `json:"ss"`
Used bool `json:"used"`
}
type GST struct {
Class string `json:"class"`
Device string `json:"device,omitempty"`
Time time.Time `json:"time,omitempty"`
Rms float64 `json:"rms,omitempty"`
Major float64 `json:"major,omitempty"`
Minor float64 `json:"minor,omitempty"`
Orient float64 `json:"orient,omitempty"`
Lat float64 `json:"lat,omitempty"`
Lon float64 `json:"lon,omitempty"`
Alt float64 `json:"alt,omitempty"`
}
func (r *GST) class() string {
return r.Class
}
type ATT struct {
Class string `json:"class"`
Device string `json:"device"`
Time time.Time `json:"time,omitempty"`
Heading float64 `json:"heading,omitempty"`
MagSt string `json:"mag_st,omitempty"`
Pitch float64 `json:"pitch,omitempty"`
PitchSt string `json:"pitch_st,omitempty"`
Yaw float64 `json:"yaw,omitempty"`
YawSt string `json:"yaw_st,omitempty"`
Roll float64 `json:"roll,omitempty"`
RollSt string `json:"roll_st,omitempty"`
Dip float64 `json:"dip,omitempty"`
MagLen float64 `json:"mag_len,omitempty"`
MagX float64 `json:"mag_x,omitempty"`
MagY float64 `json:"mag_y,omitempty"`
MagZ float64 `json:"mag_z,omitempty"`
AccLen float64 `json:"acc_len,omitempty"`
AccX float64 `json:"acc_x,omitempty"`
AccY float64 `json:"acc_y,omitempty"`
AccZ float64 `json:"acc_z,omitempty"`
GyroX float64 `json:"gyro_x,omitempty"`
GyroY float64 `json:"gyro_y,omitempty"`
Depth float64 `json:"depth,omitempty"`
Temp float64 `json:"temp,omitempty"`
}
func (r *ATT) class() string {
return r.Class
}
type VERSION struct {
Class string `json:"class"`
Release string `json:"release"`
Rev string `json:"rev"`
ProtoMajor float64 `json:"proto_major"`
ProtoMinor float64 `json:"proto_minor"`
Remove string `json:"remote,omitempty"`
}
func (r *VERSION) class() string {
return r.Class
}
type DEVICES struct {
Class string `json:"class"`
Devices []DEVICE `json:"devices"`
Remote string `json:"remote,omitempty"`
}
func (r *DEVICES) class() string {
return r.Class
}
type WATCH struct {
Class string `json:"class"`
Enable bool `json:"enable,omitempty"`
Json bool `json:"json,omitempty"`
Nmea bool `json:"nmea,omitempty"`
Raw float64 `json:"raw,omitempty"`
Scaled bool `json:"scaled,omitempty"`
Split24 bool `json:"split24,omitempty"`
Pps bool `json:"pps,omitempty"`
Device string `json:"device,omitempty"`
Remote string `json:"remote,omitempty"`
}
func (r *WATCH) class() string {
return r.Class
}
type POLL struct {
Class string `json:"class"`
Time time.Time `json:"time"`
Active float64 `json:"active"`
Tpv []TPV `json:"tpv"`
Sky []SKY `json:"sky"`
Gst []GST `json:"gst"`
}
func (r *POLL) class() string {
return r.Class
}
type TOFF struct {
Class string `json:"class"`
Device string `json:"device"`
RealSec float64 `json:"real_sec"`
RealNSec float64 `json:"real_nsec"`
ClockSec float64 `json:"clock_sec"`
ClockNSec float64 `json:"clock_nsec"`
}
func (r *TOFF) class() string {
return r.Class
}
type PPS struct {
Class string `json:"class"`
Device string `json:"device"`
RealSec float64 `json:"real_sec"`
RealNSec float64 `json:"real_nsec"`
ClockSec float64 `json:"clock_sec"`
ClockNSec float64 `json:"clock_nsec"`
Precision float64 `json:"precision"`
}
func (r *PPS) class() string {
return r.Class
}
type OSC struct {
Class string `json:"class"`
Device string `json:"device"`
Running bool `json:"running"`
Reference bool `json:"reference"`
Disciplined bool `json:"disciplined"`
Delta float64 `json:"delta"`
}
func (r *OSC) class() string {
return r.Class
}
type DEVICE struct {
Class string `json:"class"`
// can be string whet it's a member of DEVICES and float64 when used separately
Activated interface{} `json:"activated,omitempty"`
Path string `json:"path,omitempty"`
Flags float64 `json:"flags,omitempty"`
Driver string `json:"driver,omitempty"`
Subtype string `json:"subtype,omitempty"`
Bps float64 `json:"bps,omitempty"`
Parity string `json:"parity,omitempty"`
Stopbits float64 `json:"stopbits"`
Native float64 `json:"native,omitempty"`
Cycle float64 `json:"cycle,omitempty"`
Mincycle float64 `json:"mincycle,omitempty"`
}
func (r *DEVICE) class() string {
return r.Class
}
type ERROR struct {
Class string `json:"class"`
Message string `json:"message"`
}
func (r *ERROR) class() string {
return r.Class
}
type RAW []byte
func (r RAW) class() string {
return "RAW"
}