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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
// Copyright (C) 2015-2021 Swift Navigation Inc.
// Contact: https://support.swiftnav.com
//
// This source is subject to the license found in the file 'LICENSE' which must
// be be distributed together with this source. All other rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

//****************************************************************************
// Automatically generated from yaml/swiftnav/sbp/acquisition.yaml
// with generate.py. Please do not hand edit!
//****************************************************************************/
//! Satellite acquisition messages from the device.

use super::gnss::*;

use super::lib::*;

/// Acq perfomance measurement and debug
///
/// Profile for a specific SV for debugging purposes. The message describes SV
/// profile during acquisition time. The message is used to debug and measure
/// the performance.
///
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct AcqSvProfile {
    /// SV search job type (deep, fallback, etc)
    #[cfg_attr(feature = "serde", serde(rename(serialize = "job_type")))]
    pub job_type: u8,
    /// Acquisition status 1 is Success, 0 is Failure
    #[cfg_attr(feature = "serde", serde(rename(serialize = "status")))]
    pub status: u8,
    /// CN0 value. Only valid if status is '1'
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cn0")))]
    pub cn0: u16,
    /// Acquisition integration time
    #[cfg_attr(feature = "serde", serde(rename(serialize = "int_time")))]
    pub int_time: u8,
    /// GNSS signal for which acquisition was attempted
    #[cfg_attr(feature = "serde", serde(rename(serialize = "sid")))]
    pub sid: GnssSignal,
    /// Acq frequency bin width
    #[cfg_attr(feature = "serde", serde(rename(serialize = "bin_width")))]
    pub bin_width: u16,
    /// Timestamp of the job complete event
    #[cfg_attr(feature = "serde", serde(rename(serialize = "timestamp")))]
    pub timestamp: u32,
    /// Time spent to search for sid.code
    #[cfg_attr(feature = "serde", serde(rename(serialize = "time_spent")))]
    pub time_spent: u32,
    /// Doppler range lowest frequency
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cf_min")))]
    pub cf_min: i32,
    /// Doppler range highest frequency
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cf_max")))]
    pub cf_max: i32,
    /// Doppler value of detected peak. Only valid if status is '1'
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cf")))]
    pub cf: i32,
    /// Codephase of detected peak. Only valid if status is '1'
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cp")))]
    pub cp: u32,
}

impl WireFormat for AcqSvProfile {
    const MIN_LEN: usize = <u8 as WireFormat>::MIN_LEN
        + <u8 as WireFormat>::MIN_LEN
        + <u16 as WireFormat>::MIN_LEN
        + <u8 as WireFormat>::MIN_LEN
        + <GnssSignal as WireFormat>::MIN_LEN
        + <u16 as WireFormat>::MIN_LEN
        + <u32 as WireFormat>::MIN_LEN
        + <u32 as WireFormat>::MIN_LEN
        + <i32 as WireFormat>::MIN_LEN
        + <i32 as WireFormat>::MIN_LEN
        + <i32 as WireFormat>::MIN_LEN
        + <u32 as WireFormat>::MIN_LEN;
    fn len(&self) -> usize {
        WireFormat::len(&self.job_type)
            + WireFormat::len(&self.status)
            + WireFormat::len(&self.cn0)
            + WireFormat::len(&self.int_time)
            + WireFormat::len(&self.sid)
            + WireFormat::len(&self.bin_width)
            + WireFormat::len(&self.timestamp)
            + WireFormat::len(&self.time_spent)
            + WireFormat::len(&self.cf_min)
            + WireFormat::len(&self.cf_max)
            + WireFormat::len(&self.cf)
            + WireFormat::len(&self.cp)
    }
    fn write<B: BufMut>(&self, buf: &mut B) {
        WireFormat::write(&self.job_type, buf);
        WireFormat::write(&self.status, buf);
        WireFormat::write(&self.cn0, buf);
        WireFormat::write(&self.int_time, buf);
        WireFormat::write(&self.sid, buf);
        WireFormat::write(&self.bin_width, buf);
        WireFormat::write(&self.timestamp, buf);
        WireFormat::write(&self.time_spent, buf);
        WireFormat::write(&self.cf_min, buf);
        WireFormat::write(&self.cf_max, buf);
        WireFormat::write(&self.cf, buf);
        WireFormat::write(&self.cp, buf);
    }
    fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
        AcqSvProfile {
            job_type: WireFormat::parse_unchecked(buf),
            status: WireFormat::parse_unchecked(buf),
            cn0: WireFormat::parse_unchecked(buf),
            int_time: WireFormat::parse_unchecked(buf),
            sid: WireFormat::parse_unchecked(buf),
            bin_width: WireFormat::parse_unchecked(buf),
            timestamp: WireFormat::parse_unchecked(buf),
            time_spent: WireFormat::parse_unchecked(buf),
            cf_min: WireFormat::parse_unchecked(buf),
            cf_max: WireFormat::parse_unchecked(buf),
            cf: WireFormat::parse_unchecked(buf),
            cp: WireFormat::parse_unchecked(buf),
        }
    }
}

/// Deprecated
///
/// Deprecated.
///
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct AcqSvProfileDep {
    /// SV search job type (deep, fallback, etc)
    #[cfg_attr(feature = "serde", serde(rename(serialize = "job_type")))]
    pub job_type: u8,
    /// Acquisition status 1 is Success, 0 is Failure
    #[cfg_attr(feature = "serde", serde(rename(serialize = "status")))]
    pub status: u8,
    /// CN0 value. Only valid if status is '1'
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cn0")))]
    pub cn0: u16,
    /// Acquisition integration time
    #[cfg_attr(feature = "serde", serde(rename(serialize = "int_time")))]
    pub int_time: u8,
    /// GNSS signal for which acquisition was attempted
    #[cfg_attr(feature = "serde", serde(rename(serialize = "sid")))]
    pub sid: GnssSignalDep,
    /// Acq frequency bin width
    #[cfg_attr(feature = "serde", serde(rename(serialize = "bin_width")))]
    pub bin_width: u16,
    /// Timestamp of the job complete event
    #[cfg_attr(feature = "serde", serde(rename(serialize = "timestamp")))]
    pub timestamp: u32,
    /// Time spent to search for sid.code
    #[cfg_attr(feature = "serde", serde(rename(serialize = "time_spent")))]
    pub time_spent: u32,
    /// Doppler range lowest frequency
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cf_min")))]
    pub cf_min: i32,
    /// Doppler range highest frequency
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cf_max")))]
    pub cf_max: i32,
    /// Doppler value of detected peak. Only valid if status is '1'
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cf")))]
    pub cf: i32,
    /// Codephase of detected peak. Only valid if status is '1'
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cp")))]
    pub cp: u32,
}

impl WireFormat for AcqSvProfileDep {
    const MIN_LEN: usize = <u8 as WireFormat>::MIN_LEN
        + <u8 as WireFormat>::MIN_LEN
        + <u16 as WireFormat>::MIN_LEN
        + <u8 as WireFormat>::MIN_LEN
        + <GnssSignalDep as WireFormat>::MIN_LEN
        + <u16 as WireFormat>::MIN_LEN
        + <u32 as WireFormat>::MIN_LEN
        + <u32 as WireFormat>::MIN_LEN
        + <i32 as WireFormat>::MIN_LEN
        + <i32 as WireFormat>::MIN_LEN
        + <i32 as WireFormat>::MIN_LEN
        + <u32 as WireFormat>::MIN_LEN;
    fn len(&self) -> usize {
        WireFormat::len(&self.job_type)
            + WireFormat::len(&self.status)
            + WireFormat::len(&self.cn0)
            + WireFormat::len(&self.int_time)
            + WireFormat::len(&self.sid)
            + WireFormat::len(&self.bin_width)
            + WireFormat::len(&self.timestamp)
            + WireFormat::len(&self.time_spent)
            + WireFormat::len(&self.cf_min)
            + WireFormat::len(&self.cf_max)
            + WireFormat::len(&self.cf)
            + WireFormat::len(&self.cp)
    }
    fn write<B: BufMut>(&self, buf: &mut B) {
        WireFormat::write(&self.job_type, buf);
        WireFormat::write(&self.status, buf);
        WireFormat::write(&self.cn0, buf);
        WireFormat::write(&self.int_time, buf);
        WireFormat::write(&self.sid, buf);
        WireFormat::write(&self.bin_width, buf);
        WireFormat::write(&self.timestamp, buf);
        WireFormat::write(&self.time_spent, buf);
        WireFormat::write(&self.cf_min, buf);
        WireFormat::write(&self.cf_max, buf);
        WireFormat::write(&self.cf, buf);
        WireFormat::write(&self.cp, buf);
    }
    fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
        AcqSvProfileDep {
            job_type: WireFormat::parse_unchecked(buf),
            status: WireFormat::parse_unchecked(buf),
            cn0: WireFormat::parse_unchecked(buf),
            int_time: WireFormat::parse_unchecked(buf),
            sid: WireFormat::parse_unchecked(buf),
            bin_width: WireFormat::parse_unchecked(buf),
            timestamp: WireFormat::parse_unchecked(buf),
            time_spent: WireFormat::parse_unchecked(buf),
            cf_min: WireFormat::parse_unchecked(buf),
            cf_max: WireFormat::parse_unchecked(buf),
            cf: WireFormat::parse_unchecked(buf),
            cp: WireFormat::parse_unchecked(buf),
        }
    }
}

/// Satellite acquisition result
///
/// This message describes the results from an attempted GPS signal
/// acquisition search for a satellite PRN over a code phase/carrier frequency
/// range. It contains the parameters of the point in the acquisition search
/// space with the best carrier-to-noise (CN/0) ratio.
///
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgAcqResult {
    /// The message sender_id
    #[cfg_attr(feature = "serde", serde(skip_serializing))]
    pub sender_id: Option<u16>,
    /// CN/0 of best point
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cn0")))]
    pub cn0: f32,
    /// Code phase of best point
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cp")))]
    pub cp: f32,
    /// Carrier frequency of best point
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cf")))]
    pub cf: f32,
    /// GNSS signal for which acquisition was attempted
    #[cfg_attr(feature = "serde", serde(rename(serialize = "sid")))]
    pub sid: GnssSignal,
}

impl ConcreteMessage for MsgAcqResult {
    const MESSAGE_TYPE: u16 = 47;
    const MESSAGE_NAME: &'static str = "MSG_ACQ_RESULT";
}

impl SbpMessage for MsgAcqResult {
    fn message_name(&self) -> &'static str {
        <Self as ConcreteMessage>::MESSAGE_NAME
    }
    fn message_type(&self) -> u16 {
        <Self as ConcreteMessage>::MESSAGE_TYPE
    }
    fn sender_id(&self) -> Option<u16> {
        self.sender_id
    }
    fn set_sender_id(&mut self, new_id: u16) {
        self.sender_id = Some(new_id);
    }
    fn encoded_len(&self) -> usize {
        WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
    }
}

impl TryFrom<Sbp> for MsgAcqResult {
    type Error = TryFromSbpError;
    fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
        match msg {
            Sbp::MsgAcqResult(m) => Ok(m),
            _ => Err(TryFromSbpError),
        }
    }
}

impl WireFormat for MsgAcqResult {
    const MIN_LEN: usize = <f32 as WireFormat>::MIN_LEN
        + <f32 as WireFormat>::MIN_LEN
        + <f32 as WireFormat>::MIN_LEN
        + <GnssSignal as WireFormat>::MIN_LEN;
    fn len(&self) -> usize {
        WireFormat::len(&self.cn0)
            + WireFormat::len(&self.cp)
            + WireFormat::len(&self.cf)
            + WireFormat::len(&self.sid)
    }
    fn write<B: BufMut>(&self, buf: &mut B) {
        WireFormat::write(&self.cn0, buf);
        WireFormat::write(&self.cp, buf);
        WireFormat::write(&self.cf, buf);
        WireFormat::write(&self.sid, buf);
    }
    fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
        MsgAcqResult {
            sender_id: None,
            cn0: WireFormat::parse_unchecked(buf),
            cp: WireFormat::parse_unchecked(buf),
            cf: WireFormat::parse_unchecked(buf),
            sid: WireFormat::parse_unchecked(buf),
        }
    }
}

/// Deprecated
///
/// Deprecated.
///
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgAcqResultDepA {
    /// The message sender_id
    #[cfg_attr(feature = "serde", serde(skip_serializing))]
    pub sender_id: Option<u16>,
    /// SNR of best point. Currently dimensionless, but will have units of dB Hz
    /// in the revision of this message.
    #[cfg_attr(feature = "serde", serde(rename(serialize = "snr")))]
    pub snr: f32,
    /// Code phase of best point
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cp")))]
    pub cp: f32,
    /// Carrier frequency of best point
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cf")))]
    pub cf: f32,
    /// PRN-1 identifier of the satellite signal for which acquisition was
    /// attempted
    #[cfg_attr(feature = "serde", serde(rename(serialize = "prn")))]
    pub prn: u8,
}

impl ConcreteMessage for MsgAcqResultDepA {
    const MESSAGE_TYPE: u16 = 21;
    const MESSAGE_NAME: &'static str = "MSG_ACQ_RESULT_DEP_A";
}

impl SbpMessage for MsgAcqResultDepA {
    fn message_name(&self) -> &'static str {
        <Self as ConcreteMessage>::MESSAGE_NAME
    }
    fn message_type(&self) -> u16 {
        <Self as ConcreteMessage>::MESSAGE_TYPE
    }
    fn sender_id(&self) -> Option<u16> {
        self.sender_id
    }
    fn set_sender_id(&mut self, new_id: u16) {
        self.sender_id = Some(new_id);
    }
    fn encoded_len(&self) -> usize {
        WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
    }
}

impl TryFrom<Sbp> for MsgAcqResultDepA {
    type Error = TryFromSbpError;
    fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
        match msg {
            Sbp::MsgAcqResultDepA(m) => Ok(m),
            _ => Err(TryFromSbpError),
        }
    }
}

impl WireFormat for MsgAcqResultDepA {
    const MIN_LEN: usize = <f32 as WireFormat>::MIN_LEN
        + <f32 as WireFormat>::MIN_LEN
        + <f32 as WireFormat>::MIN_LEN
        + <u8 as WireFormat>::MIN_LEN;
    fn len(&self) -> usize {
        WireFormat::len(&self.snr)
            + WireFormat::len(&self.cp)
            + WireFormat::len(&self.cf)
            + WireFormat::len(&self.prn)
    }
    fn write<B: BufMut>(&self, buf: &mut B) {
        WireFormat::write(&self.snr, buf);
        WireFormat::write(&self.cp, buf);
        WireFormat::write(&self.cf, buf);
        WireFormat::write(&self.prn, buf);
    }
    fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
        MsgAcqResultDepA {
            sender_id: None,
            snr: WireFormat::parse_unchecked(buf),
            cp: WireFormat::parse_unchecked(buf),
            cf: WireFormat::parse_unchecked(buf),
            prn: WireFormat::parse_unchecked(buf),
        }
    }
}

/// Deprecated
///
/// Deprecated.
///
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgAcqResultDepB {
    /// The message sender_id
    #[cfg_attr(feature = "serde", serde(skip_serializing))]
    pub sender_id: Option<u16>,
    /// SNR of best point. Currently in arbitrary SNR points, but will be in
    /// units of dB Hz in a later revision of this message.
    #[cfg_attr(feature = "serde", serde(rename(serialize = "snr")))]
    pub snr: f32,
    /// Code phase of best point
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cp")))]
    pub cp: f32,
    /// Carrier frequency of best point
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cf")))]
    pub cf: f32,
    /// GNSS signal for which acquisition was attempted
    #[cfg_attr(feature = "serde", serde(rename(serialize = "sid")))]
    pub sid: GnssSignalDep,
}

impl ConcreteMessage for MsgAcqResultDepB {
    const MESSAGE_TYPE: u16 = 20;
    const MESSAGE_NAME: &'static str = "MSG_ACQ_RESULT_DEP_B";
}

impl SbpMessage for MsgAcqResultDepB {
    fn message_name(&self) -> &'static str {
        <Self as ConcreteMessage>::MESSAGE_NAME
    }
    fn message_type(&self) -> u16 {
        <Self as ConcreteMessage>::MESSAGE_TYPE
    }
    fn sender_id(&self) -> Option<u16> {
        self.sender_id
    }
    fn set_sender_id(&mut self, new_id: u16) {
        self.sender_id = Some(new_id);
    }
    fn encoded_len(&self) -> usize {
        WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
    }
}

impl TryFrom<Sbp> for MsgAcqResultDepB {
    type Error = TryFromSbpError;
    fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
        match msg {
            Sbp::MsgAcqResultDepB(m) => Ok(m),
            _ => Err(TryFromSbpError),
        }
    }
}

impl WireFormat for MsgAcqResultDepB {
    const MIN_LEN: usize = <f32 as WireFormat>::MIN_LEN
        + <f32 as WireFormat>::MIN_LEN
        + <f32 as WireFormat>::MIN_LEN
        + <GnssSignalDep as WireFormat>::MIN_LEN;
    fn len(&self) -> usize {
        WireFormat::len(&self.snr)
            + WireFormat::len(&self.cp)
            + WireFormat::len(&self.cf)
            + WireFormat::len(&self.sid)
    }
    fn write<B: BufMut>(&self, buf: &mut B) {
        WireFormat::write(&self.snr, buf);
        WireFormat::write(&self.cp, buf);
        WireFormat::write(&self.cf, buf);
        WireFormat::write(&self.sid, buf);
    }
    fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
        MsgAcqResultDepB {
            sender_id: None,
            snr: WireFormat::parse_unchecked(buf),
            cp: WireFormat::parse_unchecked(buf),
            cf: WireFormat::parse_unchecked(buf),
            sid: WireFormat::parse_unchecked(buf),
        }
    }
}

/// Deprecated
///
/// Deprecated.
///
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgAcqResultDepC {
    /// The message sender_id
    #[cfg_attr(feature = "serde", serde(skip_serializing))]
    pub sender_id: Option<u16>,
    /// CN/0 of best point
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cn0")))]
    pub cn0: f32,
    /// Code phase of best point
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cp")))]
    pub cp: f32,
    /// Carrier frequency of best point
    #[cfg_attr(feature = "serde", serde(rename(serialize = "cf")))]
    pub cf: f32,
    /// GNSS signal for which acquisition was attempted
    #[cfg_attr(feature = "serde", serde(rename(serialize = "sid")))]
    pub sid: GnssSignalDep,
}

impl ConcreteMessage for MsgAcqResultDepC {
    const MESSAGE_TYPE: u16 = 31;
    const MESSAGE_NAME: &'static str = "MSG_ACQ_RESULT_DEP_C";
}

impl SbpMessage for MsgAcqResultDepC {
    fn message_name(&self) -> &'static str {
        <Self as ConcreteMessage>::MESSAGE_NAME
    }
    fn message_type(&self) -> u16 {
        <Self as ConcreteMessage>::MESSAGE_TYPE
    }
    fn sender_id(&self) -> Option<u16> {
        self.sender_id
    }
    fn set_sender_id(&mut self, new_id: u16) {
        self.sender_id = Some(new_id);
    }
    fn encoded_len(&self) -> usize {
        WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
    }
}

impl TryFrom<Sbp> for MsgAcqResultDepC {
    type Error = TryFromSbpError;
    fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
        match msg {
            Sbp::MsgAcqResultDepC(m) => Ok(m),
            _ => Err(TryFromSbpError),
        }
    }
}

impl WireFormat for MsgAcqResultDepC {
    const MIN_LEN: usize = <f32 as WireFormat>::MIN_LEN
        + <f32 as WireFormat>::MIN_LEN
        + <f32 as WireFormat>::MIN_LEN
        + <GnssSignalDep as WireFormat>::MIN_LEN;
    fn len(&self) -> usize {
        WireFormat::len(&self.cn0)
            + WireFormat::len(&self.cp)
            + WireFormat::len(&self.cf)
            + WireFormat::len(&self.sid)
    }
    fn write<B: BufMut>(&self, buf: &mut B) {
        WireFormat::write(&self.cn0, buf);
        WireFormat::write(&self.cp, buf);
        WireFormat::write(&self.cf, buf);
        WireFormat::write(&self.sid, buf);
    }
    fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
        MsgAcqResultDepC {
            sender_id: None,
            cn0: WireFormat::parse_unchecked(buf),
            cp: WireFormat::parse_unchecked(buf),
            cf: WireFormat::parse_unchecked(buf),
            sid: WireFormat::parse_unchecked(buf),
        }
    }
}

/// Acquisition perfomance measurement and debug
///
/// The message describes all SV profiles during acquisition time. The message
/// is used to debug and measure the performance.
///
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgAcqSvProfile {
    /// The message sender_id
    #[cfg_attr(feature = "serde", serde(skip_serializing))]
    pub sender_id: Option<u16>,
    /// SV profiles during acquisition time
    #[cfg_attr(feature = "serde", serde(rename(serialize = "acq_sv_profile")))]
    pub acq_sv_profile: Vec<AcqSvProfile>,
}

impl ConcreteMessage for MsgAcqSvProfile {
    const MESSAGE_TYPE: u16 = 46;
    const MESSAGE_NAME: &'static str = "MSG_ACQ_SV_PROFILE";
}

impl SbpMessage for MsgAcqSvProfile {
    fn message_name(&self) -> &'static str {
        <Self as ConcreteMessage>::MESSAGE_NAME
    }
    fn message_type(&self) -> u16 {
        <Self as ConcreteMessage>::MESSAGE_TYPE
    }
    fn sender_id(&self) -> Option<u16> {
        self.sender_id
    }
    fn set_sender_id(&mut self, new_id: u16) {
        self.sender_id = Some(new_id);
    }
    fn encoded_len(&self) -> usize {
        WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
    }
}

impl TryFrom<Sbp> for MsgAcqSvProfile {
    type Error = TryFromSbpError;
    fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
        match msg {
            Sbp::MsgAcqSvProfile(m) => Ok(m),
            _ => Err(TryFromSbpError),
        }
    }
}

impl WireFormat for MsgAcqSvProfile {
    const MIN_LEN: usize = <Vec<AcqSvProfile> as WireFormat>::MIN_LEN;
    fn len(&self) -> usize {
        WireFormat::len(&self.acq_sv_profile)
    }
    fn write<B: BufMut>(&self, buf: &mut B) {
        WireFormat::write(&self.acq_sv_profile, buf);
    }
    fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
        MsgAcqSvProfile {
            sender_id: None,
            acq_sv_profile: WireFormat::parse_unchecked(buf),
        }
    }
}

/// Deprecated
///
/// Deprecated.
///
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgAcqSvProfileDep {
    /// The message sender_id
    #[cfg_attr(feature = "serde", serde(skip_serializing))]
    pub sender_id: Option<u16>,
    /// SV profiles during acquisition time
    #[cfg_attr(feature = "serde", serde(rename(serialize = "acq_sv_profile")))]
    pub acq_sv_profile: Vec<AcqSvProfileDep>,
}

impl ConcreteMessage for MsgAcqSvProfileDep {
    const MESSAGE_TYPE: u16 = 30;
    const MESSAGE_NAME: &'static str = "MSG_ACQ_SV_PROFILE_DEP";
}

impl SbpMessage for MsgAcqSvProfileDep {
    fn message_name(&self) -> &'static str {
        <Self as ConcreteMessage>::MESSAGE_NAME
    }
    fn message_type(&self) -> u16 {
        <Self as ConcreteMessage>::MESSAGE_TYPE
    }
    fn sender_id(&self) -> Option<u16> {
        self.sender_id
    }
    fn set_sender_id(&mut self, new_id: u16) {
        self.sender_id = Some(new_id);
    }
    fn encoded_len(&self) -> usize {
        WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
    }
}

impl TryFrom<Sbp> for MsgAcqSvProfileDep {
    type Error = TryFromSbpError;
    fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
        match msg {
            Sbp::MsgAcqSvProfileDep(m) => Ok(m),
            _ => Err(TryFromSbpError),
        }
    }
}

impl WireFormat for MsgAcqSvProfileDep {
    const MIN_LEN: usize = <Vec<AcqSvProfileDep> as WireFormat>::MIN_LEN;
    fn len(&self) -> usize {
        WireFormat::len(&self.acq_sv_profile)
    }
    fn write<B: BufMut>(&self, buf: &mut B) {
        WireFormat::write(&self.acq_sv_profile, buf);
    }
    fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
        MsgAcqSvProfileDep {
            sender_id: None,
            acq_sv_profile: WireFormat::parse_unchecked(buf),
        }
    }
}