mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-06-03 07:04:09 +00:00
Changes the bits_slice structure by a vector of pair<int,int>. The former structure was not accepted by clang. Some code cleaning.
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@311 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
parent
31d742063a
commit
bf4de38e8a
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* -------------------------------------------------------------------------
|
* -------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
|
* Copyright (C) 2010-2013 (see AUTHORS file for a list of contributors)
|
||||||
*
|
*
|
||||||
* GNSS-SDR is a software defined Global Navigation
|
* GNSS-SDR is a software defined Global Navigation
|
||||||
* Satellite Systems receiver
|
* Satellite Systems receiver
|
||||||
@ -33,6 +33,8 @@
|
|||||||
#define GNSS_SDR_GPS_L1_CA_H_
|
#define GNSS_SDR_GPS_L1_CA_H_
|
||||||
|
|
||||||
#include <complex>
|
#include <complex>
|
||||||
|
#include <vector>
|
||||||
|
#include <utility>
|
||||||
#include <gnss_satellite.h>
|
#include <gnss_satellite.h>
|
||||||
|
|
||||||
// Physical constants
|
// Physical constants
|
||||||
@ -74,26 +76,10 @@ const int GPS_CA_PREAMBLE_LENGTH_BITS = 8;
|
|||||||
const int GPS_CA_TELEMETRY_RATE_BITS_SECOND = 50; //!< NAV message bit rate [bits/s]
|
const int GPS_CA_TELEMETRY_RATE_BITS_SECOND = 50; //!< NAV message bit rate [bits/s]
|
||||||
const int GPS_CA_TELEMETRY_RATE_SYMBOLS_SECOND = GPS_CA_TELEMETRY_RATE_BITS_SECOND*20; //!< NAV message bit rate [symbols/s]
|
const int GPS_CA_TELEMETRY_RATE_SYMBOLS_SECOND = GPS_CA_TELEMETRY_RATE_BITS_SECOND*20; //!< NAV message bit rate [symbols/s]
|
||||||
const int GPS_WORD_LENGTH = 4; // CRC + GPS WORD (-2 -1 0 ... 29) Bits = 4 bytes
|
const int GPS_WORD_LENGTH = 4; // CRC + GPS WORD (-2 -1 0 ... 29) Bits = 4 bytes
|
||||||
const int GPS_SUBFRAME_LENGTH=40; // GPS_WORD_LENGTH x 10 = 40 bytes
|
const int GPS_SUBFRAME_LENGTH = 40; // GPS_WORD_LENGTH x 10 = 40 bytes
|
||||||
const int GPS_SUBFRAME_BITS=300; //!< Number of bits per subframe in the NAV message [bits]
|
const int GPS_SUBFRAME_BITS = 300; //!< Number of bits per subframe in the NAV message [bits]
|
||||||
const int GPS_SUBFRAME_SECONDS=6; //!< Subframe duration [seconds]
|
const int GPS_SUBFRAME_SECONDS = 6; //!< Subframe duration [seconds]
|
||||||
const int GPS_WORD_BITS=30; //!< Number of bits per word in the NAV message [bits]
|
const int GPS_WORD_BITS = 30; //!< Number of bits per word in the NAV message [bits]
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Navigation message bits slice structure: A portion of bits is indicated by
|
|
||||||
* the start position inside the subframe and the length in number of bits */
|
|
||||||
typedef struct bits_slice
|
|
||||||
{
|
|
||||||
int position;
|
|
||||||
int length;
|
|
||||||
bits_slice(int p,int l)
|
|
||||||
{
|
|
||||||
position=p;
|
|
||||||
length=l;
|
|
||||||
}
|
|
||||||
} bits_slice;
|
|
||||||
|
|
||||||
|
|
||||||
/* Constants for scaling the ephemeris found in the data message
|
/* Constants for scaling the ephemeris found in the data message
|
||||||
the format is the following: TWO_N5 -> 2^-5, TWO_P4 -> 2^4, PI_TWO_N43 -> Pi*2^-43, etc etc
|
the format is the following: TWO_N5 -> 2^-5, TWO_P4 -> 2^4, PI_TWO_N43 -> Pi*2^-43, etc etc
|
||||||
@ -104,41 +90,40 @@ typedef struct bits_slice
|
|||||||
PI_TWO_PX ==> Pi*2^X
|
PI_TWO_PX ==> Pi*2^X
|
||||||
ONE_PI_TWO_PX = (1/Pi)*2^X
|
ONE_PI_TWO_PX = (1/Pi)*2^X
|
||||||
*/
|
*/
|
||||||
const double TWO_P4 =(16); //!< 2^4
|
const double TWO_P4 = (16); //!< 2^4
|
||||||
const double TWO_P11 =(2048); //!< 2^11
|
const double TWO_P11 = (2048); //!< 2^11
|
||||||
const double TWO_P12 =(4096); //!< 2^12
|
const double TWO_P12 = (4096); //!< 2^12
|
||||||
const double TWO_P14 =(16384); //!< 2^14
|
const double TWO_P14 = (16384); //!< 2^14
|
||||||
const double TWO_P16 =(65536); //!< 2^16
|
const double TWO_P16 = (65536); //!< 2^16
|
||||||
const double TWO_P19 =(524288); //!< 2^19
|
const double TWO_P19 = (524288); //!< 2^19
|
||||||
const double TWO_P31 =(2147483648.0); //!< 2^31
|
const double TWO_P31 = (2147483648.0); //!< 2^31
|
||||||
const double TWO_P32 =(4294967296.0); //!< 2^32 this is too big for an int so add the x.0
|
const double TWO_P32 = (4294967296.0); //!< 2^32 this is too big for an int so add the x.0
|
||||||
const double TWO_P56 =(7.205759403792794e+016); //!< 2^56
|
const double TWO_P56 = (7.205759403792794e+016); //!< 2^56
|
||||||
const double TWO_P57 =(1.441151880758559e+017); //!< 2^57
|
const double TWO_P57 = (1.441151880758559e+017); //!< 2^57
|
||||||
|
|
||||||
const double TWO_N5 =(0.03125); //!< 2^-5
|
const double TWO_N5 = (0.03125); //!< 2^-5
|
||||||
const double TWO_N11 =(4.882812500000000e-004); //!< 2^-11
|
const double TWO_N11 = (4.882812500000000e-004); //!< 2^-11
|
||||||
const double TWO_N19 =(1.907348632812500e-006); //!< 2^-19
|
const double TWO_N19 = (1.907348632812500e-006); //!< 2^-19
|
||||||
const double TWO_N20 =(9.536743164062500e-007); //!< 2^-20
|
const double TWO_N20 = (9.536743164062500e-007); //!< 2^-20
|
||||||
const double TWO_N21 =(4.768371582031250e-007); //!< 2^-21
|
const double TWO_N21 = (4.768371582031250e-007); //!< 2^-21
|
||||||
const double TWO_N24 =(5.960464477539063e-008); //!< 2^-24
|
const double TWO_N24 = (5.960464477539063e-008); //!< 2^-24
|
||||||
const double TWO_N25 =(2.980232238769531e-008); //!< 2^-25
|
const double TWO_N25 = (2.980232238769531e-008); //!< 2^-25
|
||||||
const double TWO_N27 =(7.450580596923828e-009); //!< 2^-27
|
const double TWO_N27 = (7.450580596923828e-009); //!< 2^-27
|
||||||
const double TWO_N29 =(1.862645149230957e-009); //!< 2^-29
|
const double TWO_N29 = (1.862645149230957e-009); //!< 2^-29
|
||||||
const double TWO_N30 =(9.313225746154785e-010); //!< 2^-30
|
const double TWO_N30 = (9.313225746154785e-010); //!< 2^-30
|
||||||
const double TWO_N31 =(4.656612873077393e-010); //!< 2^-31
|
const double TWO_N31 = (4.656612873077393e-010); //!< 2^-31
|
||||||
const double TWO_N32 =(2.328306436538696e-010); //!< 2^-32
|
const double TWO_N32 = (2.328306436538696e-010); //!< 2^-32
|
||||||
const double TWO_N33 =(1.164153218269348e-010); //!< 2^-33
|
const double TWO_N33 = (1.164153218269348e-010); //!< 2^-33
|
||||||
const double TWO_N38 =(3.637978807091713e-012); //!< 2^-38
|
const double TWO_N38 = (3.637978807091713e-012); //!< 2^-38
|
||||||
const double TWO_N43 =(1.136868377216160e-013); //!< 2^-43
|
const double TWO_N43 = (1.136868377216160e-013); //!< 2^-43
|
||||||
const double TWO_N50 =(8.881784197001252e-016); //!< 2^-50
|
const double TWO_N50 = (8.881784197001252e-016); //!< 2^-50
|
||||||
const double TWO_N55 =(2.775557561562891e-017); //!< 2^-55
|
const double TWO_N55 = (2.775557561562891e-017); //!< 2^-55
|
||||||
|
|
||||||
|
const double PI_TWO_N19 = (5.992112452678286e-006); //!< Pi*2^-19
|
||||||
const double PI_TWO_N19 =(5.992112452678286e-006); //!< Pi*2^-19
|
const double PI_TWO_N43 = (3.571577341960839e-013); //!< Pi*2^-43
|
||||||
const double PI_TWO_N43 =(3.571577341960839e-013); //!< Pi*2^-43
|
const double PI_TWO_N31 = (1.462918079267160e-009); //!< Pi*2^-31
|
||||||
const double PI_TWO_N31 =(1.462918079267160e-009); //!< Pi*2^-31
|
const double PI_TWO_N38 = (1.142904749427469e-011); //!< Pi*2^-38
|
||||||
const double PI_TWO_N38 =(1.142904749427469e-011); //!< Pi*2^-38
|
const double PI_TWO_N23 = (3.745070282923929e-007); //!< Pi*2^-23
|
||||||
const double PI_TWO_N23 =(3.745070282923929e-007); //!< Pi*2^-23
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -147,130 +132,129 @@ const double PI_TWO_N23 =(3.745070282923929e-007); //!< Pi*2^-2
|
|||||||
|
|
||||||
// SUBFRAME 1-5 (TLM and HOW)
|
// SUBFRAME 1-5 (TLM and HOW)
|
||||||
|
|
||||||
const bits_slice TOW[]= {{31,17}};
|
const std::vector<std::pair<int,int>> TOW({{31,17}});
|
||||||
const bits_slice INTEGRITY_STATUS_FLAG[] = {{23,1}};
|
const std::vector<std::pair<int,int>> INTEGRITY_STATUS_FLAG({{23,1}});
|
||||||
const bits_slice ALERT_FLAG[] = {{48,1}};
|
const std::vector<std::pair<int,int>> ALERT_FLAG({{48,1}});
|
||||||
const bits_slice ANTI_SPOOFING_FLAG[] = {{49,1}};
|
const std::vector<std::pair<int,int>> ANTI_SPOOFING_FLAG({{49,1}});
|
||||||
const bits_slice SUBFRAME_ID[]= {{50,3}};
|
const std::vector<std::pair<int,int>> SUBFRAME_ID({{50,3}});
|
||||||
|
|
||||||
|
|
||||||
// SUBFRAME 1
|
// SUBFRAME 1
|
||||||
const bits_slice GPS_WEEK[]= {{61,10}};
|
const std::vector<std::pair<int,int>> GPS_WEEK({{61,10}});
|
||||||
const bits_slice CA_OR_P_ON_L2[]= {{71,2}}; //*
|
const std::vector<std::pair<int,int>> CA_OR_P_ON_L2({{71,2}}); //*
|
||||||
const bits_slice SV_ACCURACY[]= {{73,4}};
|
const std::vector<std::pair<int,int>> SV_ACCURACY({{73,4}});
|
||||||
const bits_slice SV_HEALTH[]= {{77,6}};
|
const std::vector<std::pair<int,int>> SV_HEALTH ({{77,6}});
|
||||||
const bits_slice L2_P_DATA_FLAG[] = {{91,1}};
|
const std::vector<std::pair<int,int>> L2_P_DATA_FLAG ({{91,1}});
|
||||||
const bits_slice T_GD[]= {{197,8}};
|
const std::vector<std::pair<int,int>> T_GD({{197,8}});
|
||||||
const double T_GD_LSB=TWO_N31;
|
const double T_GD_LSB = TWO_N31;
|
||||||
|
|
||||||
const bits_slice IODC[]= {{83,2},{211,8}};
|
const std::vector<std::pair<int,int>> IODC({{83,2},{211,8}});
|
||||||
const bits_slice T_OC[]= {{219,16}};
|
const std::vector<std::pair<int,int>> T_OC({{219,16}});
|
||||||
const double T_OC_LSB=TWO_P4;
|
const double T_OC_LSB = TWO_P4;
|
||||||
|
|
||||||
const bits_slice A_F2[]= {{241,8}};
|
const std::vector<std::pair<int,int>> A_F2({{241,8}});
|
||||||
const double A_F2_LSB=TWO_N55;
|
const double A_F2_LSB = TWO_N55;
|
||||||
const bits_slice A_F1[]= {{249,16}};
|
const std::vector<std::pair<int,int>> A_F1({{249,16}});
|
||||||
const double A_F1_LSB=TWO_N43;
|
const double A_F1_LSB = TWO_N43;
|
||||||
const bits_slice A_F0[]= {{271,22}};
|
const std::vector<std::pair<int,int>> A_F0({{271,22}});
|
||||||
const double A_F0_LSB=TWO_N31;
|
const double A_F0_LSB = TWO_N31;
|
||||||
|
|
||||||
// SUBFRAME 2
|
// SUBFRAME 2
|
||||||
|
|
||||||
const bits_slice IODE_SF2[]= {{61,8}};
|
const std::vector<std::pair<int,int>> IODE_SF2({{61,8}});
|
||||||
const bits_slice C_RS[]= {{69,16}};
|
const std::vector<std::pair<int,int>> C_RS({{69,16}});
|
||||||
const double C_RS_LSB=TWO_N5;
|
const double C_RS_LSB = TWO_N5;
|
||||||
const bits_slice DELTA_N[]= {{91,16}};
|
const std::vector<std::pair<int,int>> DELTA_N({{91,16}});
|
||||||
const double DELTA_N_LSB=PI_TWO_N43;
|
const double DELTA_N_LSB = PI_TWO_N43;
|
||||||
const bits_slice M_0[]= {{107,8},{121,24}};
|
const std::vector<std::pair<int,int>> M_0({{107,8},{121,24}});
|
||||||
const double M_0_LSB=PI_TWO_N31;
|
const double M_0_LSB = PI_TWO_N31;
|
||||||
const bits_slice C_UC[]= {{151,16}};
|
const std::vector<std::pair<int,int>> C_UC({{151,16}});
|
||||||
const double C_UC_LSB=TWO_N29;
|
const double C_UC_LSB = TWO_N29;
|
||||||
const bits_slice E[]= {{167,8},{181,24}};
|
const std::vector<std::pair<int,int>> E({{167,8},{181,24}});
|
||||||
const double E_LSB=TWO_N33;
|
const double E_LSB = TWO_N33;
|
||||||
const bits_slice C_US[]= {{211,16}};
|
const std::vector<std::pair<int,int>> C_US({{211,16}});
|
||||||
const double C_US_LSB=TWO_N29;
|
const double C_US_LSB = TWO_N29;
|
||||||
const bits_slice SQRT_A[]= {{227,8},{241,24}};
|
const std::vector<std::pair<int,int>> SQRT_A({{227,8},{241,24}});
|
||||||
const double SQRT_A_LSB=TWO_N19;
|
const double SQRT_A_LSB = TWO_N19;
|
||||||
const bits_slice T_OE[]= {{271,16}};
|
const std::vector<std::pair<int,int>> T_OE({{271,16}});
|
||||||
const double T_OE_LSB=TWO_P4;
|
const double T_OE_LSB = TWO_P4;
|
||||||
const bits_slice FIT_INTERVAL_FLAG[]= {{271,1}};
|
const std::vector<std::pair<int,int>> FIT_INTERVAL_FLAG({{271,1}});
|
||||||
const bits_slice AODO[] = {{272,5}};
|
const std::vector<std::pair<int,int>> AODO({{272,5}});
|
||||||
const int AODO_LSB = 900;
|
const int AODO_LSB = 900;
|
||||||
|
|
||||||
// SUBFRAME 3
|
// SUBFRAME 3
|
||||||
|
|
||||||
const bits_slice C_IC[]= {{61,16}};
|
const std::vector<std::pair<int,int>> C_IC({{61,16}});
|
||||||
const double C_IC_LSB=TWO_N29;
|
const double C_IC_LSB = TWO_N29;
|
||||||
const bits_slice OMEGA_0[]= {{77,8},{91,24}};
|
const std::vector<std::pair<int,int>> OMEGA_0({{77,8},{91,24}});
|
||||||
const double OMEGA_0_LSB=PI_TWO_N31;
|
const double OMEGA_0_LSB = PI_TWO_N31;
|
||||||
const bits_slice C_IS[]= {{121,16}};
|
const std::vector<std::pair<int,int>> C_IS({{121,16}});
|
||||||
const double C_IS_LSB=TWO_N29;
|
const double C_IS_LSB = TWO_N29;
|
||||||
const bits_slice I_0[]= {{137,8},{151,24}};
|
const std::vector<std::pair<int,int>> I_0({{137,8},{151,24}});
|
||||||
const double I_0_LSB=PI_TWO_N31;
|
const double I_0_LSB = PI_TWO_N31;
|
||||||
const bits_slice C_RC[]= {{181,16}};
|
const std::vector<std::pair<int,int>> C_RC({{181,16}});
|
||||||
const double C_RC_LSB=TWO_N5;
|
const double C_RC_LSB = TWO_N5;
|
||||||
const bits_slice OMEGA[]= {{197,8},{211,24}};
|
const std::vector<std::pair<int,int>> OMEGA({{197,8},{211,24}});
|
||||||
const double OMEGA_LSB=PI_TWO_N31;
|
const double OMEGA_LSB = PI_TWO_N31;
|
||||||
const bits_slice OMEGA_DOT[]= {{241,24}};
|
const std::vector<std::pair<int,int>> OMEGA_DOT({{241,24}});
|
||||||
const double OMEGA_DOT_LSB=PI_TWO_N43;
|
const double OMEGA_DOT_LSB = PI_TWO_N43;
|
||||||
const bits_slice IODE_SF3[]= {{271,8}};
|
const std::vector<std::pair<int,int>> IODE_SF3({{271,8}});
|
||||||
|
const std::vector<std::pair<int,int>> I_DOT({{279,14}});
|
||||||
const bits_slice I_DOT[]= {{279,14}};
|
const double I_DOT_LSB = PI_TWO_N43;
|
||||||
const double I_DOT_LSB=PI_TWO_N43;
|
|
||||||
|
|
||||||
|
|
||||||
// SUBFRAME 4-5
|
// SUBFRAME 4-5
|
||||||
|
|
||||||
const bits_slice SV_DATA_ID[]= {{61,2}};
|
const std::vector<std::pair<int,int>> SV_DATA_ID({{61,2}});
|
||||||
const bits_slice SV_PAGE[]= {{63,6}};
|
const std::vector<std::pair<int,int>> SV_PAGE({{63,6}});
|
||||||
|
|
||||||
// SUBFRAME 4
|
// SUBFRAME 4
|
||||||
|
|
||||||
//! \todo read all pages of subframe 4
|
//! \todo read all pages of subframe 4
|
||||||
|
|
||||||
// Page 18 - Ionospheric and UTC data
|
// Page 18 - Ionospheric and UTC data
|
||||||
const bits_slice ALPHA_0[]= {{69,8}};
|
const std::vector<std::pair<int,int>> ALPHA_0({{69,8}});
|
||||||
const double ALPHA_0_LSB=TWO_N30;
|
const double ALPHA_0_LSB = TWO_N30;
|
||||||
const bits_slice ALPHA_1[]= {{77,8}};
|
const std::vector<std::pair<int,int>> ALPHA_1({{77,8}});
|
||||||
const double ALPHA_1_LSB=TWO_N27;
|
const double ALPHA_1_LSB = TWO_N27;
|
||||||
const bits_slice ALPHA_2[]= {{91,8}};
|
const std::vector<std::pair<int,int>> ALPHA_2({{91,8}});
|
||||||
const double ALPHA_2_LSB=TWO_N24;
|
const double ALPHA_2_LSB = TWO_N24;
|
||||||
const bits_slice ALPHA_3[]= {{99,8}};
|
const std::vector<std::pair<int,int>> ALPHA_3({{99,8}});
|
||||||
const double ALPHA_3_LSB=TWO_N24;
|
const double ALPHA_3_LSB = TWO_N24;
|
||||||
const bits_slice BETA_0[]= {{107,8}};
|
const std::vector<std::pair<int,int>> BETA_0({{107,8}});
|
||||||
const double BETA_0_LSB=TWO_P11;
|
const double BETA_0_LSB = TWO_P11;
|
||||||
const bits_slice BETA_1[]= {{121,8}};
|
const std::vector<std::pair<int,int>> BETA_1({{121,8}});
|
||||||
const double BETA_1_LSB=TWO_P14;
|
const double BETA_1_LSB = TWO_P14;
|
||||||
const bits_slice BETA_2[]= {{129,8}};
|
const std::vector<std::pair<int,int>> BETA_2({{129,8}});
|
||||||
const double BETA_2_LSB=TWO_P16;
|
const double BETA_2_LSB = TWO_P16;
|
||||||
const bits_slice BETA_3[]= {{137,8}};
|
const std::vector<std::pair<int,int>> BETA_3({{137,8}});
|
||||||
const double BETA_3_LSB=TWO_P16;
|
const double BETA_3_LSB = TWO_P16;
|
||||||
const bits_slice A_1[]= {{151,24}};
|
const std::vector<std::pair<int,int>> A_1({{151,24}});
|
||||||
const double A_1_LSB=TWO_N50;
|
const double A_1_LSB = TWO_N50;
|
||||||
const bits_slice A_0[]= {{181,24},{211,8}};
|
const std::vector<std::pair<int,int>> A_0({{181,24},{211,8}});
|
||||||
const double A_0_LSB=TWO_N30;
|
const double A_0_LSB = TWO_N30;
|
||||||
const bits_slice T_OT[]= {{219,8}};
|
const std::vector<std::pair<int,int>> T_OT({{219,8}});
|
||||||
const double T_OT_LSB=TWO_P12;
|
const double T_OT_LSB = TWO_P12;
|
||||||
const bits_slice WN_T[]= {{227,8}};
|
const std::vector<std::pair<int,int>> WN_T({{227,8}});
|
||||||
const double WN_T_LSB = 1;
|
const double WN_T_LSB = 1;
|
||||||
const bits_slice DELTAT_LS[]= {{241,8}};
|
const std::vector<std::pair<int,int>> DELTAT_LS({{241,8}});
|
||||||
const double DELTAT_LS_LSB = 1;
|
const double DELTAT_LS_LSB = 1;
|
||||||
const bits_slice WN_LSF[]= {{249,8}};
|
const std::vector<std::pair<int,int>> WN_LSF({{249,8}});
|
||||||
const double WN_LSF_LSB = 1;
|
const double WN_LSF_LSB = 1;
|
||||||
const bits_slice DN[]= {{257,8}};
|
const std::vector<std::pair<int,int>> DN({{257,8}});
|
||||||
const double DN_LSB = 1;
|
const double DN_LSB = 1;
|
||||||
const bits_slice DELTAT_LSF[]= {{271,8}};
|
const std::vector<std::pair<int,int>> DELTAT_LSF({{271,8}});
|
||||||
const double DELTAT_LSF_LSB = 1;
|
const double DELTAT_LSF_LSB = 1;
|
||||||
|
|
||||||
// Page 25 - Antispoofing, SV config and SV health (PRN 25 -32)
|
// Page 25 - Antispoofing, SV config and SV health (PRN 25 -32)
|
||||||
const bits_slice HEALTH_SV25[]={{229,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV25({{229,6}});
|
||||||
const bits_slice HEALTH_SV26[]={{241,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV26({{241,6}});
|
||||||
const bits_slice HEALTH_SV27[]={{247,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV27({{247,6}});
|
||||||
const bits_slice HEALTH_SV28[]={{253,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV28({{253,6}});
|
||||||
const bits_slice HEALTH_SV29[]={{259,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV29({{259,6}});
|
||||||
const bits_slice HEALTH_SV30[]={{271,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV30({{271,6}});
|
||||||
const bits_slice HEALTH_SV31[]={{277,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV31({{277,6}});
|
||||||
const bits_slice HEALTH_SV32[]={{283,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV32({{283,6}});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -281,33 +265,33 @@ const bits_slice HEALTH_SV32[]={{283,6}};
|
|||||||
|
|
||||||
|
|
||||||
// page 25 - Health (PRN 1 - 24)
|
// page 25 - Health (PRN 1 - 24)
|
||||||
const bits_slice T_OA[]={{69,8}};
|
const std::vector<std::pair<int,int>> T_OA({{69,8}});
|
||||||
const double T_OA_LSB = TWO_P12;
|
const double T_OA_LSB = TWO_P12;
|
||||||
const bits_slice WN_A[]={{77,8}};
|
const std::vector<std::pair<int,int>> WN_A({{77,8}});
|
||||||
const bits_slice HEALTH_SV1[]={{91,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV1({{91,6}});
|
||||||
const bits_slice HEALTH_SV2[]={{97,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV2({{97,6}});
|
||||||
const bits_slice HEALTH_SV3[]={{103,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV3({{103,6}});
|
||||||
const bits_slice HEALTH_SV4[]={{109,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV4({{109,6}});
|
||||||
const bits_slice HEALTH_SV5[]={{121,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV5({{121,6}});
|
||||||
const bits_slice HEALTH_SV6[]={{127,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV6({{127,6}});
|
||||||
const bits_slice HEALTH_SV7[]={{133,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV7({{133,6}});
|
||||||
const bits_slice HEALTH_SV8[]={{139,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV8({{139,6}});
|
||||||
const bits_slice HEALTH_SV9[]={{151,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV9({{151,6}});
|
||||||
const bits_slice HEALTH_SV10[]={{157,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV10({{157,6}});
|
||||||
const bits_slice HEALTH_SV11[]={{163,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV11({{163,6}});
|
||||||
const bits_slice HEALTH_SV12[]={{169,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV12({{169,6}});
|
||||||
const bits_slice HEALTH_SV13[]={{181,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV13({{181,6}});
|
||||||
const bits_slice HEALTH_SV14[]={{187,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV14({{187,6}});
|
||||||
const bits_slice HEALTH_SV15[]={{193,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV15({{193,6}});
|
||||||
const bits_slice HEALTH_SV16[]={{199,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV16({{199,6}});
|
||||||
const bits_slice HEALTH_SV17[]={{211,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV17({{211,6}});
|
||||||
const bits_slice HEALTH_SV18[]={{217,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV18({{217,6}});
|
||||||
const bits_slice HEALTH_SV19[]={{223,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV19({{223,6}});
|
||||||
const bits_slice HEALTH_SV20[]={{229,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV20({{229,6}});
|
||||||
const bits_slice HEALTH_SV21[]={{241,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV21({{241,6}});
|
||||||
const bits_slice HEALTH_SV22[]={{247,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV22({{247,6}});
|
||||||
const bits_slice HEALTH_SV23[]={{253,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV23({{253,6}});
|
||||||
const bits_slice HEALTH_SV24[]={{259,6}};
|
const std::vector<std::pair<int,int>> HEALTH_SV24({{259,6}});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* -------------------------------------------------------------------------
|
* -------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
|
* Copyright (C) 2010-2013 (see AUTHORS file for a list of contributors)
|
||||||
*
|
*
|
||||||
* GNSS-SDR is a software defined Global Navigation
|
* GNSS-SDR is a software defined Global Navigation
|
||||||
* Satellite Systems receiver
|
* Satellite Systems receiver
|
||||||
@ -34,14 +34,12 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "boost/date_time/posix_time/posix_time.hpp"
|
#include "boost/date_time/posix_time/posix_time.hpp"
|
||||||
|
|
||||||
#define num_of_slices(x) sizeof(x)/sizeof(bits_slice)
|
|
||||||
|
|
||||||
|
|
||||||
void Gps_Navigation_Message::reset()
|
void Gps_Navigation_Message::reset()
|
||||||
{
|
{
|
||||||
b_update_tow_flag=false;
|
b_update_tow_flag = false;
|
||||||
b_valid_ephemeris_set_flag=false;
|
b_valid_ephemeris_set_flag = false;
|
||||||
d_TOW=0;
|
d_TOW = 0;
|
||||||
d_TOW_SF1 = 0;
|
d_TOW_SF1 = 0;
|
||||||
d_TOW_SF2 = 0;
|
d_TOW_SF2 = 0;
|
||||||
d_TOW_SF3 = 0;
|
d_TOW_SF3 = 0;
|
||||||
@ -106,7 +104,6 @@ void Gps_Navigation_Message::reset()
|
|||||||
b_integrity_status_flag = false;
|
b_integrity_status_flag = false;
|
||||||
b_antispoofing_flag = false;
|
b_antispoofing_flag = false;
|
||||||
|
|
||||||
|
|
||||||
// Ionosphere and UTC
|
// Ionosphere and UTC
|
||||||
d_alpha0 = 0;
|
d_alpha0 = 0;
|
||||||
d_alpha1 = 0;
|
d_alpha1 = 0;
|
||||||
@ -196,11 +193,11 @@ void Gps_Navigation_Message::print_gps_word_bytes(unsigned int GPS_word)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Gps_Navigation_Message::read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS> bits, const bits_slice *slices)
|
bool Gps_Navigation_Message::read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int,int>> parameter)
|
||||||
{
|
{
|
||||||
bool value;
|
bool value;
|
||||||
|
|
||||||
if (bits[GPS_SUBFRAME_BITS - slices[0].position] == 1)
|
if (bits[GPS_SUBFRAME_BITS - parameter[0].first] == 1)
|
||||||
{
|
{
|
||||||
value = true;
|
value = true;
|
||||||
}
|
}
|
||||||
@ -214,16 +211,16 @@ bool Gps_Navigation_Message::read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
unsigned long int Gps_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int,int>> parameter)
|
||||||
unsigned long int Gps_Navigation_Message::read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const bits_slice *slices, int num_of_slices)
|
|
||||||
{
|
{
|
||||||
unsigned long int value = 0;
|
unsigned long int value = 0;
|
||||||
|
int num_of_slices = parameter.size();
|
||||||
for (int i=0; i<num_of_slices; i++)
|
for (int i=0; i<num_of_slices; i++)
|
||||||
{
|
{
|
||||||
for (int j=0; j<slices[i].length; j++)
|
for (int j=0; j<parameter[i].second; j++)
|
||||||
{
|
{
|
||||||
value <<= 1; //shift left
|
value <<= 1; //shift left
|
||||||
if (bits[GPS_SUBFRAME_BITS - slices[i].position - j] == 1)
|
if (bits[GPS_SUBFRAME_BITS - parameter[i].first - j] == 1)
|
||||||
{
|
{
|
||||||
value += 1; // insert the bit
|
value += 1; // insert the bit
|
||||||
}
|
}
|
||||||
@ -236,34 +233,33 @@ unsigned long int Gps_Navigation_Message::read_navigation_unsigned(std::bitset<G
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
signed long int Gps_Navigation_Message::read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int,int>> parameter)
|
||||||
signed long int Gps_Navigation_Message::read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const bits_slice *slices, int num_of_slices)
|
|
||||||
{
|
{
|
||||||
signed long int value = 0;
|
signed long int value = 0;
|
||||||
|
int num_of_slices = parameter.size();
|
||||||
// Discriminate between 64 bits and 32 bits compiler
|
// Discriminate between 64 bits and 32 bits compiler
|
||||||
int long_int_size_bytes = sizeof(signed long int);
|
int long_int_size_bytes = sizeof(signed long int);
|
||||||
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
|
if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system
|
||||||
{
|
{
|
||||||
// read the MSB and perform the sign extension
|
// read the MSB and perform the sign extension
|
||||||
if (bits[GPS_SUBFRAME_BITS - slices[0].position] == 1)
|
if (bits[GPS_SUBFRAME_BITS - parameter[0].first] == 1)
|
||||||
{
|
{
|
||||||
value^=0xFFFFFFFFFFFFFFFF; //64 bits variable
|
value ^= 0xFFFFFFFFFFFFFFFF; //64 bits variable
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
value&=0;
|
value &= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<num_of_slices; i++)
|
for (int i=0; i<num_of_slices; i++)
|
||||||
{
|
{
|
||||||
for (int j=0; j<slices[i].length; j++)
|
for (int j=0; j<parameter[i].second; j++)
|
||||||
{
|
{
|
||||||
value<<=1; //shift left
|
value <<= 1; //shift left
|
||||||
value&=0xFFFFFFFFFFFFFFFE; //reset the corresponding bit (for the 64 bits variable)
|
value &= 0xFFFFFFFFFFFFFFFE; //reset the corresponding bit (for the 64 bits variable)
|
||||||
if (bits[GPS_SUBFRAME_BITS - slices[i].position - j] == 1)
|
if (bits[GPS_SUBFRAME_BITS - parameter[i].first - j] == 1)
|
||||||
{
|
{
|
||||||
value+=1; // insert the bit
|
value += 1; // insert the bit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -271,24 +267,24 @@ signed long int Gps_Navigation_Message::read_navigation_signed(std::bitset<GPS_S
|
|||||||
else // we assume we are in a 32 bits system
|
else // we assume we are in a 32 bits system
|
||||||
{
|
{
|
||||||
// read the MSB and perform the sign extension
|
// read the MSB and perform the sign extension
|
||||||
if (bits[GPS_SUBFRAME_BITS-slices[0].position] == 1)
|
if (bits[GPS_SUBFRAME_BITS - parameter[0].first] == 1)
|
||||||
{
|
{
|
||||||
value^=0xFFFFFFFF;
|
value ^= 0xFFFFFFFF;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
value&=0;
|
value &= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<num_of_slices; i++)
|
for (int i=0; i<num_of_slices; i++)
|
||||||
{
|
{
|
||||||
for (int j=0; j<slices[i].length; j++)
|
for (int j=0; j<parameter[i].second; j++)
|
||||||
{
|
{
|
||||||
value<<=1; //shift left
|
value <<= 1; //shift left
|
||||||
value&=0xFFFFFFFE; //reset the corresponding bit
|
value &= 0xFFFFFFFE; //reset the corresponding bit
|
||||||
if (bits[GPS_SUBFRAME_BITS - slices[i].position - j] == 1)
|
if (bits[GPS_SUBFRAME_BITS - parameter[i].first - j] == 1)
|
||||||
{
|
{
|
||||||
value+=1; // insert the bit
|
value += 1; // insert the bit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -390,7 +386,7 @@ void Gps_Navigation_Message::satellitePosition(double transmitTime)
|
|||||||
d_dtr = F * d_e_eccentricity * d_sqrt_A * sin(E);
|
d_dtr = F * d_e_eccentricity * d_sqrt_A * sin(E);
|
||||||
|
|
||||||
// Compute the true anomaly
|
// Compute the true anomaly
|
||||||
double tmp_Y = sqrt(1.0 - d_e_eccentricity*d_e_eccentricity) * sin(E);
|
double tmp_Y = sqrt(1.0 - d_e_eccentricity * d_e_eccentricity) * sin(E);
|
||||||
double tmp_X = cos(E) - d_e_eccentricity;
|
double tmp_X = cos(E) - d_e_eccentricity;
|
||||||
nu = atan2(tmp_Y, tmp_X);
|
nu = atan2(tmp_Y, tmp_X);
|
||||||
|
|
||||||
@ -453,7 +449,7 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
subframe_ID = (int)read_navigation_unsigned(subframe_bits, SUBFRAME_ID, num_of_slices(SUBFRAME_ID));
|
subframe_ID = (int)read_navigation_unsigned(subframe_bits, SUBFRAME_ID);
|
||||||
|
|
||||||
// Decode all 5 sub-frames
|
// Decode all 5 sub-frames
|
||||||
switch (subframe_ID)
|
switch (subframe_ID)
|
||||||
@ -467,98 +463,98 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
|
|||||||
// subframe and we need the TOW of the first subframe in this data block
|
// subframe and we need the TOW of the first subframe in this data block
|
||||||
// (the variable subframe at this point contains bits of the last subframe).
|
// (the variable subframe at this point contains bits of the last subframe).
|
||||||
//TOW = bin2dec(subframe(31:47)) * 6 - 30;
|
//TOW = bin2dec(subframe(31:47)) * 6 - 30;
|
||||||
d_TOW_SF1 = (double)read_navigation_unsigned(subframe_bits, TOW, num_of_slices(TOW));
|
d_TOW_SF1 = (double)read_navigation_unsigned(subframe_bits, TOW);
|
||||||
//we are in the first subframe (the transmitted TOW is the start time of the next subframe) !
|
//we are in the first subframe (the transmitted TOW is the start time of the next subframe) !
|
||||||
d_TOW_SF1 = d_TOW_SF1*6;
|
d_TOW_SF1 = d_TOW_SF1*6;
|
||||||
d_TOW=d_TOW_SF5;// Set transmission time
|
d_TOW = d_TOW_SF5; // Set transmission time
|
||||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||||
i_GPS_week = (int)read_navigation_unsigned(subframe_bits, GPS_WEEK, num_of_slices(GPS_WEEK));
|
i_GPS_week = (int)read_navigation_unsigned(subframe_bits, GPS_WEEK);
|
||||||
i_SV_accuracy = (int)read_navigation_unsigned(subframe_bits, SV_ACCURACY, num_of_slices(SV_ACCURACY)); // (20.3.3.3.1.3)
|
i_SV_accuracy = (int)read_navigation_unsigned(subframe_bits, SV_ACCURACY); // (20.3.3.3.1.3)
|
||||||
i_SV_health = (int)read_navigation_unsigned(subframe_bits, SV_HEALTH, num_of_slices(SV_HEALTH));
|
i_SV_health = (int)read_navigation_unsigned(subframe_bits, SV_HEALTH);
|
||||||
b_L2_P_data_flag = read_navigation_bool(subframe_bits, L2_P_DATA_FLAG); //
|
b_L2_P_data_flag = read_navigation_bool(subframe_bits, L2_P_DATA_FLAG); //
|
||||||
i_code_on_L2 = (int)read_navigation_unsigned(subframe_bits, CA_OR_P_ON_L2, num_of_slices(CA_OR_P_ON_L2));
|
i_code_on_L2 = (int)read_navigation_unsigned(subframe_bits, CA_OR_P_ON_L2);
|
||||||
d_TGD = (double)read_navigation_signed(subframe_bits, T_GD, num_of_slices(T_GD));
|
d_TGD = (double)read_navigation_signed(subframe_bits, T_GD);
|
||||||
d_TGD = d_TGD*T_GD_LSB;
|
d_TGD = d_TGD*T_GD_LSB;
|
||||||
d_IODC = (double)read_navigation_unsigned(subframe_bits, IODC, num_of_slices(IODC));
|
d_IODC = (double)read_navigation_unsigned(subframe_bits, IODC);
|
||||||
d_Toc = (double)read_navigation_unsigned(subframe_bits, T_OC, num_of_slices(T_OC));
|
d_Toc = (double)read_navigation_unsigned(subframe_bits, T_OC);
|
||||||
d_Toc = d_Toc*T_OC_LSB;
|
d_Toc = d_Toc*T_OC_LSB;
|
||||||
d_A_f0 = (double)read_navigation_signed(subframe_bits, A_F0, num_of_slices(A_F0));
|
d_A_f0 = (double)read_navigation_signed(subframe_bits, A_F0);
|
||||||
d_A_f0 = d_A_f0*A_F0_LSB;
|
d_A_f0 = d_A_f0*A_F0_LSB;
|
||||||
d_A_f1 = (double)read_navigation_signed(subframe_bits, A_F1, num_of_slices(A_F1));
|
d_A_f1 = (double)read_navigation_signed(subframe_bits, A_F1);
|
||||||
d_A_f1 = d_A_f1*A_F1_LSB;
|
d_A_f1 = d_A_f1*A_F1_LSB;
|
||||||
d_A_f2 = (double)read_navigation_signed(subframe_bits, A_F2, num_of_slices(A_F2));
|
d_A_f2 = (double)read_navigation_signed(subframe_bits, A_F2);
|
||||||
d_A_f2 = d_A_f2*A_F2_LSB;
|
d_A_f2 = d_A_f2*A_F2_LSB;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2: //--- It is subframe 2 -------------------
|
case 2: //--- It is subframe 2 -------------------
|
||||||
d_TOW_SF2 = (double)read_navigation_unsigned(subframe_bits, TOW, num_of_slices(TOW));
|
d_TOW_SF2 = (double)read_navigation_unsigned(subframe_bits, TOW);
|
||||||
d_TOW_SF2 = d_TOW_SF2*6;
|
d_TOW_SF2 = d_TOW_SF2*6;
|
||||||
d_TOW=d_TOW_SF1;// Set transmission time
|
d_TOW = d_TOW_SF1; // Set transmission time
|
||||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||||
d_IODE_SF2 = (double)read_navigation_unsigned(subframe_bits, IODE_SF2, num_of_slices(IODE_SF2));
|
d_IODE_SF2 = (double)read_navigation_unsigned(subframe_bits, IODE_SF2);
|
||||||
d_Crs = (double)read_navigation_signed(subframe_bits, C_RS, num_of_slices(C_RS));
|
d_Crs = (double)read_navigation_signed(subframe_bits, C_RS);
|
||||||
d_Crs = d_Crs * C_RS_LSB;
|
d_Crs = d_Crs * C_RS_LSB;
|
||||||
d_Delta_n = (double)read_navigation_signed(subframe_bits, DELTA_N, num_of_slices(DELTA_N));
|
d_Delta_n = (double)read_navigation_signed(subframe_bits, DELTA_N);
|
||||||
d_Delta_n = d_Delta_n * DELTA_N_LSB;
|
d_Delta_n = d_Delta_n * DELTA_N_LSB;
|
||||||
d_M_0 = (double)read_navigation_signed(subframe_bits, M_0, num_of_slices(M_0));
|
d_M_0 = (double)read_navigation_signed(subframe_bits, M_0);
|
||||||
d_M_0 = d_M_0 * M_0_LSB;
|
d_M_0 = d_M_0 * M_0_LSB;
|
||||||
d_Cuc = (double)read_navigation_signed(subframe_bits, C_UC, num_of_slices(C_UC));
|
d_Cuc = (double)read_navigation_signed(subframe_bits, C_UC);
|
||||||
d_Cuc = d_Cuc * C_UC_LSB;
|
d_Cuc = d_Cuc * C_UC_LSB;
|
||||||
d_e_eccentricity = (double)read_navigation_unsigned(subframe_bits, E, num_of_slices(E));
|
d_e_eccentricity = (double)read_navigation_unsigned(subframe_bits, E);
|
||||||
d_e_eccentricity = d_e_eccentricity * E_LSB;
|
d_e_eccentricity = d_e_eccentricity * E_LSB;
|
||||||
d_Cus = (double)read_navigation_signed(subframe_bits, C_US, num_of_slices(C_US));
|
d_Cus = (double)read_navigation_signed(subframe_bits, C_US);
|
||||||
d_Cus = d_Cus * C_US_LSB;
|
d_Cus = d_Cus * C_US_LSB;
|
||||||
d_sqrt_A = (double)read_navigation_unsigned(subframe_bits, SQRT_A, num_of_slices(SQRT_A));
|
d_sqrt_A = (double)read_navigation_unsigned(subframe_bits, SQRT_A);
|
||||||
d_sqrt_A = d_sqrt_A * SQRT_A_LSB;
|
d_sqrt_A = d_sqrt_A * SQRT_A_LSB;
|
||||||
d_Toe = (double)read_navigation_unsigned(subframe_bits, T_OE, num_of_slices(T_OE));
|
d_Toe = (double)read_navigation_unsigned(subframe_bits, T_OE);
|
||||||
d_Toe = d_Toe * T_OE_LSB;
|
d_Toe = d_Toe * T_OE_LSB;
|
||||||
b_fit_interval_flag = read_navigation_bool(subframe_bits, FIT_INTERVAL_FLAG);
|
b_fit_interval_flag = read_navigation_bool(subframe_bits, FIT_INTERVAL_FLAG);
|
||||||
i_AODO = (int)read_navigation_unsigned(subframe_bits, AODO, num_of_slices(AODO));
|
i_AODO = (int)read_navigation_unsigned(subframe_bits, AODO);
|
||||||
i_AODO = i_AODO * AODO_LSB;
|
i_AODO = i_AODO * AODO_LSB;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3: // --- It is subframe 3 -------------------------------------
|
case 3: // --- It is subframe 3 -------------------------------------
|
||||||
d_TOW_SF3 = (double)read_navigation_unsigned(subframe_bits, TOW, num_of_slices(TOW));
|
d_TOW_SF3 = (double)read_navigation_unsigned(subframe_bits, TOW);
|
||||||
d_TOW_SF3 = d_TOW_SF3*6;
|
d_TOW_SF3 = d_TOW_SF3*6;
|
||||||
d_TOW=d_TOW_SF2;// Set transmission time
|
d_TOW = d_TOW_SF2; // Set transmission time
|
||||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||||
d_Cic = (double)read_navigation_signed(subframe_bits, C_IC, num_of_slices(C_IC));
|
d_Cic = (double)read_navigation_signed(subframe_bits, C_IC);
|
||||||
d_Cic = d_Cic * C_IC_LSB;
|
d_Cic = d_Cic * C_IC_LSB;
|
||||||
d_OMEGA0 = (double)read_navigation_signed(subframe_bits, OMEGA_0, num_of_slices(OMEGA_0));
|
d_OMEGA0 = (double)read_navigation_signed(subframe_bits, OMEGA_0);
|
||||||
d_OMEGA0 = d_OMEGA0 * OMEGA_0_LSB;
|
d_OMEGA0 = d_OMEGA0 * OMEGA_0_LSB;
|
||||||
d_Cis = (double)read_navigation_signed(subframe_bits, C_IS, num_of_slices(C_IS));
|
d_Cis = (double)read_navigation_signed(subframe_bits, C_IS);
|
||||||
d_Cis = d_Cis * C_IS_LSB;
|
d_Cis = d_Cis * C_IS_LSB;
|
||||||
d_i_0 = (double)read_navigation_signed(subframe_bits, I_0, num_of_slices(I_0));
|
d_i_0 = (double)read_navigation_signed(subframe_bits, I_0);
|
||||||
d_i_0 = d_i_0 * I_0_LSB;
|
d_i_0 = d_i_0 * I_0_LSB;
|
||||||
d_Crc = (double)read_navigation_signed(subframe_bits, C_RC, num_of_slices(C_RC));
|
d_Crc = (double)read_navigation_signed(subframe_bits, C_RC);
|
||||||
d_Crc = d_Crc * C_RC_LSB;
|
d_Crc = d_Crc * C_RC_LSB;
|
||||||
d_OMEGA = (double)read_navigation_signed(subframe_bits, OMEGA, num_of_slices(OMEGA));
|
d_OMEGA = (double)read_navigation_signed(subframe_bits, OMEGA);
|
||||||
d_OMEGA = d_OMEGA * OMEGA_LSB;
|
d_OMEGA = d_OMEGA * OMEGA_LSB;
|
||||||
d_OMEGA_DOT = (double)read_navigation_signed(subframe_bits, OMEGA_DOT, num_of_slices(OMEGA_DOT));
|
d_OMEGA_DOT = (double)read_navigation_signed(subframe_bits, OMEGA_DOT);
|
||||||
d_OMEGA_DOT = d_OMEGA_DOT * OMEGA_DOT_LSB;
|
d_OMEGA_DOT = d_OMEGA_DOT * OMEGA_DOT_LSB;
|
||||||
d_IODE_SF3 = (double)read_navigation_unsigned(subframe_bits, IODE_SF3, num_of_slices(IODE_SF3));
|
d_IODE_SF3 = (double)read_navigation_unsigned(subframe_bits, IODE_SF3);
|
||||||
d_IDOT = (double)read_navigation_signed(subframe_bits, I_DOT, num_of_slices(I_DOT));
|
d_IDOT = (double)read_navigation_signed(subframe_bits, I_DOT);
|
||||||
d_IDOT = d_IDOT*I_DOT_LSB;
|
d_IDOT = d_IDOT*I_DOT_LSB;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4: // --- It is subframe 4 ---------- Almanac, ionospheric model, UTC parameters, SV health (PRN: 25-32)
|
case 4: // --- It is subframe 4 ---------- Almanac, ionospheric model, UTC parameters, SV health (PRN: 25-32)
|
||||||
d_TOW_SF4 = (double)read_navigation_unsigned(subframe_bits, TOW, num_of_slices(TOW));
|
d_TOW_SF4 = (double)read_navigation_unsigned(subframe_bits, TOW);
|
||||||
d_TOW_SF4 = d_TOW_SF4*6;
|
d_TOW_SF4 = d_TOW_SF4*6;
|
||||||
d_TOW=d_TOW_SF3;// Set transmission time
|
d_TOW = d_TOW_SF3; // Set transmission time
|
||||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||||
SV_data_ID = (int)read_navigation_unsigned(subframe_bits, SV_DATA_ID, num_of_slices(SV_DATA_ID));
|
SV_data_ID = (int)read_navigation_unsigned(subframe_bits, SV_DATA_ID);
|
||||||
SV_page = (int)read_navigation_unsigned(subframe_bits, SV_PAGE, num_of_slices(SV_PAGE));
|
SV_page = (int)read_navigation_unsigned(subframe_bits, SV_PAGE);
|
||||||
|
|
||||||
if (SV_page == 13)
|
if (SV_page == 13)
|
||||||
{
|
{
|
||||||
@ -568,93 +564,93 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
|
|||||||
if (SV_page == 18)
|
if (SV_page == 18)
|
||||||
{
|
{
|
||||||
// Page 18 - Ionospheric and UTC data
|
// Page 18 - Ionospheric and UTC data
|
||||||
d_alpha0 = (double)read_navigation_signed(subframe_bits, ALPHA_0, num_of_slices(ALPHA_0));
|
d_alpha0 = (double)read_navigation_signed(subframe_bits, ALPHA_0);
|
||||||
d_alpha0 = d_alpha0 * ALPHA_0_LSB;
|
d_alpha0 = d_alpha0 * ALPHA_0_LSB;
|
||||||
d_alpha1 = (double)read_navigation_signed(subframe_bits, ALPHA_1, num_of_slices(ALPHA_1));
|
d_alpha1 = (double)read_navigation_signed(subframe_bits, ALPHA_1);
|
||||||
d_alpha1 = d_alpha1 * ALPHA_1_LSB;
|
d_alpha1 = d_alpha1 * ALPHA_1_LSB;
|
||||||
d_alpha2 = (double)read_navigation_signed(subframe_bits, ALPHA_2, num_of_slices(ALPHA_2));
|
d_alpha2 = (double)read_navigation_signed(subframe_bits, ALPHA_2);
|
||||||
d_alpha2 = d_alpha2 * ALPHA_2_LSB;
|
d_alpha2 = d_alpha2 * ALPHA_2_LSB;
|
||||||
d_alpha3 = (double)read_navigation_signed(subframe_bits, ALPHA_3, num_of_slices(ALPHA_3));
|
d_alpha3 = (double)read_navigation_signed(subframe_bits, ALPHA_3);
|
||||||
d_alpha3 = d_alpha3 * ALPHA_3_LSB;
|
d_alpha3 = d_alpha3 * ALPHA_3_LSB;
|
||||||
d_beta0 = (double)read_navigation_signed(subframe_bits, BETA_0, num_of_slices(BETA_0));
|
d_beta0 = (double)read_navigation_signed(subframe_bits, BETA_0);
|
||||||
d_beta0 = d_beta0 * BETA_0_LSB;
|
d_beta0 = d_beta0 * BETA_0_LSB;
|
||||||
d_beta1 = (double)read_navigation_signed(subframe_bits, BETA_1, num_of_slices(BETA_1));
|
d_beta1 = (double)read_navigation_signed(subframe_bits, BETA_1);
|
||||||
d_beta1 = d_beta1 * BETA_1_LSB;
|
d_beta1 = d_beta1 * BETA_1_LSB;
|
||||||
d_beta2 = (double)read_navigation_signed(subframe_bits, BETA_2, num_of_slices(BETA_2));
|
d_beta2 = (double)read_navigation_signed(subframe_bits, BETA_2);
|
||||||
d_beta2 = d_beta2 * BETA_2_LSB;
|
d_beta2 = d_beta2 * BETA_2_LSB;
|
||||||
d_beta3 = (double)read_navigation_signed(subframe_bits, BETA_3, num_of_slices(BETA_3));
|
d_beta3 = (double)read_navigation_signed(subframe_bits, BETA_3);
|
||||||
d_beta3 = d_beta3 * BETA_3_LSB;
|
d_beta3 = d_beta3 * BETA_3_LSB;
|
||||||
d_A1 = (double)read_navigation_signed(subframe_bits, A_1, num_of_slices(A_1));
|
d_A1 = (double)read_navigation_signed(subframe_bits, A_1);
|
||||||
d_A1 = d_A1 * A_1_LSB;
|
d_A1 = d_A1 * A_1_LSB;
|
||||||
d_A0 = (double)read_navigation_signed(subframe_bits, A_0, num_of_slices(A_0));
|
d_A0 = (double)read_navigation_signed(subframe_bits, A_0);
|
||||||
d_A0 = d_A0 * A_0_LSB;
|
d_A0 = d_A0 * A_0_LSB;
|
||||||
d_t_OT = (double)read_navigation_unsigned(subframe_bits, T_OT,num_of_slices(T_OT));
|
d_t_OT = (double)read_navigation_unsigned(subframe_bits, T_OT);
|
||||||
d_t_OT = d_t_OT * T_OT_LSB;
|
d_t_OT = d_t_OT * T_OT_LSB;
|
||||||
i_WN_T = (int)read_navigation_unsigned(subframe_bits, WN_T, num_of_slices(WN_T));
|
i_WN_T = (int)read_navigation_unsigned(subframe_bits, WN_T);
|
||||||
d_DeltaT_LS = (double)read_navigation_signed(subframe_bits, DELTAT_LS, num_of_slices(DELTAT_LS));
|
d_DeltaT_LS = (double)read_navigation_signed(subframe_bits, DELTAT_LS);
|
||||||
i_WN_LSF = (int)read_navigation_unsigned(subframe_bits, WN_LSF, num_of_slices(WN_LSF));
|
i_WN_LSF = (int)read_navigation_unsigned(subframe_bits, WN_LSF);
|
||||||
i_DN = (int)read_navigation_unsigned(subframe_bits, DN, num_of_slices(DN));; // Right-justified ?
|
i_DN = (int)read_navigation_unsigned(subframe_bits, DN);; // Right-justified ?
|
||||||
d_DeltaT_LSF = (double)read_navigation_signed(subframe_bits, DELTAT_LSF, num_of_slices(DELTAT_LSF));
|
d_DeltaT_LSF = (double)read_navigation_signed(subframe_bits, DELTAT_LSF);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SV_page == 25)
|
if (SV_page == 25)
|
||||||
{
|
{
|
||||||
// Page 25 Anti-Spoofing, SV config and almanac health (PRN: 25-32)
|
// Page 25 Anti-Spoofing, SV config and almanac health (PRN: 25-32)
|
||||||
//! \TODO Read Anti-Spoofing, SV config
|
//! \TODO Read Anti-Spoofing, SV config
|
||||||
almanacHealth[25] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV25, num_of_slices(HEALTH_SV25));
|
almanacHealth[25] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV25);
|
||||||
almanacHealth[26] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV26, num_of_slices(HEALTH_SV26));
|
almanacHealth[26] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV26);
|
||||||
almanacHealth[27] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV27, num_of_slices(HEALTH_SV27));
|
almanacHealth[27] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV27);
|
||||||
almanacHealth[28] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV28, num_of_slices(HEALTH_SV28));
|
almanacHealth[28] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV28);
|
||||||
almanacHealth[29] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV29, num_of_slices(HEALTH_SV29));
|
almanacHealth[29] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV29);
|
||||||
almanacHealth[30] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV30, num_of_slices(HEALTH_SV30));
|
almanacHealth[30] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV30);
|
||||||
almanacHealth[31] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV31, num_of_slices(HEALTH_SV31));
|
almanacHealth[31] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV31);
|
||||||
almanacHealth[32] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV32, num_of_slices(HEALTH_SV32));
|
almanacHealth[32] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV32);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5://--- It is subframe 5 -----------------almanac health (PRN: 1-24) and Almanac reference week number and time.
|
case 5://--- It is subframe 5 -----------------almanac health (PRN: 1-24) and Almanac reference week number and time.
|
||||||
d_TOW_SF5 = (double)read_navigation_unsigned(subframe_bits, TOW, num_of_slices(TOW));
|
d_TOW_SF5 = (double)read_navigation_unsigned(subframe_bits, TOW);
|
||||||
d_TOW_SF5 = d_TOW_SF5*6;
|
d_TOW_SF5 = d_TOW_SF5*6;
|
||||||
d_TOW=d_TOW_SF4;// Set transmission time
|
d_TOW = d_TOW_SF4; // Set transmission time
|
||||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||||
SV_data_ID = (int)read_navigation_unsigned(subframe_bits, SV_DATA_ID, num_of_slices(SV_DATA_ID));
|
SV_data_ID = (int)read_navigation_unsigned(subframe_bits, SV_DATA_ID);
|
||||||
SV_page = (int)read_navigation_unsigned(subframe_bits, SV_PAGE, num_of_slices(SV_PAGE));
|
SV_page = (int)read_navigation_unsigned(subframe_bits, SV_PAGE);
|
||||||
if (SV_page < 25)
|
if (SV_page < 25)
|
||||||
{
|
{
|
||||||
//! \TODO read almanac
|
//! \TODO read almanac
|
||||||
}
|
}
|
||||||
if (SV_page == 25)
|
if (SV_page == 25)
|
||||||
{
|
{
|
||||||
d_Toa = (double)read_navigation_unsigned(subframe_bits,T_OA,num_of_slices(T_OA));
|
d_Toa = (double)read_navigation_unsigned(subframe_bits, T_OA);
|
||||||
d_Toa = d_Toa * T_OA_LSB;
|
d_Toa = d_Toa * T_OA_LSB;
|
||||||
i_WN_A = (int)read_navigation_unsigned(subframe_bits,WN_A,num_of_slices(WN_A));
|
i_WN_A = (int)read_navigation_unsigned(subframe_bits, WN_A);
|
||||||
almanacHealth[1] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV1, num_of_slices(HEALTH_SV1));
|
almanacHealth[1] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV1);
|
||||||
almanacHealth[2] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV2, num_of_slices(HEALTH_SV2));
|
almanacHealth[2] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV2);
|
||||||
almanacHealth[3] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV3, num_of_slices(HEALTH_SV3));
|
almanacHealth[3] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV3);
|
||||||
almanacHealth[4] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV4, num_of_slices(HEALTH_SV4));
|
almanacHealth[4] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV4);
|
||||||
almanacHealth[5] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV5, num_of_slices(HEALTH_SV5));
|
almanacHealth[5] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV5);
|
||||||
almanacHealth[6] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV6, num_of_slices(HEALTH_SV6));
|
almanacHealth[6] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV6);
|
||||||
almanacHealth[7] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV7, num_of_slices(HEALTH_SV7));
|
almanacHealth[7] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV7);
|
||||||
almanacHealth[8] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV8, num_of_slices(HEALTH_SV8));
|
almanacHealth[8] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV8);
|
||||||
almanacHealth[9] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV9, num_of_slices(HEALTH_SV9));
|
almanacHealth[9] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV9);
|
||||||
almanacHealth[10] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV10, num_of_slices(HEALTH_SV10));
|
almanacHealth[10] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV10);
|
||||||
almanacHealth[11] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV11, num_of_slices(HEALTH_SV11));
|
almanacHealth[11] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV11);
|
||||||
almanacHealth[12] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV12, num_of_slices(HEALTH_SV12));
|
almanacHealth[12] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV12);
|
||||||
almanacHealth[13] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV13, num_of_slices(HEALTH_SV13));
|
almanacHealth[13] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV13);
|
||||||
almanacHealth[14] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV14, num_of_slices(HEALTH_SV14));
|
almanacHealth[14] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV14);
|
||||||
almanacHealth[15] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV15, num_of_slices(HEALTH_SV15));
|
almanacHealth[15] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV15);
|
||||||
almanacHealth[16] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV16, num_of_slices(HEALTH_SV16));
|
almanacHealth[16] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV16);
|
||||||
almanacHealth[17] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV17, num_of_slices(HEALTH_SV17));
|
almanacHealth[17] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV17);
|
||||||
almanacHealth[18] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV18, num_of_slices(HEALTH_SV18));
|
almanacHealth[18] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV18);
|
||||||
almanacHealth[19] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV19, num_of_slices(HEALTH_SV19));
|
almanacHealth[19] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV19);
|
||||||
almanacHealth[20] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV20, num_of_slices(HEALTH_SV20));
|
almanacHealth[20] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV20);
|
||||||
almanacHealth[21] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV21, num_of_slices(HEALTH_SV21));
|
almanacHealth[21] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV21);
|
||||||
almanacHealth[22] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV22, num_of_slices(HEALTH_SV22));
|
almanacHealth[22] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV22);
|
||||||
almanacHealth[23] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV23, num_of_slices(HEALTH_SV23));
|
almanacHealth[23] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV23);
|
||||||
almanacHealth[24] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV24, num_of_slices(HEALTH_SV24));
|
almanacHealth[24] = (int)read_navigation_unsigned(subframe_bits, HEALTH_SV24);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -747,7 +743,7 @@ bool Gps_Navigation_Message::satellite_validation()
|
|||||||
// and check if the data have been filled (!=0)
|
// and check if the data have been filled (!=0)
|
||||||
if (d_TOW_SF1 != 0 and d_TOW_SF2 != 0 and d_TOW_SF3 != 0)
|
if (d_TOW_SF1 != 0 and d_TOW_SF2 != 0 and d_TOW_SF3 != 0)
|
||||||
{
|
{
|
||||||
if (d_IODE_SF2 == d_IODE_SF3 and d_IODC == d_IODE_SF2 and d_IODC!=-1)
|
if (d_IODE_SF2 == d_IODE_SF3 and d_IODC == d_IODE_SF2 and d_IODC!= -1)
|
||||||
{
|
{
|
||||||
flag_data_valid = true;
|
flag_data_valid = true;
|
||||||
b_valid_ephemeris_set_flag=true;
|
b_valid_ephemeris_set_flag=true;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* -------------------------------------------------------------------------
|
* -------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
|
* Copyright (C) 2010-2013 (see AUTHORS file for a list of contributors)
|
||||||
*
|
*
|
||||||
* GNSS-SDR is a software defined Global Navigation
|
* GNSS-SDR is a software defined Global Navigation
|
||||||
* Satellite Systems receiver
|
* Satellite Systems receiver
|
||||||
@ -29,8 +29,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef GNSS_SDR_GPS_NAVIGATION_MESSAGE_H
|
#ifndef GNSS_SDR_GPS_NAVIGATION_MESSAGE_H_
|
||||||
#define GNSS_SDR_GPS_NAVIGATION_MESSAGE_H
|
#define GNSS_SDR_GPS_NAVIGATION_MESSAGE_H_
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -51,9 +51,9 @@
|
|||||||
class Gps_Navigation_Message
|
class Gps_Navigation_Message
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
unsigned long int read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const bits_slice *slices, int num_of_slices);
|
unsigned long int read_navigation_unsigned(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int,int>> parameter);
|
||||||
signed long int read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const bits_slice *slices, int num_of_slices);
|
signed long int read_navigation_signed(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int,int>> parameter);
|
||||||
bool read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS> bits, const bits_slice *slices);
|
bool read_navigation_bool(std::bitset<GPS_SUBFRAME_BITS> bits, const std::vector<std::pair<int,int>> parameter);
|
||||||
void print_gps_word_bytes(unsigned int GPS_word);
|
void print_gps_word_bytes(unsigned int GPS_word);
|
||||||
/*
|
/*
|
||||||
* Accounts for the beginning or end of week crossover
|
* Accounts for the beginning or end of week crossover
|
||||||
|
Loading…
x
Reference in New Issue
Block a user