# 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 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.

package: swiftnav.sbp.acquisition
description: Satellite acquisition messages from the device.
stable: False
public: True
include:
  - types.yaml
  - gnss.yaml
definitions:

 - MSG_ACQ_RESULT:
    id: 0x002F
    short_desc: Satellite acquisition result
    desc: >
      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.
    fields:
        - cn0:
            type: float
            units: dB Hz
            desc: CN/0 of best point
        - cp:
            type: float
            units: chips
            desc: Code phase of best point
        - cf:
            type: float
            units: hz
            desc: Carrier frequency of best point
        - sid:
            type: GnssSignal
            desc: GNSS signal for which acquisition was attempted

 - MSG_ACQ_RESULT_DEP_C:
    id: 0x001F
    short_desc: Deprecated
    desc: Deprecated.
    public: false
    replaced_by:
      - MSG_ACQ_RESULT
    fields:
        - cn0:
            type: float
            units: dB Hz
            desc: CN/0 of best point
        - cp:
            type: float
            units: chips
            desc: Code phase of best point
        - cf:
            type: float
            units: hz
            desc: Carrier frequency of best point
        - sid:
            type: GnssSignalDep
            desc: GNSS signal for which acquisition was attempted

 - MSG_ACQ_RESULT_DEP_B:
    id: 0x0014
    short_desc: Deprecated
    desc: Deprecated.
    public: false
    replaced_by:
      - MSG_ACQ_RESULT
    fields:
        - snr:
            type: float
            desc: >
              SNR of best point. Currently in arbitrary SNR points, but will
              be in units of dB Hz in a later revision of this message.
        - cp:
            type: float
            units: chips
            desc: Code phase of best point
        - cf:
            type: float
            units: hz
            desc: Carrier frequency of best point
        - sid:
            type: GnssSignalDep
            desc: GNSS signal for which acquisition was attempted

 - MSG_ACQ_RESULT_DEP_A:
    id: 0x0015
    short_desc: Deprecated
    desc: Deprecated.
    public: false
    replaced_by:
      - MSG_ACQ_RESULT
    fields:
        - snr:
            type: float
            desc: >
              SNR of best point. Currently dimensionless, but will have
              units of dB Hz in the revision of this message.
        - cp:
            type: float
            units: chips
            desc: Code phase of best point
        - cf:
            type: float
            units: hz
            desc: Carrier frequency of best point
        - prn:
            type: u8
            desc: >
              PRN-1 identifier of the satellite signal for which
              acquisition was attempted

 - AcqSvProfile:
    short_desc: Acq perfomance measurement and debug
    desc: >
      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.
    fields:
        - job_type:
            type: u8
            desc: SV search job type (deep, fallback, etc)
        - status:
            type: u8
            desc: Acquisition status 1 is Success, 0 is Failure
        - cn0:
            type: u16
            desc: CN0 value. Only valid if status is '1'
            units: dB-Hz*10
        - int_time:
            type: u8
            units: ms
            desc: Acquisition integration time
        - sid:
            type: GnssSignal
            desc: GNSS signal for which acquisition was attempted
        - bin_width:
            type: u16
            units: Hz
            desc: Acq frequency bin width
        - timestamp:
            type: u32
            units: ms
            desc: Timestamp of the job complete event
        - time_spent:
            type: u32
            units: us
            desc: Time spent to search for sid.code
        - cf_min:
            type: s32
            units: Hz
            desc: Doppler range lowest frequency
        - cf_max:
            type: s32
            units: Hz
            desc: Doppler range highest frequency
        - cf:
            type: s32
            units: Hz
            desc: Doppler value of detected peak. Only valid if status is '1'
        - cp:
            type: u32
            units: chips*10
            desc: Codephase of detected peak. Only valid if status is '1'

 - AcqSvProfileDep:
    short_desc: Deprecated
    desc: Deprecated.
    fields:
        - job_type:
            type: u8
            desc: SV search job type (deep, fallback, etc)
        - status:
            type: u8
            desc: Acquisition status 1 is Success, 0 is Failure
        - cn0:
            type: u16
            desc: CN0 value. Only valid if status is '1'
            units: dB-Hz*10
        - int_time:
            type: u8
            units: ms
            desc: Acquisition integration time
        - sid:
            type: GnssSignalDep
            desc: GNSS signal for which acquisition was attempted
        - bin_width:
            type: u16
            units: Hz
            desc: Acq frequency bin width
        - timestamp:
            type: u32
            units: ms
            desc: Timestamp of the job complete event
        - time_spent:
            type: u32
            units: us
            desc: Time spent to search for sid.code
        - cf_min:
            type: s32
            units: Hz
            desc: Doppler range lowest frequency
        - cf_max:
            type: s32
            units: Hz
            desc: Doppler range highest frequency
        - cf:
            type: s32
            units: Hz
            desc: Doppler value of detected peak. Only valid if status is '1'
        - cp:
            type: u32
            units: chips*10
            desc: Codephase of detected peak. Only valid if status is '1'

 - MSG_ACQ_SV_PROFILE:
    id: 0x002E
    short_desc: Acquisition perfomance measurement and debug
    desc: >
      The message describes all SV profiles during acquisition time.
      The message is used to debug and measure the performance.
    fields:
        - acq_sv_profile:
            type: array
            fill: AcqSvProfile
            desc: SV profiles during acquisition time

 - MSG_ACQ_SV_PROFILE_DEP:
    id: 0x001E
    short_desc: Deprecated
    desc: Deprecated.
    public: false
    replaced_by:
      - MSG_ACQ_SV_PROFILE
    fields:
        - acq_sv_profile:
            type: array
            fill: AcqSvProfileDep
            desc: SV profiles during acquisition time
