Fixposition SDK 0.0.0-heads/main-0-g90a51ff
Collection of c++ libraries and apps for use with Fixposition products
Loading...
Searching...
No Matches
fpsdk::common::gnss Namespace Reference

GNSS types and utilities. More...

Typedefs

using SvNr = uint8_t
 Satellite number (within a GNSS)
 
using Sat = uint16_t
 Satellite ("sat"), consisting of GNSS and satellite number, suitable for indexing and sorting.
 
using SatSig = uint32_t
 Satellite plus frequency band and signal ("satsig"), suitable for indexing and sorting.
 

Enumerations

enum class  GnssFixType : uint8_t {
  UNKNOWN = 0 , NOFIX = 1 , DRONLY = 2 , TIME = 3 ,
  SPP_2D = 4 , SPP_3D = 5 , SPP_3D_DR = 6 , RTK_FLOAT = 7 ,
  RTK_FIXED = 8 , RTK_FLOAT_DR = 9 , RTK_FIXED_DR = 10
}
 GNSS fix types. More...
 
enum class  Gnss : uint8_t {
  UNKNOWN = 0 , GPS = 'G' , SBAS = 'S' , GAL = 'E' ,
  BDS = 'C' , QZSS = 'J' , GLO = 'R' , NAVIC = 'I'
}
 GNSS. More...
 
enum class  Signal : uint8_t {
  UNKNOWN = 0 , BDS_B1C , BDS_B1I , BDS_B2A ,
  BDS_B2I , GAL_E1 , GAL_E5A , GAL_E5B ,
  GLO_L1OF , GLO_L2OF , GPS_L1CA , GPS_L2C ,
  GPS_L5 , QZSS_L1CA , QZSS_L1S , QZSS_L2C ,
  QZSS_L5 , SBAS_L1CA , NAVIC_L5A
}
 Signals. More...
 
enum class  Band : uint8_t { UNKNOWN = 0 , L1 , L2 , L5 }
 Frequency bands. More...
 

Functions

const char * GnssFixTypeStr (const GnssFixType fix_type)
 Stringify GNSS fix type.
 
const char * GnssStr (const Gnss gnss)
 Stringify GNSS.
 
const char * SignalStr (const Signal signal)
 Stringify signal.
 
const char * BandStr (const Band band)
 Stringify frequency band.
 
Band SignalToBand (const Signal signal)
 Get frequency band for a signal.
 
static constexpr Sat GnssSvNrToSat (const Gnss gnss, const SvNr svnr)
 Get "sat" from GNSS and satellite ID.
 
static constexpr Gnss SatToGnss (const Sat sat)
 Get GNSS from "sat".
 
static constexpr SvNr SatToSvNr (const Sat sat)
 Get satellite nr from "sat".
 
static constexpr SatSig GnssSvNrBandSignalToSatSig (const Gnss gnss, const SvNr svnr, const Band band, const Signal signal)
 Get "satsig" from components.
 
static constexpr Gnss SatSigToGnss (const SatSig satsig)
 Get GNSS from "satsig".
 
static constexpr SvNr SatSigToSvNr (const SatSig satsig)
 Get satellite nr from "satsig".
 
static constexpr Band SatSigToBand (const SatSig satsig)
 Get frequency band from "satsig".
 
static constexpr Signal SatSigToSignal (const SatSig satsig)
 Get signal from "satsig".
 
const char * SatStr (const Sat sat)
 Stringify satellite.
 
Sat StrSat (const char *str)
 Satellite from string.
 
Gnss UbxGnssIdToGnss (const uint8_t gnssId)
 Convert UBX gnssId to GNSS.
 
Sat UbxGnssIdSvIdToSat (const uint8_t gnssId, const uint8_t svId)
 Convert UBX gnssId and svId to satellite.
 
Signal UbxGnssIdSigIdToSignal (const uint8_t gnssId, const uint8_t sigId)
 Convert UBX gnssId and sigId to signal.
 

Variables

static constexpr SvNr NUM_GPS = 32
 Number of GPS satellites (G01-G32, PRN)
 
static constexpr SvNr NUM_SBAS = 39
 Number of SBAS satellites (S20-S59, PRN - 100)
 
static constexpr SvNr NUM_GAL = 36
 Number of Galileo satellites (E01-E36, PRN)
 
static constexpr SvNr NUM_BDS = 63
 Number of BeiDou satellites (C01-C63, PRN)
 
static constexpr SvNr NUM_QZSS = 10
 Number of QZSS satellites (J01-J10, PRN - 192)
 
static constexpr SvNr NUM_GLO = 32
 Number of GLONASS satellites (R01-R32, slot)
 
static constexpr SvNr NUM_NAVIC = 14
 Number of NavIC satellites (I01-I14, PRN)
 
static constexpr SvNr FIRST_GPS = 1
 First GPS satellite number.
 
static constexpr SvNr FIRST_SBAS = 20
 First SBAS satellite number.
 
static constexpr SvNr FIRST_GAL = 1
 First Galileo satellite number.
 
static constexpr SvNr FIRST_BDS = 1
 First BeiDou satellite number.
 
static constexpr SvNr FIRST_QZSS = 1
 First QZSS satellite number.
 
static constexpr SvNr FIRST_GLO = 1
 First GLONASS satellite number.
 
static constexpr SvNr FIRST_NAVIC = 1
 First NavIC satellite number.
 
static constexpr SvNr INAVLID_SVNR = 0
 Invalid satellite number (in any GNSS)
 
static constexpr Sat INVALID_SAT = GnssSvNrToSat(Gnss::UNKNOWN, INAVLID_SVNR)
 Invalid "sat".
 
static constexpr SatSig INVALID_SATSIG
 Invalid "satsig"".
 

Detailed Description

GNSS types and utilities.

Typedef Documentation

◆ SvNr

using fpsdk::common::gnss::SvNr = uint8_t

Satellite number (within a GNSS)

Definition at line 157 of file gnss.hpp.

◆ Sat

using fpsdk::common::gnss::Sat = uint16_t

Satellite ("sat"), consisting of GNSS and satellite number, suitable for indexing and sorting.

Definition at line 184 of file gnss.hpp.

◆ SatSig

using fpsdk::common::gnss::SatSig = uint32_t

Satellite plus frequency band and signal ("satsig"), suitable for indexing and sorting.

Definition at line 237 of file gnss.hpp.

Enumeration Type Documentation

◆ GnssFixType

enum class fpsdk::common::gnss::GnssFixType : uint8_t
strong

GNSS fix types.

Enumerator
UNKNOWN 

Unknown fix.

NOFIX 

No fix.

DRONLY 

Dead-reckoning only fix.

TIME 

Time only fix.

SPP_2D 

2D fix

SPP_3D 

3D fix

SPP_3D_DR 

3D + dead-reckoning fix

RTK_FLOAT 

RTK float fix (implies 3D fix)

RTK_FIXED 

RTK fixed fix (implies 3D fix)

RTK_FLOAT_DR 

RTK float fix + dead-reckoning (implies RTK_FLOAT fix)

RTK_FIXED_DR 

RTK fixed fix + dead-reckoning (implies RTK_FIXED fix)

Definition at line 42 of file gnss.hpp.

◆ Gnss

enum class fpsdk::common::gnss::Gnss : uint8_t
strong

GNSS.

Enumerator
UNKNOWN 

Unknown/unspecified GNSS.

GPS 

GPS.

SBAS 

SBAS.

GAL 

Galileo.

BDS 

BeiDou.

QZSS 

QZSS.

GLO 

GLONASS.

NAVIC 

NavIC (IRNSS)

Definition at line 69 of file gnss.hpp.

◆ Signal

enum class fpsdk::common::gnss::Signal : uint8_t
strong

Signals.

Enumerator
UNKNOWN 

Unknown/unspecified signal.

BDS_B1C 

BeiDou B1c signal (B1 Cp and B1 Cd)

BDS_B1I 

BeiDou B1I signal (B1I D1 and B1I D2)

BDS_B2A 

BeiDou B2a signal (B2 ap and B2 ad)

BDS_B2I 

BeiDou B2I signal (B2I D1 and B2I D2)

GAL_E1 

Galileo E1 signal (E1 C and E1 B)

GAL_E5A 

Galileo E5a signal (E5 aI and E5 aQ)

GAL_E5B 

Galileo E5b signal (E5 bI and E5 bQ)

GLO_L1OF 

GLONASS L1 OF signal.

GLO_L2OF 

GLONASS L2 OF signal.

GPS_L1CA 

GPS L1 C/A signal.

GPS_L2C 

GPS L2 C signal (L2 CL and L2 CM)

GPS_L5 

GPS L5 signal (L5 I and L5 Q)

QZSS_L1CA 

QZSS L1 C/A signal.

QZSS_L1S 

QZSS L1 S (SAIF) signal.

QZSS_L2C 

QZSS L2 C signal (L2 CL and L2 CM)

QZSS_L5 

QZSS L5 signal (L5 I and L5 Q)

SBAS_L1CA 

SBAS L1 C/A signal.

NAVIC_L5A 

NavIC L5 A.

Definition at line 93 of file gnss.hpp.

◆ Band

enum class fpsdk::common::gnss::Band : uint8_t
strong

Frequency bands.

Enumerator
UNKNOWN 

Unknown/unspecified band.

L1 

L1 band (~1.5GHz)

L2 

L2 band (~1.2GHz)

L5 

L5 band (~1.1GHz)

Definition at line 128 of file gnss.hpp.

Function Documentation

◆ GnssFixTypeStr()

const char * fpsdk::common::gnss::GnssFixTypeStr ( const GnssFixType fix_type)

Stringify GNSS fix type.

Parameters
[in]fix_typeThe fix type
Returns
a concise and unique string for the fix types, "?" for bad values

◆ GnssStr()

const char * fpsdk::common::gnss::GnssStr ( const Gnss gnss)

Stringify GNSS.

Parameters
[in]gnssThe GNSS
Returns
a concise and unique string for the GNSS, "?" for bad values

◆ SignalStr()

const char * fpsdk::common::gnss::SignalStr ( const Signal signal)

Stringify signal.

Parameters
[in]signalThe signal
Returns
a concise and unique string for the signal, "?" for bad values

◆ BandStr()

const char * fpsdk::common::gnss::BandStr ( const Band band)

Stringify frequency band.

Parameters
[in]bandThe frequency band
Returns
a concise and unique string for the frequency band, "?" for bad values

◆ SignalToBand()

Band fpsdk::common::gnss::SignalToBand ( const Signal signal)

Get frequency band for a signal.

Parameters
[in]signalThe signal
Returns
the frequency band for the signal

◆ GnssSvNrToSat()

static constexpr Sat fpsdk::common::gnss::GnssSvNrToSat ( const Gnss gnss,
const SvNr svnr )
staticconstexpr

Get "sat" from GNSS and satellite ID.

Note
This does not do any range checking and it's up to the user to provide a valid satellite ID for the given GNSS.
Parameters
[in]gnssGNSS
[in]svnrSatellite ID
Returns
the "sat"

Definition at line 196 of file gnss.hpp.

References fpsdk::common::types::EnumToVal().

◆ SatToGnss()

static constexpr Gnss fpsdk::common::gnss::SatToGnss ( const Sat sat)
staticconstexpr

Get GNSS from "sat".

Parameters
[in]satThe "sat"
Returns
the GNSS

Definition at line 215 of file gnss.hpp.

◆ SatToSvNr()

static constexpr SvNr fpsdk::common::gnss::SatToSvNr ( const Sat sat)
staticconstexpr

Get satellite nr from "sat".

Parameters
[in]satThe "sat"
Returns
the satellite nr

Definition at line 227 of file gnss.hpp.

◆ GnssSvNrBandSignalToSatSig()

static constexpr SatSig fpsdk::common::gnss::GnssSvNrBandSignalToSatSig ( const Gnss gnss,
const SvNr svnr,
const Band band,
const Signal signal )
staticconstexpr

Get "satsig" from components.

Note
This does not do any range checking and it's up to the user to provide a valid satellite ID for the given GNSS.
Parameters
[in]gnssGNSS
[in]svnrSatellite ID
[in]bandFrequency band
[in]signalSignal
Returns
the "satsig"

Definition at line 251 of file gnss.hpp.

References fpsdk::common::types::EnumToVal().

◆ SatSigToGnss()

static constexpr Gnss fpsdk::common::gnss::SatSigToGnss ( const SatSig satsig)
staticconstexpr

Get GNSS from "satsig".

Parameters
[in]satsigThe "satsig"
Returns
the GNSS

Definition at line 272 of file gnss.hpp.

◆ SatSigToSvNr()

static constexpr SvNr fpsdk::common::gnss::SatSigToSvNr ( const SatSig satsig)
staticconstexpr

Get satellite nr from "satsig".

Parameters
[in]satsigThe "satsig"
Returns
the satellite nr

Definition at line 284 of file gnss.hpp.

◆ SatSigToBand()

static constexpr Band fpsdk::common::gnss::SatSigToBand ( const SatSig satsig)
staticconstexpr

Get frequency band from "satsig".

Parameters
[in]satsigThe "satsig"
Returns
the frequency band

Definition at line 296 of file gnss.hpp.

◆ SatSigToSignal()

static constexpr Signal fpsdk::common::gnss::SatSigToSignal ( const SatSig satsig)
staticconstexpr

Get signal from "satsig".

Parameters
[in]satsigThe "satsig"
Returns
the signal

Definition at line 308 of file gnss.hpp.

◆ SatStr()

const char * fpsdk::common::gnss::SatStr ( const Sat sat)

Stringify satellite.

Parameters
[in]satThe satellite
Returns
a unique string identifying the satellite

◆ StrSat()

Sat fpsdk::common::gnss::StrSat ( const char * str)

Satellite from string.

Parameters
[in]strThe string ("G03", "R22", "C12", ...)
Returns
the satellite (INVALID_SAT if str was invalid)

◆ UbxGnssIdToGnss()

Gnss fpsdk::common::gnss::UbxGnssIdToGnss ( const uint8_t gnssId)

Convert UBX gnssId to GNSS.

Parameters
[in]gnssIdUBX gnssId
Returns
the GNSS

◆ UbxGnssIdSvIdToSat()

Sat fpsdk::common::gnss::UbxGnssIdSvIdToSat ( const uint8_t gnssId,
const uint8_t svId )

Convert UBX gnssId and svId to satellite.

Parameters
[in]gnssIdUBX gnssId
[in]svIdUBX svId
Returns
the satellite, INVALID_SAT for invalid gnssId/svId

◆ UbxGnssIdSigIdToSignal()

Signal fpsdk::common::gnss::UbxGnssIdSigIdToSignal ( const uint8_t gnssId,
const uint8_t sigId )

Convert UBX gnssId and sigId to signal.

Parameters
[in]gnssIdUBX gnssId
[in]sigIdUBX sigId
Returns
the signal

Variable Documentation

◆ NUM_GPS

SvNr fpsdk::common::gnss::NUM_GPS = 32
staticconstexpr

Number of GPS satellites (G01-G32, PRN)

Definition at line 162 of file gnss.hpp.

◆ NUM_SBAS

SvNr fpsdk::common::gnss::NUM_SBAS = 39
staticconstexpr

Number of SBAS satellites (S20-S59, PRN - 100)

Definition at line 163 of file gnss.hpp.

◆ NUM_GAL

SvNr fpsdk::common::gnss::NUM_GAL = 36
staticconstexpr

Number of Galileo satellites (E01-E36, PRN)

Definition at line 164 of file gnss.hpp.

◆ NUM_BDS

SvNr fpsdk::common::gnss::NUM_BDS = 63
staticconstexpr

Number of BeiDou satellites (C01-C63, PRN)

Definition at line 165 of file gnss.hpp.

◆ NUM_QZSS

SvNr fpsdk::common::gnss::NUM_QZSS = 10
staticconstexpr

Number of QZSS satellites (J01-J10, PRN - 192)

Definition at line 166 of file gnss.hpp.

◆ NUM_GLO

SvNr fpsdk::common::gnss::NUM_GLO = 32
staticconstexpr

Number of GLONASS satellites (R01-R32, slot)

Definition at line 167 of file gnss.hpp.

◆ NUM_NAVIC

SvNr fpsdk::common::gnss::NUM_NAVIC = 14
staticconstexpr

Number of NavIC satellites (I01-I14, PRN)

Definition at line 168 of file gnss.hpp.

◆ FIRST_GPS

SvNr fpsdk::common::gnss::FIRST_GPS = 1
staticconstexpr

First GPS satellite number.

Definition at line 169 of file gnss.hpp.

◆ FIRST_SBAS

SvNr fpsdk::common::gnss::FIRST_SBAS = 20
staticconstexpr

First SBAS satellite number.

Definition at line 170 of file gnss.hpp.

◆ FIRST_GAL

SvNr fpsdk::common::gnss::FIRST_GAL = 1
staticconstexpr

First Galileo satellite number.

Definition at line 171 of file gnss.hpp.

◆ FIRST_BDS

SvNr fpsdk::common::gnss::FIRST_BDS = 1
staticconstexpr

First BeiDou satellite number.

Definition at line 172 of file gnss.hpp.

◆ FIRST_QZSS

SvNr fpsdk::common::gnss::FIRST_QZSS = 1
staticconstexpr

First QZSS satellite number.

Definition at line 173 of file gnss.hpp.

◆ FIRST_GLO

SvNr fpsdk::common::gnss::FIRST_GLO = 1
staticconstexpr

First GLONASS satellite number.

Definition at line 174 of file gnss.hpp.

◆ FIRST_NAVIC

SvNr fpsdk::common::gnss::FIRST_NAVIC = 1
staticconstexpr

First NavIC satellite number.

Definition at line 175 of file gnss.hpp.

◆ INAVLID_SVNR

SvNr fpsdk::common::gnss::INAVLID_SVNR = 0
staticconstexpr

Invalid satellite number (in any GNSS)

Definition at line 176 of file gnss.hpp.

◆ INVALID_SAT

Sat fpsdk::common::gnss::INVALID_SAT = GnssSvNrToSat(Gnss::UNKNOWN, INAVLID_SVNR)
staticconstexpr

Invalid "sat".

Note
This is not the only invalid combination of GNSS and satellite number!

Definition at line 206 of file gnss.hpp.

◆ INVALID_SATSIG

SatSig fpsdk::common::gnss::INVALID_SATSIG
staticconstexpr
Initial value:
=
GnssSvNrBandSignalToSatSig(Gnss::UNKNOWN, INAVLID_SVNR, Band::UNKNOWN, Signal::UNKNOWN)
static constexpr SatSig GnssSvNrBandSignalToSatSig(const Gnss gnss, const SvNr svnr, const Band band, const Signal signal)
Get "satsig" from components.
Definition gnss.hpp:251

Invalid "satsig"".

Note
This is not the only invalid combination of GNSS, satellite number, band and signal!

Definition at line 262 of file gnss.hpp.