# Copyright (C) 2018-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.ssr
description: Precise State Space Representation (SSR) corrections format
stable: False
public: True
include:
  - types.yaml
  - gnss.yaml
definitions:
 - CodeBiasesContent:
     short_desc: SSR code biases corrections for a particular satellite
     desc: >
      Code biases are to be added to pseudorange.
      The corrections conform with RTCMv3 MT 1059 / 1065.
     fields:
     - code:
            type: u8
            desc: >
                Signal encoded following RTCM specifications
                (DF380, DF381, DF382 and DF467).
     - value:
            type: s16
            units: 0.01 m
            desc: Code bias value

 - PhaseBiasesContent:
     short_desc: SSR phase biases corrections for a particular satellite
     desc: >
      Phase biases are to be added to carrier phase measurements.
     fields:
     - code:
            type: u8
            desc: >
                Signal encoded following RTCM specifications
                (DF380, DF381, DF382 and DF467)
     - integer_indicator:
            type: u8
            desc: Indicator for integer property
     - widelane_integer_indicator:
            type: u8
            desc: Indicator for two groups of Wide-Lane(s) integer property
     - discontinuity_counter:
            type: u8
            desc: >
              Signal phase discontinuity counter.
              Increased for every discontinuity in phase.
     - bias:
            type: s32
            units: 0.1 mm
            desc: Phase bias for specified signal

 - STECHeader:
    short_desc: Header for the MSG_SSR_STEC_CORRECTION message
    desc: >
      A full set of STEC information will likely span multiple SBP
      messages, since SBP message a limited to 255 bytes.  The header
      is used to tie multiple SBP messages into a sequence.
    fields:
    - tile_set_id:
        type: u16
        desc: Unique identifier of the tile set this tile belongs to.
    - tile_id:
        type: u16
        desc: Unique identifier of this tile in the tile set.
    - time:
        type: GPSTimeSec
        desc: GNSS reference time of the correction
    - num_msgs:
        type: u8
        desc: Number of messages in the dataset
    - seq_num:
        type: u8
        desc: Position of this message in the dataset
    - update_interval:
        type: u8
        desc: >
            Update interval between consecutive corrections. Encoded
            following RTCM DF391 specification.
    - iod_atmo:
        type: u8
        desc: >
            IOD of the SSR atmospheric correction

 - GriddedCorrectionHeader:
    short_desc: Header for the MSG_SSR_GRIDDED_CORRECTION message
    desc: >
      The LPP message contains nested variable length arrays
      which are not supported in SBP, so each grid point will
      be identified by the index.
    fields:
    - tile_set_id:
        type: u16
        desc: Unique identifier of the tile set this tile belongs to.
    - tile_id:
        type: u16
        desc: Unique identifier of this tile in the tile set.
    - time:
        type: GPSTimeSec
        desc: GNSS reference time of the correction
    - num_msgs:
        type: u16
        desc: Number of messages in the dataset
    - seq_num:
        type: u16
        desc: Position of this message in the dataset
    - update_interval:
        type: u8
        desc: >
            Update interval between consecutive corrections. Encoded
            following RTCM DF391 specification.
    - iod_atmo:
        type: u8
        desc: >
            IOD of the SSR atmospheric correction
    - tropo_quality_indicator:
        type: u8
        desc: >
          Quality of the troposphere data. Encoded following RTCM DF389
          specification in units of m.

 - STECSatElement:
    desc: STEC polynomial for the given satellite.
    fields:
    - sv_id:
        type: SvId
        desc: Unique space vehicle identifier
    - stec_quality_indicator:
        type: u8
        desc: >
          Quality of the STEC data. Encoded following RTCM DF389 specification
          but in units of TECU instead of m.
    - stec_coeff:
        type: array
        size: 4
        fill: s16
        desc: >
          Coefficients of the STEC polynomial in the order of C00, C01, C10, C11.
          C00 = 0.05 TECU,
          C01/C10 = 0.02 TECU/deg,
          C11 0.02 TECU/deg^2

 - TroposphericDelayCorrectionNoStd:
    desc: >
      Troposphere vertical delays at the grid point.
    fields:
    - hydro:
        type: s16
        units: 4 mm (add 2.3 m to get actual vertical hydro delay)
        desc: Hydrostatic vertical delay
    - wet:
        type: s8
        units: 4 mm (add 0.252 m to get actual vertical wet delay)
        desc: Wet vertical delay

 - TroposphericDelayCorrection:
    desc: >
      Troposphere vertical delays (mean and standard deviation) at the grid
      point.
    fields:
    - hydro:
        type: s16
        units: 4 mm
        desc: >
          Hydrostatic vertical delay.
          Add 2.3 m to get actual value.
    - wet:
        type: s8
        units: 4 mm
        desc: >
          Wet vertical delay.
          Add 0.252 m to get actual value.
    - stddev:
        type: u8
        units: mm
        desc: >
          Standard deviation encoded using a similar method as RTCM DF389.
          The upper 3 bit are the class, the lower 5 bits are the value.
          Standard deviation [mm] = (3^class * (1 + value/16) - 1)

 - STECResidualNoStd:
    desc: STEC residual for the given satellite at the grid point.
    fields:
    - sv_id:
        type: SvId
        desc: space vehicle identifier
    - residual:
        type: s16
        units: 0.04 TECU
        desc: STEC residual

 - STECResidual:
    desc: >
      STEC residual (mean and standard deviation) for the given satellite
      at the grid point.
    fields:
    - sv_id:
        type: SvId
        desc: space vehicle identifier
    - residual:
        type: s16
        units: 0.04 TECU
        desc: STEC residual
    - stddev:
        type: u8
        units: TECU
        desc: >
          Standard deviation encoded using a similar method as RTCM DF389.
          The upper 3 bit are the class, the lower 5 bits are the value.
          Standard deviation [TECU] = (3^class * (1 + value/16) - 1) * 0.1

 - MSG_SSR_ORBIT_CLOCK:
    id: 0x05DD
    short_desc: Precise orbit and clock correction
    desc: >
      The precise orbit and clock correction message is
      to be applied as a delta correction to broadcast
      ephemeris and is an equivalent to the 1060 /1066
      RTCM message types.
    fields:
        - time:
            type: GPSTimeSec
            desc: GNSS reference time of the correction
        - sid:
            type: GnssSignal
            desc: GNSS signal identifier (16 bit)
        - update_interval:
            type: u8
            desc: >
                Update interval between consecutive corrections. Encoded
                following RTCM DF391 specification.
        - iod_ssr:
            type: u8
            desc: >
                IOD of the SSR correction. A change of Issue Of Data
                SSR is used to indicate a change in the SSR
                generating configuration
        - iod:
            type: u32
            desc: Issue of broadcast ephemeris data or IODCRC (Beidou)
        - radial:
            type: s32
            units: 0.1 mm
            desc: Orbit radial delta correction
        - along:
            type: s32
            units: 0.4 mm
            desc: Orbit along delta correction
        - cross:
            type: s32
            units: 0.4 mm
            desc: Orbit along delta correction
        - dot_radial:
            type: s32
            units: 0.001 mm/s
            desc: Velocity of orbit radial delta correction
        - dot_along:
            type: s32
            units: 0.004 mm/s
            desc: Velocity of orbit along delta correction
        - dot_cross:
            type: s32
            units: 0.004 mm/s
            desc: Velocity of orbit cross delta correction
        - c0:
            type: s32
            units: 0.1 mm
            desc: C0 polynomial coefficient for correction of broadcast satellite clock
        - c1:
            type: s32
            units: 0.001 mm/s
            desc: C1 polynomial coefficient for correction of broadcast satellite clock
        - c2:
            type: s32
            units: 0.00002 mm/s^-2
            desc: C2 polynomial coefficient for correction of broadcast satellite clock

 - MSG_SSR_CODE_BIASES:
    id: 0x05E1
    short_desc: Precise code biases correction
    desc: >
      The precise code biases message is to be added
      to the pseudorange of the corresponding signal
      to get corrected pseudorange. It is an
      equivalent to the 1059 / 1065 RTCM message types.
    fields:
        - time:
            type: GPSTimeSec
            desc: GNSS reference time of the correction
        - sid:
            type: GnssSignal
            desc: GNSS signal identifier (16 bit)
        - update_interval:
            type: u8
            desc: >
                Update interval between consecutive corrections. Encoded
                following RTCM DF391 specification.
        - iod_ssr:
            type: u8
            desc: >
                IOD of the SSR correction. A change of Issue Of Data
                SSR is used to indicate a change in the SSR
                generating configuration
        - biases:
            type: array
            fill: CodeBiasesContent
            map_by: code
            desc: Code biases for the different satellite signals

 - MSG_SSR_PHASE_BIASES:
    id: 0x05E6
    short_desc: Precise phase biases correction
    desc: >
      The precise phase biases message contains the biases
      to be added to the carrier phase of the corresponding
      signal to get corrected carrier phase measurement, as
      well as the satellite yaw angle to be applied to compute
      the phase wind-up correction.
      It is typically an equivalent to the 1265 RTCM message types.
    fields:
        - time:
            type: GPSTimeSec
            desc: GNSS reference time of the correction
        - sid:
            type: GnssSignal
            desc: GNSS signal identifier (16 bit)
        - update_interval:
            type: u8
            desc: >
                Update interval between consecutive corrections. Encoded
                following RTCM DF391 specification.
        - iod_ssr:
            type: u8
            desc: >
                IOD of the SSR correction. A change of Issue Of Data
                SSR is used to indicate a change in the SSR
                generating configuration
        - dispersive_bias:
            type: u8
            desc: >
                Indicator for the dispersive phase biases property.
        - mw_consistency:
            type: u8
            desc: >
                Consistency indicator for Melbourne-Wubbena linear combinations
        - yaw:
            type: u16
            units: 1 / 256 semi-circle
            desc: Satellite yaw angle
        - yaw_rate:
            type: s8
            units: 1 / 8192 semi-circle / s
            desc: Satellite yaw angle rate
        - biases:
            type: array
            fill: PhaseBiasesContent
            map_by: code
            desc: >
              Phase biases corrections for a
              satellite being tracked.

 - MSG_SSR_STEC_CORRECTION_DEP:
    id: 0x05FB
    short_desc: Deprecated
    desc: Deprecated.
    public: false
    replaced_by:
      - MSG_SSR_STEC_CORRECTION
    fields:
        - header:
            type: STECHeader
            desc: Header of a STEC polynomial coefficient message.
        - stec_sat_list:
            type: array
            fill: STECSatElement
            desc: Array of STEC polynomial coefficients for each space vehicle.

 - BoundsHeader:
     short_desc: Header for the Bounds messages
     fields:
       - time:
           type: GPSTimeSec
           desc: GNSS reference time of the bound
       - num_msgs:
           type: u8
           desc: Number of messages in the dataset
       - seq_num:
           type: u8
           desc: Position of this message in the dataset
       - update_interval:
           type: u8
           desc: >
             Update interval between consecutive bounds. Similar to
             RTCM DF391.
       - sol_id:
           type: u8
           desc: SSR Solution ID.

 - MSG_SSR_STEC_CORRECTION:
     id: 0x05FD
     short_desc: STEC correction polynomial coefficients
     fields:
       - header:
           type: BoundsHeader
           desc: Header of a STEC correction with bounds message.
       - ssr_iod_atmo:
           type: u8
           desc: IOD of the SSR atmospheric correction
       - tile_set_id:
           type: u16
           desc: Tile set ID
       - tile_id:
           type: u16
           desc: Tile ID
       - n_sats:
           type: u8
           desc: Number of satellites.
       - stec_sat_list:
           type: array
           fill: STECSatElement
           size_fn: n_sats
           desc: Array of STEC polynomial coefficients for each space vehicle.

 - MSG_SSR_GRIDDED_CORRECTION:
    id: 0x05FC
    short_desc: Gridded troposphere and STEC correction residuals
    desc: >
      STEC residuals are per space vehicle, troposphere is not.


      It is typically equivalent to the QZSS CLAS Sub Type 9 messages.
    fields:
        - header:
            type: GriddedCorrectionHeader
            desc: Header of a gridded correction message
        - index:
            type: u16
            desc: Index of the grid point.
        - tropo_delay_correction:
            type: TroposphericDelayCorrection
            desc: Wet and hydrostatic vertical delays (mean, stddev).
        - stec_residuals:
            type: array
            fill: STECResidual
            desc: STEC residuals for each satellite (mean, stddev).

 - STECSatElementIntegrity:
     desc: STEC polynomial and bounds for the given satellite.
     fields:
       - stec_residual:
           type: STECResidual
           desc: STEC residuals (mean, stddev)
       - stec_bound_mu:
           type: u8
           units: m
           desc: >
             Error Bound Mean.
             See Note 1.
       - stec_bound_sig:
           type: u8
           units: m
           desc: >
             Error Bound StDev.
             See Note 1.
       - stec_bound_mu_dot:
           type: u8
           units: 0.00005 m/s
           desc: Error Bound Mean First derivative.
       - stec_bound_sig_dot:
           type: u8
           units: 0.00005 m/s
           desc: Error Bound StDev First derivative.

 - MSG_SSR_GRIDDED_CORRECTION_BOUNDS:
     id: 0x05FE
     short_desc: Gridded troposhere and STEC correction residuals bounds
     desc: >
       Note 1: Range: 0-17.5 m.
       i<= 200, mean = 0.01i;
       200<i<=230, mean=2+0.1(i-200);
       i>230, mean=5+0.5(i-230).
     fields:
       - header:
           type: BoundsHeader
           desc: Header of a bounds message.
       - ssr_iod_atmo:
           type: u8
           desc: IOD of the correction.
       - tile_set_id:
           type: u16
           desc: Set this tile belongs to.
       - tile_id:
           type: u16
           desc: Unique identifier of this tile in the tile set.
       - tropo_qi:
           type: u8
           desc: Tropo Quality Indicator. Similar to RTCM DF389.
       - grid_point_id:
           type: u16
           desc: Index of the Grid Point.
       - tropo_delay_correction:
           type: TroposphericDelayCorrection
           desc: Tropospheric delay at grid point.
       - tropo_v_hydro_bound_mu:
           type: u8
           units: 0.005 m
           desc: Vertical Hydrostatic Error Bound Mean.
       - tropo_v_hydro_bound_sig:
           type: u8
           units: 0.005 m
           desc: Vertical Hydrostatic Error Bound StDev.
       - tropo_v_wet_bound_mu:
           type: u8
           units: 0.005 m
           desc: Vertical Wet Error Bound Mean.
       - tropo_v_wet_bound_sig:
           type: u8
           units: 0.005 m
           desc: Vertical Wet Error Bound StDev.
       - n_sats:
           type: u8
           desc: Number of satellites.
       - stec_sat_list:
           type: array
           fill: STECSatElementIntegrity
           size_fn: n_sats
           desc: Array of STEC polynomial coefficients and its bounds for each space vehicle.

 - MSG_SSR_TILE_DEFINITION_DEP_A:
    id: 0x05F6
    short_desc: Deprecated
    desc: Deprecated.
    public: false
    replaced_by:
      - MSG_SSR_TILE_DEFINITION
    fields:
        - tile_set_id:
            type: u16
            desc: Unique identifier of the tile set this tile belongs to.
        - tile_id:
            type: u16
            desc: >
              Unique identifier of this tile in the tile set.

              See GNSS-SSR-ArrayOfCorrectionPoints field correctionPointSetID.
        - corner_nw_lat:
            type: s16
            units: encoded degrees
            desc: >
              North-West corner correction point latitude.


              The relation between the latitude X in the range [-90, 90] and
              the coded number N is:


              N = floor((X / 90) * 2^14)


              See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLatitude.
        - corner_nw_lon:
            type: s16
            units: encoded degrees
            desc: >
              North-West corner correction point longitude.


              The relation between the longitude X in the range [-180, 180]
              and the coded number N is:


              N = floor((X / 180) * 2^15)


              See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLongitude.
        - spacing_lat:
            type: u16
            units: 0.01 degrees
            desc: >
              Spacing of the correction points in the latitude direction.


              See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLatitude.
        - spacing_lon:
            type: u16
            units: 0.01 degrees
            desc: >
              Spacing of the correction points in the longitude direction.


              See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLongitude.
        - rows:
            type: u16
            desc: >
              Number of steps in the latitude direction.


              See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLatitude.
        - cols:
            type: u16
            desc: >
              Number of steps in the longitude direction.


              See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLongitude.
        - bitmask:
            type: u64
            desc: >
              Specifies the availability of correction data at the
              correction points in the array.


              If a specific bit is enabled (set to 1), the correction is not
              available. Only the first rows * cols bits are used, the remainder
              are set to 0. If there are more then 64 correction points the
              remaining corrections are always available.


              Starting with the northwest corner of the array (top left on a
              north oriented map) the correction points are enumerated with row
              precedence - first row west to east, second row west to east,
              until last row west to east - ending with the southeast corner of
              the array.


              See GNSS-SSR-ArrayOfCorrectionPoints field bitmaskOfGrids but
              note the definition of the bits is inverted.

 - MSG_SSR_TILE_DEFINITION_DEP_B:
     id: 0x05F7
     short_desc: Deprecated
     desc: Deprecated.
     public: false
     replaced_by:
       - MSG_SSR_TILE_DEFINITION
     fields:
       - ssr_sol_id:
           type: u8
           desc: SSR Solution ID.
       - tile_set_id:
           type: u16
           desc: Unique identifier of the tile set this tile belongs to.
       - tile_id:
           type: u16
           desc: >
             Unique identifier of this tile in the tile set.

             See GNSS-SSR-ArrayOfCorrectionPoints field correctionPointSetID.
       - corner_nw_lat:
           type: s16
           units: encoded degrees
           desc: >
             North-West corner correction point latitude.


             The relation between the latitude X in the range [-90, 90] and
             the coded number N is:


             N = floor((X / 90) * 2^14)


             See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLatitude.
       - corner_nw_lon:
           type: s16
           units: encoded degrees
           desc: >
             North-West corner correction point longitude.


             The relation between the longitude X in the range [-180, 180]
             and the coded number N is:


             N = floor((X / 180) * 2^15)


             See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLongitude.
       - spacing_lat:
           type: u16
           units: 0.01 degrees
           desc: >
             Spacing of the correction points in the latitude direction.


             See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLatitude.
       - spacing_lon:
           type: u16
           units: 0.01 degrees
           desc: >
             Spacing of the correction points in the longitude direction.


             See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLongitude.
       - rows:
           type: u16
           desc: >
             Number of steps in the latitude direction.


             See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLatitude.
       - cols:
           type: u16
           desc: >
             Number of steps in the longitude direction.


             See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLongitude.
       - bitmask:
           type: u64
           desc: >
             Specifies the availability of correction data at the
             correction points in the array.


             If a specific bit is enabled (set to 1), the correction is not
             available. Only the first rows * cols bits are used, the remainder
             are set to 0. If there are more then 64 correction points the
             remaining corrections are always available.


             Starting with the northwest corner of the array (top left on a
             north oriented map) the correction points are enumerated with row
             precedence - first row west to east, second row west to east,
             until last row west to east - ending with the southeast corner of
             the array.


             See GNSS-SSR-ArrayOfCorrectionPoints field bitmaskOfGrids but
             note the definition of the bits is inverted.

 - MSG_SSR_TILE_DEFINITION:
     id: 0x05F8
     short_desc: >
       Definition of a SSR atmospheric correction tile.
     desc: >
       Provides the correction point coordinates for the atmospheric correction
       values in the MSG_SSR_STEC_CORRECTION and MSG_SSR_GRIDDED_CORRECTION
       messages.


       Based on ETSI TS 137 355 V16.1.0 (LTE Positioning Protocol) information
       element GNSS-SSR-CorrectionPoints. SBP only supports gridded arrays of
       correction points, not lists of points.
     fields:
       - time:
           type: GPSTimeSec
           desc: GNSS reference time of the correction
       - update_interval:
           type: u8
           desc: >
             Update interval between consecutive corrections. Encoded
             following RTCM DF391 specification.
       - sol_id:
           type: u8
           desc: SSR Solution ID. Similar to RTCM DF415.
       - iod_atmo:
           type: u8
           desc: >
             IOD of the SSR atmospheric correction.
       - tile_set_id:
           type: u16
           desc: Unique identifier of the tile set this tile belongs to.
       - tile_id:
           type: u16
           desc: >
             Unique identifier of this tile in the tile set.

             See GNSS-SSR-ArrayOfCorrectionPoints field correctionPointSetID.
       - corner_nw_lat:
           type: s16
           units: encoded degrees
           desc: >
             North-West corner correction point latitude.


             The relation between the latitude X in the range [-90, 90] and
             the coded number N is:  N = floor((X / 90) * 2^14)


             See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLatitude.
       - corner_nw_lon:
           type: s16
           units: encoded degrees
           desc: >
             North-West corner correction point longitude.


             The relation between the longitude X in the range [-180, 180]
             and the coded number N is: N = floor((X / 180) * 2^15)


             See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLongitude.
       - spacing_lat:
           type: u16
           units: 0.01 degrees
           desc: >
             Spacing of the correction points in the latitude direction.


             See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLatitude.
       - spacing_lon:
           type: u16
           units: 0.01 degrees
           desc: >
             Spacing of the correction points in the longitude direction.


             See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLongitude.
       - rows:
           type: u16
           desc: >
             Number of steps in the latitude direction.


             See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLatitude.
       - cols:
           type: u16
           desc: >
             Number of steps in the longitude direction.


             See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLongitude.
       - bitmask:
           type: u64
           desc: >
             Specifies the absence of correction data at
             the correction points in the array (grid).


             Only the first rows * cols bits are used,
             and if a specific bit is enabled (set to 1),
             the correction is not available. If there
             are more than 64 correction points the
             remaining corrections are always available.


             The correction points are packed by rows,
             starting with the northwest corner of the
             array (top-left on a north oriented map),
             with each row spanning west to east, ending
             with the southeast corner of the array.


             See GNSS-SSR-ArrayOfCorrectionPoints
             field bitmaskOfGrids but note the definition
             of the bits is inverted.

 - SatelliteAPC:
     short_desc: Antenna phase center correction
     desc: >
       Contains phase center offset and elevation variation corrections for one
       signal on a satellite.
     fields:
       - sid:
           type: GnssSignal
           desc: GNSS signal identifier (16 bit)
       - sat_info:
           type: u8
           desc: Additional satellite information
           fields:
             - 5-7:
                 desc: Reserved
             - 0-4:
                 desc: Satellite Type
                 values:
                   - 0: Unknown Type
                   - 1: GPS I
                   - 2: GPS II
                   - 3: GPS IIA
                   - 4: GPS IIR
                   - 5: GPS IIF
                   - 6: GPS III
                   - 7: GLONASS
                   - 8: GLONASS M
                   - 9: GLONASS K1
                   - 10: GALILEO
                   - 11: BEIDOU 2G
                   - 12: BEIDOU 2I
                   - 13: BEIDOU 2M
                   - 14: BEIDOU 3M, SECM
                   - 15: BEIDOU 3G, SECM
                   - 16: BEIDOU 3M, CAST
                   - 17: BEIDOU 3G, CAST
                   - 18: BEIDOU 3I, CAST
                   - 19: QZSS
                   - 20: BEIDOU 3I
                   - 21: BEIDOU 3SM, CAST
                   - 22: BEIDOU 3SI, CAST
                   - 23: BEIDOU 3SM, SECM
                   - 24: BEIDOU 3SI, SECM
       - svn:
           type: u16
           desc: Satellite Code, as defined by IGS. Typically the space vehicle number.
       - pco:
           type: array
           size: 3
           fill: s16
           units: 1 mm
           desc: >
             Mean phase center offset, X Y and Z axes. See IGS ANTEX file
             format description for coordinate system definition.
       - pcv:
           type: array
           size: 21
           fill: s8
           units: 1 mm
           desc: >
             Elevation dependent phase center variations. First element is 0
             degrees separation from the Z axis, subsequent elements represent
             elevation variations in 1 degree increments.

 - MSG_SSR_SATELLITE_APC_DEP:
     id: 0x0604
     short_desc: Deprecated
     desc: Deprecated.
     public: false
     replaced_by:
       - MSG_SSR_SATELLITE_APC
     fields:
       - apc:
           type: array
           fill: SatelliteAPC
           desc: Satellite antenna phase center corrections

 - MSG_SSR_SATELLITE_APC:
     id: 0x0605
     short_desc: Satellite antenna phase center corrections
     fields:
       - time:
           type: GPSTimeSec
           desc: GNSS reference time of the correction
       - update_interval:
           type: u8
           desc: >
             Update interval between consecutive corrections. Encoded
             following RTCM DF391 specification.
       - sol_id:
           type: u8
           desc: SSR Solution ID. Similar to RTCM DF415.
       - iod_ssr:
           type: u8
           desc: >
             IOD of the SSR correction. A change of Issue Of Data
             SSR is used to indicate a change in the SSR
             generating configuration
       - apc:
           type: array
           fill: SatelliteAPC
           desc: Satellite antenna phase center corrections

 - MSG_SSR_ORBIT_CLOCK_DEP_A:
    id: 0x05DC
    short_desc: Deprecated
    desc: Deprecated.
    public: false
    replaced_by:
      - MSG_SSR_ORBIT_CLOCK
    fields:
        - time:
            type: GPSTimeSec
            desc: GNSS reference time of the correction
        - sid:
            type: GnssSignal
            desc: GNSS signal identifier (16 bit)
        - update_interval:
            type: u8
            desc: >
                Update interval between consecutive corrections. Encoded
                following RTCM DF391 specification.
        - iod_ssr:
            type: u8
            desc: >
                IOD of the SSR correction. A change of Issue Of Data
                SSR is used to indicate a change in the SSR
                generating configuration
        - iod:
            type: u8
            desc: Issue of broadcast ephemeris data
        - radial:
            type: s32
            units: 0.1 mm
            desc: Orbit radial delta correction
        - along:
            type: s32
            units: 0.4 mm
            desc: Orbit along delta correction
        - cross:
            type: s32
            units: 0.4 mm
            desc: Orbit along delta correction
        - dot_radial:
            type: s32
            units: 0.001 mm/s
            desc: Velocity of orbit radial delta correction
        - dot_along:
            type: s32
            units: 0.004 mm/s
            desc: Velocity of orbit along delta correction
        - dot_cross:
            type: s32
            units: 0.004 mm/s
            desc: Velocity of orbit cross delta correction
        - c0:
            type: s32
            units: 0.1 mm
            desc: C0 polynomial coefficient for correction of broadcast satellite clock
        - c1:
            type: s32
            units: 0.001 mm/s
            desc: C1 polynomial coefficient for correction of broadcast satellite clock
        - c2:
            type: s32
            units: 0.00002 mm/s^-2
            desc: C2 polynomial coefficient for correction of broadcast satellite clock

 - STECHeaderDepA:
    short_desc: Header for MSG_SSR_STEC_CORRECTION_DEP message
    desc: >
      A full set of STEC information will likely span multiple SBP
      messages, since SBP message a limited to 255 bytes.  The header
      is used to tie multiple SBP messages into a sequence.
    fields:
    - time:
        type: GPSTimeSec
        desc: GNSS reference time of the correction
    - num_msgs:
        type: u8
        desc: Number of messages in the dataset
    - seq_num:
        type: u8
        desc: Position of this message in the dataset
    - update_interval:
        type: u8
        desc: >
            Update interval between consecutive corrections. Encoded
            following RTCM DF391 specification.
    - iod_atmo:
        type: u8
        desc: >
            IOD of the SSR atmospheric correction

 - GriddedCorrectionHeaderDepA:
    short_desc: Header for MSG_SSR_GRIDDED_CORRECTION_DEP
    desc: >
      The 3GPP message contains nested variable length arrays
      which are not supported in SBP, so each grid point will
      be identified by the index.
    fields:
    - time:
        type: GPSTimeSec
        desc: GNSS reference time of the correction
    - num_msgs:
        type: u16
        desc: Number of messages in the dataset
    - seq_num:
        type: u16
        desc: Position of this message in the dataset
    - update_interval:
        type: u8
        desc: >
            Update interval between consecutive corrections. Encoded
            following RTCM DF391 specification.
    - iod_atmo:
        type: u8
        desc: >
            IOD of the SSR atmospheric correction
    - tropo_quality_indicator:
        type: u8
        desc: >
          Quality of the troposphere data. Encoded following RTCM DF389
          specification in units of m.

 - GridDefinitionHeaderDepA:
    short_desc: Defines the grid for MSG_SSR_GRIDDED_CORRECTION messages
    desc: >
      Defines the grid for MSG_SSR_GRIDDED_CORRECTION messages.
      Also includes an RLE encoded validity list.
    fields:
    - region_size_inverse:
        type: u8
        units: inverse degrees
        desc: >
          region_size (deg) = 10 / region_size_inverse
          0 is an invalid value.
    - area_width:
        type: u16
        desc: >
          grid height (deg) = grid width (deg) = area_width / region_size
          0 is an invalid value.
    - lat_nw_corner_enc:
        type: u16
        desc: North-West corner latitude (deg) = region_size * lat_nw_corner_enc - 90
    - lon_nw_corner_enc:
        type: u16
        desc: North-West corner longitude (deg) = region_size * lon_nw_corner_enc - 180
    - num_msgs:
        type: u8
        desc: Number of messages in the dataset
    - seq_num:
        type: u8
        desc: Position of this message in the dataset

 - MSG_SSR_STEC_CORRECTION_DEP_A:
    id: 0x05EB
    short_desc: Deprecated
    desc: Deprecated.
    public: false
    replaced_by:
      - MSG_SSR_STEC_CORRECTION
    fields:
        - header:
            type: STECHeaderDepA
            desc: Header of a STEC message
        - stec_sat_list:
            type: array
            fill: STECSatElement
            desc: Array of STEC information for each space vehicle

 - MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A:
    id: 0x05F0
    short_desc: Deprecated
    desc: Deprecated.
    public: false
    replaced_by:
      - MSG_SSR_STEC_CORRECTION_DEP
    fields:
        - header:
            type: GriddedCorrectionHeaderDepA
            desc: Header of a Gridded Correction message
        - index:
            type: u16
            desc: Index of the grid point
        - tropo_delay_correction:
            type: TroposphericDelayCorrectionNoStd
            desc: Wet and hydrostatic vertical delays
        - stec_residuals:
            type: array
            fill: STECResidualNoStd
            desc: STEC residuals for each satellite

 - MSG_SSR_GRIDDED_CORRECTION_DEP_A:
    id: 0x05FA
    short_desc: Deprecated
    desc: Deprecated.
    public: false
    replaced_by:
      - MSG_SSR_GRIDDED_CORRECTION
    fields:
        - header:
            type: GriddedCorrectionHeaderDepA
            desc: Header of a Gridded Correction message
        - index:
            type: u16
            desc: Index of the grid point
        - tropo_delay_correction:
            type: TroposphericDelayCorrection
            desc: Wet and hydrostatic vertical delays (mean, stddev)
        - stec_residuals:
            type: array
            fill: STECResidual
            desc: STEC residuals for each satellite (mean, stddev)

 - MSG_SSR_GRID_DEFINITION_DEP_A:
    id: 0x05F5
    short_desc: Deprecated
    desc: Deprecated.
    public: false
    replaced_by:
      - MSG_SSR_TILE_DEFINITION_DEP
    fields:
        - header:
            type: GridDefinitionHeaderDepA
            desc: Header of a Gridded Correction message
        - rle_list:
            type: array
            fill: u8
            desc: >
              Run Length Encode list of quadrants that contain valid data.
              The spec describes the encoding scheme in detail, but
              essentially the index of the quadrants that contain transitions between
              valid and invalid (and vice versa) are encoded as u8 integers.

 - OrbitClockBound:
     desc: Orbit and clock bound.
     fields:
       - sat_id:
           type: u8
           desc: >
             Satellite ID. Similar to either RTCM DF068 (GPS), DF252 (Galileo),
             or DF488 (BDS) depending on the constellation.
       - orb_radial_bound_mu:
           type: u8
           units: m
           desc: >
             Mean Radial.
             See Note 1.
       - orb_along_bound_mu:
           type: u8
           units: m
           desc: >
             Mean Along-Track.
             See Note 1.
       - orb_cross_bound_mu:
           type: u8
           units: m
           desc: >
             Mean Cross-Track.
             See Note 1.
       - orb_radial_bound_sig:
           type: u8
           units: m
           desc: >
             Standard Deviation Radial.
             See Note 2.
       - orb_along_bound_sig:
           type: u8
           units: m
           desc: >
             Standard Deviation Along-Track.
             See Note 2.
       - orb_cross_bound_sig:
           type: u8
           units: m
           desc: >
             Standard Deviation Cross-Track.
             See Note 2.
       - clock_bound_mu:
           type: u8
           units: m
           desc: >
             Clock Bound Mean.
             See Note 1.
       - clock_bound_sig:
           type: u8
           units: m
           desc: >
             Clock Bound Standard Deviation.
             See Note 2.

 - MSG_SSR_ORBIT_CLOCK_BOUNDS:
     id: 0x05DE
     short_desc: Combined Orbit and Clock Bound
     desc: >
       Note 1: Range: 0-17.5 m.
       i<=200, mean=0.01i;
       200<i<=230, mean=2+0.1(i-200);
       i>230, mean=5+0.5(i-230).


       Note 2: Range: 0-17.5 m.
       i<=200, std=0.01i;
       200<i<=230, std=2+0.1(i-200)
       i>230, std=5+0.5(i-230).
     fields:
       - header:
           type: BoundsHeader
           desc: Header of a bounds message.
       - ssr_iod:
           type: u8
           desc: IOD of the SSR bound.
       - const_id:
           type: u8
           desc: Constellation ID to which the SVs belong.
           fields:
           - 0-7:
               values:
                   - 0: GPS
                   - 3: BDS
                   - 4: QZS
                   - 5: GAL
       - n_sats:
           type: u8
           desc: Number of satellites.
       - orbit_clock_bounds:
           type: array
           fill: OrbitClockBound
           size_fn: n_sats
           map_by: sat_id
           desc: Orbit and Clock Bounds per Satellite

 - CodePhaseBiasesSatSig:
     short_desc: Code and Phase Biases Bounds per Satellite-Signal couple
     fields:
       - sat_id:
           type: u8
           desc: >
             Satellite ID. Similar to either RTCM DF068 (GPS), DF252 (Galileo),
             or DF488 (BDS) depending on the constellation.
       - signal_id:
           type: u8
           desc: >
             Signal and Tracking Mode Identifier. Similar to either RTCM DF380 (GPS),
             DF382 (Galileo) or DF467 (BDS) depending on the constellation.
       - code_bias_bound_mu:
           type: u8
           units: 0.005 m
           desc: >
             Code Bias Mean.
             Range: 0-1.275 m
       - code_bias_bound_sig:
           type: u8
           units: 0.005 m
           desc: >
             Code Bias Standard Deviation.
             Range: 0-1.275 m
       - phase_bias_bound_mu:
           type: u8
           units: 0.005 m
           desc: >
             Phase Bias Mean.
             Range: 0-1.275 m
       - phase_bias_bound_sig:
           type: u8
           units: 0.005 m
           desc: >
             Phase Bias Standard Deviation.
             Range: 0-1.275 m

 - MSG_SSR_CODE_PHASE_BIASES_BOUNDS:
     id: 0x05EC
     short_desc: Combined Code and Phase Biases Bounds
     fields:
       - header:
           type: BoundsHeader
           desc: Header of a bounds message.
       - ssr_iod:
           type: u8
           desc: IOD of the SSR bound.
       - const_id:
           type: u8
           desc: Constellation ID to which the SVs belong.
           fields:
           - 0-7:
               values:
                   - 0: GPS
                   - 3: BDS
                   - 4: QZS
                   - 5: GAL
       - n_sats_signals:
           type: u8
           desc: Number of satellite-signal couples.
       - satellites_signals:
           type: array
           fill: CodePhaseBiasesSatSig
           size_fn: n_sats_signals
           map_by: sat_id
           desc: Code and Phase Biases Bounds per Satellite-Signal couple.

 - OrbitClockBoundDegradation:
     desc: Orbit and clock bound degradation.
     fields:
       - orb_radial_bound_mu_dot:
           type: u8
           units: 0.001 m/s
           desc: >
             Orbit Bound Mean Radial First derivative.
             Range: 0-0.255 m/s
       - orb_along_bound_mu_dot:
           type: u8
           units: 0.001 m/s
           desc: >
             Orbit Bound Mean Along-Track First derivative.
             Range: 0-0.255 m/s
       - orb_cross_bound_mu_dot:
           type: u8
           units: 0.001 m/s
           desc: >
             Orbit Bound Mean Cross-Track First derivative.
             Range: 0-0.255 m/s
       - orb_radial_bound_sig_dot:
           type: u8
           units: 0.001 m/s
           desc: >
             Orbit Bound Standard Deviation Radial First derivative.
             Range: 0-0.255 m/s
       - orb_along_bound_sig_dot:
           type: u8
           units: 0.001 m/s
           desc: >
             Orbit Bound Standard Deviation Along-Track First derivative.
             Range: 0-0.255 m/s
       - orb_cross_bound_sig_dot:
           type: u8
           units: 0.001 m/s
           desc: >
             Orbit Bound Standard Deviation Cross-Track First derivative.
             Range: 0-0.255 m/s
       - clock_bound_mu_dot:
           type: u8
           units: 0.001 m/s
           desc: >
             Clock Bound Mean First derivative.
             Range: 0-0.255 m/s
       - clock_bound_sig_dot:
           type: u8
           units: 0.001 m/s
           desc: >
             Clock Bound Standard Deviation First derivative.
             Range: 0-0.255 m/s

 - MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION:
     id: 0x05DF
     short_desc: Combined Orbit and Clock Bound Degradation Parameter
     fields:
       - header:
           type: BoundsHeader
           desc: Header of a bounds message.
       - ssr_iod:
           type: u8
           desc: IOD of the SSR bound degradation parameter.
       - const_id:
           type: u8
           desc: Constellation ID to which the SVs belong.
           fields:
           - 0-7:
               values:
                   - 0: GPS
                   - 3: BDS
                   - 4: QZS
                   - 5: GAL
       - sat_bitmask:
           type: u64
           desc: >
             Satellite Bit Mask. Put 1 for each satellite where the following
             degradation parameters are applicable, 0 otherwise. Encoded
             following RTCM DF394 specification.
       - orbit_clock_bounds_degradation:
           type: OrbitClockBoundDegradation
           desc: Orbit and Clock Bounds Degradation Parameters
