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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
use super::lib::*;
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct CarrierPhase {
#[cfg_attr(feature = "serde", serde(rename(serialize = "i")))]
pub i: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "f")))]
pub f: u8,
}
impl WireFormat for CarrierPhase {
const MIN_LEN: usize = <i32 as WireFormat>::MIN_LEN + <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.i) + WireFormat::len(&self.f)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.i, buf);
WireFormat::write(&self.f, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
CarrierPhase {
i: WireFormat::parse_unchecked(buf),
f: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct GpsTime {
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "ns_residual")))]
pub ns_residual: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "wn")))]
pub wn: u16,
}
impl WireFormat for GpsTime {
const MIN_LEN: usize =
<u32 as WireFormat>::MIN_LEN + <i32 as WireFormat>::MIN_LEN + <u16 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow) + WireFormat::len(&self.ns_residual) + WireFormat::len(&self.wn)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.ns_residual, buf);
WireFormat::write(&self.wn, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
GpsTime {
tow: WireFormat::parse_unchecked(buf),
ns_residual: WireFormat::parse_unchecked(buf),
wn: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct GpsTimeDep {
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "wn")))]
pub wn: u16,
}
impl WireFormat for GpsTimeDep {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN + <u16 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow) + WireFormat::len(&self.wn)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.wn, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
GpsTimeDep {
tow: WireFormat::parse_unchecked(buf),
wn: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct GpsTimeSec {
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "wn")))]
pub wn: u16,
}
impl WireFormat for GpsTimeSec {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN + <u16 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow) + WireFormat::len(&self.wn)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.wn, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
GpsTimeSec {
tow: WireFormat::parse_unchecked(buf),
wn: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct GnssSignal {
#[cfg_attr(feature = "serde", serde(rename(serialize = "sat")))]
pub sat: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "code")))]
pub code: u8,
}
impl WireFormat for GnssSignal {
const MIN_LEN: usize = <u8 as WireFormat>::MIN_LEN + <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.sat) + WireFormat::len(&self.code)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.sat, buf);
WireFormat::write(&self.code, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
GnssSignal {
sat: WireFormat::parse_unchecked(buf),
code: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct GnssSignalDep {
#[cfg_attr(feature = "serde", serde(rename(serialize = "sat")))]
pub sat: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "code")))]
pub code: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "reserved")))]
pub reserved: u8,
}
impl WireFormat for GnssSignalDep {
const MIN_LEN: usize =
<u16 as WireFormat>::MIN_LEN + <u8 as WireFormat>::MIN_LEN + <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.sat) + WireFormat::len(&self.code) + WireFormat::len(&self.reserved)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.sat, buf);
WireFormat::write(&self.code, buf);
WireFormat::write(&self.reserved, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
GnssSignalDep {
sat: WireFormat::parse_unchecked(buf),
code: WireFormat::parse_unchecked(buf),
reserved: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct SvId {
#[cfg_attr(feature = "serde", serde(rename(serialize = "satId")))]
pub sat_id: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "constellation")))]
pub constellation: u8,
}
impl WireFormat for SvId {
const MIN_LEN: usize = <u8 as WireFormat>::MIN_LEN + <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.sat_id) + WireFormat::len(&self.constellation)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.sat_id, buf);
WireFormat::write(&self.constellation, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
SvId {
sat_id: WireFormat::parse_unchecked(buf),
constellation: WireFormat::parse_unchecked(buf),
}
}
}